diff mbox series

[net-next] drivers: net: xen-netfront: Fixed W=1 set but unused warnings

Message ID 20201031180435.1081127-1-andrew@lunn.ch
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] drivers: net: xen-netfront: Fixed W=1 set but unused warnings | expand

Checks

Context Check Description
jkicinski/stable success Stable not CCed
jkicinski/header_inline success Link
jkicinski/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 5
jkicinski/checkpatch warning WARNING: simple_strtoul is obsolete, use kstrtoul instead
jkicinski/verify_fixes success Link
jkicinski/kdoc success Errors and warnings before: 5 this patch: 5
jkicinski/build_32bit success Errors and warnings before: 0 this patch: 0
jkicinski/module_param success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/subject_prefix success Link
jkicinski/tree_selection success Clearly marked for net-next
jkicinski/patch_count success Link
jkicinski/fixes_present success Link
jkicinski/cover_letter success Link

Commit Message

Andrew Lunn Oct. 31, 2020, 6:04 p.m. UTC
drivers/net/xen-netfront.c:2416:16: warning: variable ‘target’ set but not used [-Wunused-but-set-variable]
 2416 |  unsigned long target;

Remove target and just discard the return value from simple_strtoul().

This patch does give a checkpatch warning, but the warning was there
before anyway, as this file has lots of checkpatch warnings.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/xen-netfront.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jakub Kicinski Nov. 3, 2020, 12:03 a.m. UTC | #1
On Sat, 31 Oct 2020 19:04:35 +0100 Andrew Lunn wrote:
> drivers/net/xen-netfront.c:2416:16: warning: variable ‘target’ set but not used [-Wunused-but-set-variable]
>  2416 |  unsigned long target;
> 
> Remove target and just discard the return value from simple_strtoul().
> 
> This patch does give a checkpatch warning, but the warning was there
> before anyway, as this file has lots of checkpatch warnings.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3e9895bec15f..920cac4385bf 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2413,12 +2413,11 @@  static ssize_t store_rxbuf(struct device *dev,
 			   const char *buf, size_t len)
 {
 	char *endp;
-	unsigned long target;
 
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
 
-	target = simple_strtoul(buf, &endp, 0);
+	simple_strtoul(buf, &endp, 0);
 	if (endp == buf)
 		return -EBADMSG;