Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1610129 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2017-03-28 00:40 +0200 |
| Last post | 2017-03-28 12:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' Colin King <colin.king@canonical.com> - 2017-03-28 00:40 +0200
RE: [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' YUAN Linyu <Linyu.Yuan@alcatel-sbell.com.cn> - 2017-03-28 01:40 +0200
Re: [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-03-28 12:30 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2017-03-28 00:40 +0200 |
| Subject | [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' |
| Message-ID | <tpLsS-6yQ-19@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
The initial setting of pointer s to the driver name or to the literal
string "(none)" is redundant as later it is always set to point to
a different literal string before it is printed log. Remove this
redundant code.
Detected with CoverityScan, CID#1227032, CID#1227033 ("Unused Value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/usb/gadget/udc/net2272.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 8f85a51bd2b3..dee4eb60d4c2 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -1191,11 +1191,6 @@ registers_show(struct device *_dev, struct device_attribute *attr, char *buf)
size = PAGE_SIZE;
spin_lock_irqsave(&dev->lock, flags);
- if (dev->driver)
- s = dev->driver->driver.name;
- else
- s = "(none)";
-
/* Main Control Registers */
t = scnprintf(next, size, "%s version %s,"
"chiprev %02x, locctl %02x\n"
--
2.11.0
[toc] | [next] | [standalone]
| From | YUAN Linyu <Linyu.Yuan@alcatel-sbell.com.cn> |
|---|---|
| Date | 2017-03-28 01:40 +0200 |
| Subject | RE: [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' |
| Message-ID | <tpMoV-7gK-5@gated-at.bofh.it> |
| In reply to | #1610129 |
Hi,
> -----Original Message-----
> From: Colin King [mailto:colin.king@canonical.com]
> Sent: Tuesday, March 28, 2017 6:35 AM
> To: Felipe Balbi; Greg Kroah-Hartman; YUAN Linyu; Bhumika Goyal; Michal
> Nazarewicz; linux-usb@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] usb: gadget: udc: remove redundant initial assignments to the
> pointer 's'
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The initial setting of pointer s to the driver name or to the literal
> string "(none)" is redundant as later it is always set to point to
> a different literal string before it is printed log. Remove this
> redundant code.
>
> Detected with CoverityScan, CID#1227032, CID#1227033 ("Unused Value")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/usb/gadget/udc/net2272.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/net2272.c
> b/drivers/usb/gadget/udc/net2272.c
> index 8f85a51bd2b3..dee4eb60d4c2 100644
> --- a/drivers/usb/gadget/udc/net2272.c
> +++ b/drivers/usb/gadget/udc/net2272.c
> @@ -1191,11 +1191,6 @@ registers_show(struct device *_dev, struct
> device_attribute *attr, char *buf)
> size = PAGE_SIZE;
> spin_lock_irqsave(&dev->lock, flags);
>
> - if (dev->driver)
> - s = dev->driver->driver.name;
> - else
> - s = "(none)";
> -
> /* Main Control Registers */
> t = scnprintf(next, size, "%s version %s,"
> "chiprev %02x, locctl %02x\n"
I think it's original purpose is not use driver_name directly in below scnprintf function call.
You can change drivers_name below to s.
/* Main Control Registers */
t = scnprintf(next, size, "%s version %s,"
"chiprev %02x, locctl %02x\n"
"irqenb0 %02x irqenb1 %02x "
"irqstat0 %02x irqstat1 %02x\n",
driver_name, driver_vers, dev->chiprev,
> --
> 2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2017-03-28 12:30 +0200 |
| Subject | Re: [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' |
| Message-ID | <tpWxY-69I-3@gated-at.bofh.it> |
| In reply to | #1610129 |
Hello!
On 3/28/2017 1:34 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The initial setting of pointer s to the driver name or to the literal
> string "(none)" is redundant as later it is always set to point to
> a different literal string before it is printed log. Remove this
Printed to log, perhaps?
> redundant code.
>
> Detected with CoverityScan, CID#1227032, CID#1227033 ("Unused Value")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
[...]
MBR, Sergei
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web