From: Johan Hovold <johan@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: [PATCH 2/5] USB: serial: iuu_phoenix: drop unused URB submission results
Date: Wed, 1 Jul 2020 18:53:39 +0200 [thread overview]
Message-ID: <20200701165342.15448-3-johan@kernel.org> (raw)
In-Reply-To: <20200701165342.15448-1-johan@kernel.org>
The driver is submitting URBs in various completion callbacks without
bothering to log errors yet still assigned the return value to temporary
variables. Let's drop those temporaries.
This suppresses the corresponding W=1 (-Wunused-but-set-variable)
warnings.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/iuu_phoenix.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index d5bff69b1769..6336616fee49 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -158,7 +158,6 @@ static int iuu_tiocmget(struct tty_struct *tty)
static void iuu_rxcmd(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
- int result;
int status = urb->status;
if (status) {
@@ -174,7 +173,7 @@ static void iuu_rxcmd(struct urb *urb)
port->bulk_out_endpointAddress),
port->write_urb->transfer_buffer, 1,
read_rxcmd_callback, port);
- result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
+ usb_submit_urb(port->write_urb, GFP_ATOMIC);
}
static int iuu_reset(struct usb_serial_port *port, u8 wt)
@@ -241,7 +240,6 @@ static void iuu_update_status_callback(struct urb *urb)
static void iuu_status_callback(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
- int result;
int status = urb->status;
dev_dbg(&port->dev, "%s - status = %d\n", __func__, status);
@@ -250,7 +248,7 @@ static void iuu_status_callback(struct urb *urb)
port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer, 256,
iuu_update_status_callback, port);
- result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+ usb_submit_urb(port->read_urb, GFP_ATOMIC);
}
static int iuu_status(struct usb_serial_port *port)
@@ -351,7 +349,6 @@ static void iuu_rgbf_fill_buffer(u8 *buf, u8 r1, u8 r2, u8 g1, u8 g2, u8 b1,
static void iuu_led_activity_on(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
- int result;
char *buf_ptr = port->write_urb->transfer_buffer;
*buf_ptr++ = IUU_SET_LED;
if (xmas) {
@@ -366,13 +363,12 @@ static void iuu_led_activity_on(struct urb *urb)
port->bulk_out_endpointAddress),
port->write_urb->transfer_buffer, 8 ,
iuu_rxcmd, port);
- result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
+ usb_submit_urb(port->write_urb, GFP_ATOMIC);
}
static void iuu_led_activity_off(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
- int result;
char *buf_ptr = port->write_urb->transfer_buffer;
if (xmas) {
iuu_rxcmd(urb);
@@ -386,7 +382,7 @@ static void iuu_led_activity_off(struct urb *urb)
port->bulk_out_endpointAddress),
port->write_urb->transfer_buffer, 8 ,
iuu_rxcmd, port);
- result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
+ usb_submit_urb(port->write_urb, GFP_ATOMIC);
}
--
2.26.2
next prev parent reply other threads:[~2020-07-01 16:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 16:53 [PATCH 0/5] USB: serial: W=1 related cleanups Johan Hovold
2020-07-01 16:53 ` [PATCH 1/5] USB: serial: garmin_gps: don't compile unused packet definitions Johan Hovold
2020-07-01 16:53 ` Johan Hovold [this message]
2020-07-01 16:53 ` [PATCH 3/5] USB: serial: keyspan_pda: drop unused firmware reset status Johan Hovold
2020-07-01 16:53 ` [PATCH 4/5] USB: serial: kobil_sct: log failure to update line settings Johan Hovold
2020-07-01 16:53 ` [PATCH 5/5] USB: serial: quatech2: drop two stub functions Johan Hovold
2020-07-01 17:23 ` [PATCH 0/5] USB: serial: W=1 related cleanups Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200701165342.15448-3-johan@kernel.org \
--to=johan@kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).