netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] prism54: fix compare_const_fl.cocci warnings (fwd)
@ 2015-12-07  9:55 Julia Lawall
  2015-12-11 11:48 ` prism54: fix compare_const_fl.cocci warnings Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-12-07  9:55 UTC (permalink / raw)
  To: Kalle Valo <kvalo@adurom.com> Kalle Valo
  Cc: Luis R. Rodriguez, linux-wireless, kbuild-all, netdev,
	linux-kernel

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

It looks a little nicer to me because n is the thing we care about.

 oid_mgt.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/net/wireless/intersil/prism54/oid_mgt.c
+++ b/drivers/net/wireless/intersil/prism54/oid_mgt.c
@@ -424,7 +424,7 @@ mgt_set_request(islpci_private *priv, en
 	void *cache, *_data = data;
 	u32 oid;

-	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(n >= OID_NUM_LAST);
 	BUG_ON(extra > isl_oid[n].range);

 	if (!priv->mib)
@@ -485,7 +485,7 @@ mgt_set_varlen(islpci_private *priv, enu
 	int dlen;
 	u32 oid;

-	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(n >= OID_NUM_LAST);

 	dlen = isl_oid[n].size;
 	oid = isl_oid[n].oid;
@@ -524,7 +524,7 @@ mgt_get_request(islpci_private *priv, en
 	void *cache, *_res = NULL;
 	u32 oid;

-	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(n >= OID_NUM_LAST);
 	BUG_ON(extra > isl_oid[n].range);

 	res->ptr = NULL;
@@ -626,7 +626,7 @@ mgt_commit_list(islpci_private *priv, en
 void
 mgt_set(islpci_private *priv, enum oid_num_t n, void *data)
 {
-	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(n >= OID_NUM_LAST);
 	BUG_ON(priv->mib[n] == NULL);

 	memcpy(priv->mib[n], data, isl_oid[n].size);
@@ -636,7 +636,7 @@ mgt_set(islpci_private *priv, enum oid_n
 void
 mgt_get(islpci_private *priv, enum oid_num_t n, void *res)
 {
-	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(n >= OID_NUM_LAST);
 	BUG_ON(priv->mib[n] == NULL);
 	BUG_ON(res == NULL);

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

* Re: prism54: fix compare_const_fl.cocci warnings
  2015-12-07  9:55 [PATCH] prism54: fix compare_const_fl.cocci warnings (fwd) Julia Lawall
@ 2015-12-11 11:48 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-12-11 11:48 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kalle Valo <kvalo@adurom.com> Kalle Valo, Luis R. Rodriguez,
	linux-wireless, kbuild-all, netdev, linux-kernel


> Move constants to the right of binary operators.
> 
> Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

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

end of thread, other threads:[~2015-12-11 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07  9:55 [PATCH] prism54: fix compare_const_fl.cocci warnings (fwd) Julia Lawall
2015-12-11 11:48 ` prism54: fix compare_const_fl.cocci warnings Kalle Valo

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