[PATCH 05/10] Staging: bcm: Change the style of comparing structures to null in InterfaceMisc.c.

Kevin McKinney klmckinney1 at gmail.com
Sat Oct 13 03:49:33 UTC 2012


This patch changes the style of comparing
structures to null. Instead of this:
"if (foo == NULL) {" or "if (foo != NULL) {",
the new logic uses: "if (!foo) {" or
"if (foo) {".

Signed-off-by: Kevin McKinney <klmckinney1 at gmail.com>
---
 drivers/staging/bcm/InterfaceMisc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c
index 5a4768d..f7166f1 100644
--- a/drivers/staging/bcm/InterfaceMisc.c
+++ b/drivers/staging/bcm/InterfaceMisc.c
@@ -8,7 +8,7 @@ int InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter,
 	int bytes;
 	unsigned short usRetries = 0;
 
-	if (psIntfAdapter == NULL) {
+	if (!psIntfAdapter) {
 		BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Interface Adapter is NULL");
 		return -EINVAL;
 	}
@@ -65,7 +65,7 @@ int InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter,
 	int retval = 0;
 	unsigned short usRetries = 0;
 
-	if (psIntfAdapter == NULL) {
+	if (!psIntfAdapter) {
 		BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Interface Adapter  is NULL");
 		return -EINVAL;
 	}
@@ -193,7 +193,7 @@ VOID Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter)
 	 */
 
 	/* Cancel submitted Interrupt-URB's */
-	if (psIntfAdapter->psInterruptUrb != NULL) {
+	if (psIntfAdapter->psInterruptUrb) {
 		if (psIntfAdapter->psInterruptUrb->status == -EINPROGRESS)
 			usb_kill_urb(psIntfAdapter->psInterruptUrb);
 	}
-- 
1.7.9.5




More information about the devel mailing list