From: Gaston Gonzalez <gascoar@gmail.com>
To: linux-staging@lists.linux.dev
Cc: dpenkler@gmail.com, gregkh@linuxfoundation.org, arnd@arndb.de,
dan.carpenter@linaro.org, ajithpv.linux@gmail.com,
roheetchavan@gmail.com, niharchaithanya@gmail.com,
eleanor15x@gmail.com, everestkc@everestkc.com.np,
kees@ijzerbout.nl, skhan@linuxfoundation.org,
linux-kernel@vger.kernel.org, gascoar@gmail.com
Subject: [PATCH v2 3/5] staging: gpib: ni_usb: remove unused variable
Date: Fri, 14 Feb 2025 16:54:44 -0300 [thread overview]
Message-ID: <20250214195456.104075-7-gascoar@gmail.com> (raw)
In-Reply-To: <20250214195456.104075-1-gascoar@gmail.com>
Remove unused variable 'adr1_bits' in function 'parse_board_ibrd_readback'
Since the value of the variable 'i' is increased when 'adr1_bits' is set, the
'i++' post-increment was added in order to keep the value of 'i' right.
This change removes the following warning:
warning: variable ‘adr1_bits’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: added post-increment 'i++'.
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index d0656dc520f5..41d9cccdaf10 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -427,7 +427,6 @@ static int parse_board_ibrd_readback(const u8 *raw_data, struct ni_usb_status_bl
int i = 0;
int j = 0;
int k;
- unsigned int adr1_bits;
int num_data_blocks = 0;
struct ni_usb_status_block register_write_status;
int unexpected = 0;
@@ -460,7 +459,7 @@ static int parse_board_ibrd_readback(const u8 *raw_data, struct ni_usb_status_bl
pr_err("%s: bug: status->id=%i, != ibrd_status_id\n", __func__, status->id);
return -EIO;
}
- adr1_bits = raw_data[i++];
+ i++;
if (num_data_blocks) {
*actual_bytes_read = (num_data_blocks - 1) * data_block_length + raw_data[i++];
} else {
--
2.48.1
next prev parent reply other threads:[~2025-02-14 19:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 2/5] staging: gpib: eastwood: " Gaston Gonzalez
2025-02-14 19:54 ` Gaston Gonzalez [this message]
2025-02-14 19:54 ` [PATCH v2 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 5/5] staging: gpib: ines: " Gaston Gonzalez
2025-02-16 15:11 ` [PATCH v2 0/5] staging: gpib: remove unused variables Dan Carpenter
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=20250214195456.104075-7-gascoar@gmail.com \
--to=gascoar@gmail.com \
--cc=ajithpv.linux@gmail.com \
--cc=arnd@arndb.de \
--cc=dan.carpenter@linaro.org \
--cc=dpenkler@gmail.com \
--cc=eleanor15x@gmail.com \
--cc=everestkc@everestkc.com.np \
--cc=gregkh@linuxfoundation.org \
--cc=kees@ijzerbout.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=niharchaithanya@gmail.com \
--cc=roheetchavan@gmail.com \
--cc=skhan@linuxfoundation.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