Skip to contentSkip to conversation

NFC: netlink: Use error code from nfc_activate_target()

PATCH Applied Andy Shevchenko 2 participants 2 messages Mar 22, 2017 – Apr 5, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFC: netlink: Use error code from nfc_activate_target()

It looks like a typo to assign a return code to a variable which is not used. Found due to a compiler warning:

net/nfc/netlink.c: In function ‘nfc_genl_activate_target’:
net/nfc/netlink.c:903:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

  int rc;
        ^~
---
 net/nfc/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/nfc/netlink.c +1 -1
index 03f3d5c7beb8..03be522127ec 100644
@@ -918,7 +918,7 @@ static int nfc_genl_activate_target(struct sk_buff *skb, struct genl_info *info)
 	rc = nfc_activate_target(dev, target_idx, protocol);
 
 	nfc_put_device(dev);
-	return 0;
+	return rc;
 }
 
 static int nfc_genl_dep_link_up(struct sk_buff *skb, struct genl_info *info)
Signature · 1 line
2.11.0

A message that is not in the archive (sent off-list or not yet received): 20170322192058.30193-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]

Applied
#2 lore raw

Hi Andy,

Quoted 5 lines · Andy Shevchenko

It looks like a typo to assign a return code to a variable which is not used. Found due to a compiler warning:

net/nfc/netlink.c: In function ‘nfc_genl_activate_target’:
net/nfc/netlink.c:903:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

Quoted 7 lines
  int rc;
        ^~
---
 net/nfc/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Cheers,
Samuel.