Skip to contentSkip to conversation

staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

PATCH In review Mario J. Rugiero 3 participants 8 messages Dec 1, 2015 – Dec 3, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: cleanup: Fix incompatible type comparison in wilc1000/host_interface.c

This patch replaces an "if (ptr > 0)" comparison that seems to be a confusing way to check for null by a simpler "if (ptr)" check.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d5b7725..0c87f6c 100644
@@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
 	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
 	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
 
-	if (pstrSetBeaconParam->tail > 0)
+	if (pstrSetBeaconParam->tail)
 		memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
 	pu8CurrByte += pstrSetBeaconParam->tail_len;
 
Signature · 1 line
2.6.2
#1 lore raw

Put v2 in the subject. Also the subsystem prefix is:

[PATCH v3] staging: wilc1000: ...

Quoted 5 lines · Mario J. Rugiero

This patch replaces an "if (ptr > 0)" comparison that seems to be a confusing way to check for null by a simpler "if (ptr)" check.

---

v2: Remove the != NULL because checkpatch complains.

drivers/staging/wilc1000/host_interface.c static void Handle_AddBeacon(struct host_if_drv *hif_drv, · line 2273

Quoted 13 lines
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d5b7725..0c87f6c 100644
@@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
 	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
 	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
 
-	if (pstrSetBeaconParam->tail > 0)
+	if (pstrSetBeaconParam->tail)

Probably the intention was to check if "pstrSetBeaconParam->tail_len > 0" but I'm not sure. The wilc1000 maintainers are very responsive though so maybe they will know for sure.

regards,
dan carpenter

#2 lore raw

OK. Since the maintainers are CC'd, I guess I should wait for a clarification about this?

Quoted 33 lines · Dan Carpenter

Put v2 in the subject. Also the subsystem prefix is:

[PATCH v3] staging: wilc1000: ...

Quoted 5 lines · Mario J. Rugiero

This patch replaces an "if (ptr > 0)" comparison that seems to be a confusing way to check for null by a simpler "if (ptr)" check.

---

v2: Remove the != NULL because checkpatch complains.

drivers/staging/wilc1000/host_interface.c static void Handle_AddBeacon(struct host_if_drv *hif_drv, · line 2273

Quoted 13 lines
  drivers/staging/wilc1000/host_interface.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d5b7725..0c87f6c 100644
@@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
  	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
  	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
 
-	if (pstrSetBeaconParam->tail > 0)
+	if (pstrSetBeaconParam->tail)

Probably the intention was to check if "pstrSetBeaconParam->tail_len > 0" but I'm not sure. The wilc1000 maintainers are very responsive though so maybe they will know for sure.

regards,
dan carpenter

#3 lore raw
Quoted 1 line · Mario J. Rugiero

OK. Since the maintainers are CC'd, I guess I should wait for a clarification about this?

Hi Mario,

The purpose of that is to check if tail is null or not. if it is not null, there is tail to send, so copy to buff.

regards,
glen lee.

Quoted 41 lines · Dan Carpenter
Quoted 26 lines

Put v2 in the subject. Also the subsystem prefix is:

[PATCH v3] staging: wilc1000: ...

Quoted 5 lines · Mario J. Rugiero

This patch replaces an "if (ptr > 0)" comparison that seems to be a confusing way to check for null by a simpler "if (ptr)" check.

---

v2: Remove the != NULL because checkpatch complains.

drivers/staging/wilc1000/host_interface.c static void Handle_AddBeacon(struct · line 2274

Quoted 13 lines

drivers/staging/wilc1000/host_interface.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -0
index d5b7725..0c87f6c 100644
@@ -2270,7 +2270,7 @@ static void Handle_AddBeacon(struct 
 host_if_drv *hif_drv,
      *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
      *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
  -    if (pstrSetBeaconParam->tail > 0)
+    if (pstrSetBeaconParam->tail)

Probably the intention was to check if "pstrSetBeaconParam->tail_len

Quoted 8 lines
Quoted 1 line

0"

but I'm not sure. The wilc1000 maintainers are very responsive though so maybe they will know for sure.

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#4 lore raw

Thank you. Then the patch itself should see no changes as of now, am I right? Should I submit a new one anyway to fix the subject line?

Regards,
Mario.

#5 lore raw
Quoted 3 lines · Mario J. Rugiero

Thank you. Then the patch itself should see no changes as of now, am I right?
Should I submit a new one anyway to fix the subject line?

Yes, please.

regards,
dan carpenter

#6 lore raw

Would be v3, or remains v2 because of the lack of further changes afterwards?

Regards,
Mario.

Quoted 9 lines · Dan Carpenter
Quoted 3 lines · Mario J. Rugiero

Thank you. Then the patch itself should see no changes as of now, am I right?
Should I submit a new one anyway to fix the subject line?

Yes, please.

regards,
dan carpenter

#7 lore raw
Quoted 2 lines · Mario J. Rugiero

Would be v3, or remains v2 because of the lack of further changes afterwards?

Bump the version number.

regards,
dan carpenter