Skip to contentSkip to conversation

batman-adv: Place constant on right side of comparison

PATCH Applied Sven Eckelmann 2 participants 2 messages Sep 13, 2015 – Sep 14, 2015 Batman advanced

lore
Share & tools
lore

Sven Eckelmann

author maintainer
#0 lore raw

PATCH v2 1/1 batman-adv: Place constant on right side of comparison

checkpatch warns when the constant is on the left side of a comparison.

Fixes 56fd0bab9c18 ("batman-adv: Fix gw_bandwidth calculation on 32 bit systems")

---
v2: fix stupid error in the commit message

 net/batman-adv/gateway_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/gateway_common.c +2 -2
index 0cb5e6b..66d9514 100644
@@ -89,7 +89,7 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,
 		break;
 	}
 
-	if (U32_MAX < ldown) {
+	if (ldown > U32_MAX) {
 		batadv_err(net_dev,
 			   "Download speed of gateway mode too large: %s\n",
 			   buff);
@@ -139,7 +139,7 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,
 			break;
 		}
 
-		if (U32_MAX < lup) {
+		if (lup > U32_MAX) {
 			batadv_err(net_dev,
 				   "Upload speed of gateway mode too large: %s\n",
 				   slash_ptr + 1);
Signature · 1 line
2.5.1
#1 lore raw
Quoted 9 lines · On Sunday, September 13, 2015 09:44:45 Sven Eckelmann wrote:

checkpatch warns when the constant is on the left side of a comparison.

Fixes 56fd0bab9c18 ("batman-adv: Fix gw_bandwidth calculation on 32 bit

systems") Signed-off-by: Sven Eckelmann <[email protected]>
---
v2: fix stupid error in the commit message

 net/batman-adv/gateway_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision cef7403.

Thanks,
Marek