Re: [PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes
Hi All, On Mon, May 30, 2016 at 12:53 PM, Kirtika Ruchandaniwrote: > This patch fixes the following spacing issues reported > by checkpatch.pl - > - space preferred around that > - no space needed after cast. > - Alignment should match open parenthesis > - suspect code indent for conditional statements > - Statements should start on a tabstop > > This patch also contains two hunks to fix 'line over 80 characters', > that are spacing related. > All other instances of that warning have been ignored. > > Signed-off-by: Kirtika Ruchandani With Kirtika's explanation, this is: Reviewed-by: Julian Calaby Thanks, Julian Calaby > --- > net/wireless/nl80211.c | 103 > ++--- > 1 file changed, 54 insertions(+), 49 deletions(-) > > diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c > index 11cbf0b..ad7cdce 100644 > --- a/net/wireless/nl80211.c > +++ b/net/wireless/nl80211.c > @@ -39,10 +39,10 @@ static void nl80211_post_doit(const struct genl_ops *ops, > struct sk_buff *skb, > > /* the netlink family */ > static struct genl_family nl80211_fam = { > - .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ > - .name = NL80211_GENL_NAME, /* have users key off the name > instead */ > - .hdrsize = 0, /* no private header */ > - .version = 1, /* no particular meaning now */ > + .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ > + .name = NL80211_GENL_NAME, /* have users key off the name instead */ > + .hdrsize = 0, /* no private header */ > + .version = 1, /* no particular meaning now */ > .maxattr = NL80211_ATTR_MAX, > .netnsok = true, > .pre_doit = nl80211_pre_doit, > @@ -213,7 +213,7 @@ cfg80211_get_dev_from_info(struct net *netns, struct > genl_info *info) > static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { > [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, > [NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING, > - .len = 20-1 }, > + .len = 20 - 1 }, > [NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED }, > > [NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 }, > @@ -231,7 +231,7 @@ static const struct nla_policy > nl80211_policy[NUM_NL80211_ATTR] = { > > [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, > [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, > - [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, > + [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ - 1 > }, > > [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, > [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, > @@ -967,7 +967,7 @@ static int nl80211_put_iface_combinations(struct wiphy > *wiphy, > int i, j; > > nl_combis = nla_nest_start(msg, > - NL80211_ATTR_INTERFACE_COMBINATIONS); > + NL80211_ATTR_INTERFACE_COMBINATIONS); > if (!nl_combis) > goto nla_put_failure; > > @@ -1012,9 +1012,9 @@ static int nl80211_put_iface_combinations(struct wiphy > *wiphy, > goto nla_put_failure; > if (large && > (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, > - c->radar_detect_widths) || > +c->radar_detect_widths) || > nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, > - c->radar_detect_regions))) > +c->radar_detect_regions))) > goto nla_put_failure; > > nla_nest_end(msg, nl_combi); > @@ -1493,7 +1493,7 @@ static int nl80211_send_wiphy(struct > cfg80211_registered_device *rdev, > > i = 0; > #define CMD(op, n) \ > -do { \ > + do {\ > if (rdev->ops->op) {\ > i++;\ > if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \ > @@ -1735,8 +1735,9 @@ static int nl80211_send_wiphy(struct > cfg80211_registered_device *rdev, >rdev->wiphy.max_num_csa_counters)) > goto nla_put_failure; > > - if (rdev->wiphy.regulatory_flags & > REGULATORY_WIPHY_SELF_MANAGED && > - nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) > + if ((rdev->wiphy.regulatory_flags & > +
Re: [PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes
Hi Kirtika, On Mon, May 30, 2016 at 4:04 PM, Kirtika Ruchandaniwrote: >> Adding the brackets around the & expression doesn't look spacing >> related to me. What's the exact warning this is fixing? > > From the commit message - "This patch also contains two hunks to fix > 'line over 80 characters', > that are spacing related". This is the second hunk, the first being > the comments in the nl80211_fam > definition. Should I resend with these two hunks omitted, or fix my wording? That explains it, I missed that bit. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/
Re: [PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes
> Adding the brackets around the & expression doesn't look spacing > related to me. What's the exact warning this is fixing? >From the commit message - "This patch also contains two hunks to fix 'line over 80 characters', that are spacing related". This is the second hunk, the first being the comments in the nl80211_fam definition. Should I resend with these two hunks omitted, or fix my wording?
Re: [PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes
Hi All, On Mon, May 30, 2016 at 12:53 PM, Kirtika Ruchandaniwrote: > This patch fixes the following spacing issues reported > by checkpatch.pl - > - space preferred around that > - no space needed after cast. > - Alignment should match open parenthesis > - suspect code indent for conditional statements > - Statements should start on a tabstop > > This patch also contains two hunks to fix 'line over 80 characters', > that are spacing related. > All other instances of that warning have been ignored. > > Signed-off-by: Kirtika Ruchandani Looks right to me except for one minor point: > --- > net/wireless/nl80211.c | 103 > ++--- > 1 file changed, 54 insertions(+), 49 deletions(-) > > diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c > index 11cbf0b..ad7cdce 100644 > --- a/net/wireless/nl80211.c > +++ b/net/wireless/nl80211.c > @@ -1735,8 +1735,9 @@ static int nl80211_send_wiphy(struct > cfg80211_registered_device *rdev, >rdev->wiphy.max_num_csa_counters)) > goto nla_put_failure; > > - if (rdev->wiphy.regulatory_flags & > REGULATORY_WIPHY_SELF_MANAGED && > - nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) > + if ((rdev->wiphy.regulatory_flags & > +REGULATORY_WIPHY_SELF_MANAGED) && > +nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) Adding the brackets around the & expression doesn't look spacing related to me. What's the exact warning this is fixing? > goto nla_put_failure; > > if (nla_put(msg, NL80211_ATTR_EXT_FEATURES, Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/
[PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes
This patch fixes the following spacing issues reported by checkpatch.pl - - space preferred around that - no space needed after cast. - Alignment should match open parenthesis - suspect code indent for conditional statements - Statements should start on a tabstop This patch also contains two hunks to fix 'line over 80 characters', that are spacing related. All other instances of that warning have been ignored. Signed-off-by: Kirtika Ruchandani--- net/wireless/nl80211.c | 103 ++--- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 11cbf0b..ad7cdce 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -39,10 +39,10 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, /* the netlink family */ static struct genl_family nl80211_fam = { - .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ - .name = NL80211_GENL_NAME, /* have users key off the name instead */ - .hdrsize = 0, /* no private header */ - .version = 1, /* no particular meaning now */ + .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ + .name = NL80211_GENL_NAME, /* have users key off the name instead */ + .hdrsize = 0, /* no private header */ + .version = 1, /* no particular meaning now */ .maxattr = NL80211_ATTR_MAX, .netnsok = true, .pre_doit = nl80211_pre_doit, @@ -213,7 +213,7 @@ cfg80211_get_dev_from_info(struct net *netns, struct genl_info *info) static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, [NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING, - .len = 20-1 }, + .len = 20 - 1 }, [NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED }, [NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 }, @@ -231,7 +231,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, - [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, + [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ - 1 }, [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, @@ -967,7 +967,7 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy, int i, j; nl_combis = nla_nest_start(msg, - NL80211_ATTR_INTERFACE_COMBINATIONS); + NL80211_ATTR_INTERFACE_COMBINATIONS); if (!nl_combis) goto nla_put_failure; @@ -1012,9 +1012,9 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy, goto nla_put_failure; if (large && (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, - c->radar_detect_widths) || +c->radar_detect_widths) || nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, - c->radar_detect_regions))) +c->radar_detect_regions))) goto nla_put_failure; nla_nest_end(msg, nl_combi); @@ -1493,7 +1493,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, i = 0; #define CMD(op, n) \ -do { \ + do {\ if (rdev->ops->op) {\ i++;\ if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \ @@ -1735,8 +1735,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, rdev->wiphy.max_num_csa_counters)) goto nla_put_failure; - if (rdev->wiphy.regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED && - nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) + if ((rdev->wiphy.regulatory_flags & +REGULATORY_WIPHY_SELF_MANAGED) && +nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) goto nla_put_failure; if (nla_put(msg, NL80211_ATTR_EXT_FEATURES, @@ -2299,7 +2300,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) if (frag_threshold < 256) return -EINVAL; -