[23/32] usb: gadget: udc: max3420_udc: Remove set, but never checked variable 'addr'

Message ID 20200706133341.476881-24-lee.jones@linaro.org
State New
Headers show
Series
  • Fix the final bunch of W=1 issues in USB
Related show

Commit Message

Lee Jones July 6, 2020, 1:33 p.m.
Fixes the following W=1 kernel build warning(s):

 drivers/usb/gadget/udc/max3420_udc.c: In function ‘max3420_handle_setup’:
 drivers/usb/gadget/udc/max3420_udc.c:626:5: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
 626 | u8 addr;
 | ^~~~

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/usb/gadget/udc/max3420_udc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.25.1

Comments

Jassi Brar July 6, 2020, 4:08 p.m. | #1
On Mon, 6 Jul 2020 at 08:34, Lee Jones <lee.jones@linaro.org> wrote:

> diff --git a/drivers/usb/gadget/udc/max3420_udc.c b/drivers/usb/gadget/udc/max3420_udc.c

> index 23f33946d80c4..52884bae4af11 100644

> --- a/drivers/usb/gadget/udc/max3420_udc.c

> +++ b/drivers/usb/gadget/udc/max3420_udc.c

> @@ -623,7 +623,6 @@ static void max3420_set_clear_feature(struct max3420_udc *udc)

>  static void max3420_handle_setup(struct max3420_udc *udc)

>  {

>         struct usb_ctrlrequest setup;

> -       u8 addr;

>

>         spi_rd_buf(udc, MAX3420_REG_SUDFIFO, (void *)&setup, 8);

>

> @@ -647,7 +646,7 @@ static void max3420_handle_setup(struct max3420_udc *udc)

>                                 USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {

>                         break;

>                 }

> -               addr = spi_rd8_ack(udc, MAX3420_REG_FNADDR, 1);

> +               spi_rd8_ack(udc, MAX3420_REG_FNADDR, 1);

>                 dev_dbg(udc->dev, "Assigned Address=%d\n", udc->setup.wValue);

>                 return;

>         case USB_REQ_CLEAR_FEATURE:


Acked-by: Jassi Brar <jaswinder.singh@linaro.org>

Patch

diff --git a/drivers/usb/gadget/udc/max3420_udc.c b/drivers/usb/gadget/udc/max3420_udc.c
index 23f33946d80c4..52884bae4af11 100644
--- a/drivers/usb/gadget/udc/max3420_udc.c
+++ b/drivers/usb/gadget/udc/max3420_udc.c
@@ -623,7 +623,6 @@  static void max3420_set_clear_feature(struct max3420_udc *udc)
 static void max3420_handle_setup(struct max3420_udc *udc)
 {
 	struct usb_ctrlrequest setup;
-	u8 addr;
 
 	spi_rd_buf(udc, MAX3420_REG_SUDFIFO, (void *)&setup, 8);
 
@@ -647,7 +646,7 @@  static void max3420_handle_setup(struct max3420_udc *udc)
 				USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
 			break;
 		}
-		addr = spi_rd8_ack(udc, MAX3420_REG_FNADDR, 1);
+		spi_rd8_ack(udc, MAX3420_REG_FNADDR, 1);
 		dev_dbg(udc->dev, "Assigned Address=%d\n", udc->setup.wValue);
 		return;
 	case USB_REQ_CLEAR_FEATURE: