* [PATCH 1/2] USB: trancevibrator: remove redundant space
@ 2022-08-11 2:53 Dongliang Mu
2022-08-11 2:53 ` [PATCH 2/2] USB: ncevibrator: simplify tv_probe Dongliang Mu
0 siblings, 1 reply; 4+ messages in thread
From: Dongliang Mu @ 2022-08-11 2:53 UTC (permalink / raw
To: Greg Kroah-Hartman, Dongliang Mu; +Cc: linux-usb, linux-kernel
From: Dongliang Mu <mudongliangabcd@gmail.com>
remove a redundant space after usb_get_intfdata
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
drivers/usb/misc/trancevibrator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c
index 26baba3ab7d7..55cb63652eda 100644
--- a/drivers/usb/misc/trancevibrator.c
+++ b/drivers/usb/misc/trancevibrator.c
@@ -106,7 +106,7 @@ static void tv_disconnect(struct usb_interface *interface)
{
struct trancevibrator *dev;
- dev = usb_get_intfdata (interface);
+ dev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
usb_put_dev(dev->udev);
kfree(dev);
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] USB: ncevibrator: simplify tv_probe
2022-08-11 2:53 [PATCH 1/2] USB: trancevibrator: remove redundant space Dongliang Mu
@ 2022-08-11 2:53 ` Dongliang Mu
2022-08-11 8:34 ` Sergey Shtylyov
0 siblings, 1 reply; 4+ messages in thread
From: Dongliang Mu @ 2022-08-11 2:53 UTC (permalink / raw
To: Greg Kroah-Hartman, Dongliang Mu; +Cc: linux-usb, linux-kernel
From: Dongliang Mu <mudongliangabcd@gmail.com>
The function tv_probe does not need to invoke kfree when the
allocation fails. So let's simplify the code of tv_probe.
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
drivers/usb/misc/trancevibrator.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c
index 55cb63652eda..30d4d774d448 100644
--- a/drivers/usb/misc/trancevibrator.c
+++ b/drivers/usb/misc/trancevibrator.c
@@ -84,22 +84,15 @@ static int tv_probe(struct usb_interface *interface,
{
struct usb_device *udev = interface_to_usbdev(interface);
struct trancevibrator *dev;
- int retval;
dev = kzalloc(sizeof(struct trancevibrator), GFP_KERNEL);
- if (!dev) {
- retval = -ENOMEM;
- goto error;
- }
+ if (!dev)
+ return -ENOMEM;
dev->udev = usb_get_dev(udev);
usb_set_intfdata(interface, dev);
return 0;
-
-error:
- kfree(dev);
- return retval;
}
static void tv_disconnect(struct usb_interface *interface)
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] USB: ncevibrator: simplify tv_probe
2022-08-11 2:53 ` [PATCH 2/2] USB: ncevibrator: simplify tv_probe Dongliang Mu
@ 2022-08-11 8:34 ` Sergey Shtylyov
2022-08-11 8:57 ` Dongliang Mu
0 siblings, 1 reply; 4+ messages in thread
From: Sergey Shtylyov @ 2022-08-11 8:34 UTC (permalink / raw
To: Dongliang Mu, Greg Kroah-Hartman, Dongliang Mu; +Cc: linux-usb, linux-kernel
Hello!
Your subject is broken now. :-)
MBR, Sergey
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] USB: ncevibrator: simplify tv_probe
2022-08-11 8:34 ` Sergey Shtylyov
@ 2022-08-11 8:57 ` Dongliang Mu
0 siblings, 0 replies; 4+ messages in thread
From: Dongliang Mu @ 2022-08-11 8:57 UTC (permalink / raw
To: Sergey Shtylyov; +Cc: Dongliang Mu, Greg Kroah-Hartman, USB, linux-kernel
On Thu, Aug 11, 2022 at 4:34 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> Hello!
>
> Your subject is broken now. :-)
Yes, thanks for your reminder. Will send a v2 patch.
>
> MBR, Sergey
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-11 8:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11 2:53 [PATCH 1/2] USB: trancevibrator: remove redundant space Dongliang Mu
2022-08-11 2:53 ` [PATCH 2/2] USB: ncevibrator: simplify tv_probe Dongliang Mu
2022-08-11 8:34 ` Sergey Shtylyov
2022-08-11 8:57 ` Dongliang Mu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.