netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] genetlink: rename shadowed variable
@ 2013-11-18 19:54 Johannes Berg
  2013-11-18 20:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2013-11-18 19:54 UTC (permalink / raw)
  To: netdev; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Sparse pointed out that the new flags variable I had added
shadowed an existing one, rename the new one to avoid that,
making the code clearer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/netlink/genetlink.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 9bdc581..7dbc4f7 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -680,21 +680,21 @@ static int ctrl_fill_info(struct genl_family *family, u32 portid, u32 seq,
 		for (i = 0; i < family->n_ops; i++) {
 			struct nlattr *nest;
 			const struct genl_ops *ops = &family->ops[i];
-			u32 flags = ops->flags;
+			u32 op_flags = ops->flags;
 
 			if (ops->dumpit)
-				flags |= GENL_CMD_CAP_DUMP;
+				op_flags |= GENL_CMD_CAP_DUMP;
 			if (ops->doit)
-				flags |= GENL_CMD_CAP_DO;
+				op_flags |= GENL_CMD_CAP_DO;
 			if (ops->policy)
-				flags |= GENL_CMD_CAP_HASPOL;
+				op_flags |= GENL_CMD_CAP_HASPOL;
 
 			nest = nla_nest_start(skb, i + 1);
 			if (nest == NULL)
 				goto nla_put_failure;
 
 			if (nla_put_u32(skb, CTRL_ATTR_OP_ID, ops->cmd) ||
-			    nla_put_u32(skb, CTRL_ATTR_OP_FLAGS, flags))
+			    nla_put_u32(skb, CTRL_ATTR_OP_FLAGS, op_flags))
 				goto nla_put_failure;
 
 			nla_nest_end(skb, nest);
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] genetlink: rename shadowed variable
  2013-11-18 19:54 [PATCH] genetlink: rename shadowed variable Johannes Berg
@ 2013-11-18 20:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-11-18 20:34 UTC (permalink / raw)
  To: johannes; +Cc: netdev, johannes.berg

From: Johannes Berg <johannes@sipsolutions.net>
Date: Mon, 18 Nov 2013 20:54:58 +0100

> From: Johannes Berg <johannes.berg@intel.com>
> 
> Sparse pointed out that the new flags variable I had added
> shadowed an existing one, rename the new one to avoid that,
> making the code clearer.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Applied, thanks Johannes.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-18 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18 19:54 [PATCH] genetlink: rename shadowed variable Johannes Berg
2013-11-18 20:34 ` David Miller

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).