Skip to contentSkip to conversation

Staging: slicoss: Use !x instead of x == NULL.

PATCH In review Sandhya Bankar 2 participants 2 messages Mar 6, 2016 – Mar 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: slicoss: Use !x instead of x == NULL.

Use !x instead of x == NULL.This patch is found by checkpatch.pl script.

---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

 drivers/staging/slicoss/slicoss.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slicoss.c +3 -3
index a91c60a..acf73f0 100644
@@ -1807,7 +1807,7 @@ static int slic_mcast_add_list(struct adapter *adapter, char *address)
 
 	/* Doesn't already exist.  Allocate a structure to hold it */
 	mcaddr = kmalloc(sizeof(struct mcast_address), GFP_ATOMIC);
-	if (mcaddr == NULL)
+	if (!mcaddr)
 		return 1;
 
 	ether_addr_copy(mcaddr->address, address);
@@ -1888,7 +1888,7 @@ static void slic_xmit_fail(struct adapter *adapter,
 {
 	if (adapter->xmitq_full)
 		netif_stop_queue(adapter->netdev);
-	if ((cmd == NULL) && (status <= XMIT_FAIL_HOSTCMD_FAIL)) {
+	if (!cmd && (status <= XMIT_FAIL_HOSTCMD_FAIL)) {
 		switch (status) {
 		case XMIT_FAIL_LINK_STATE:
 			dev_err(&adapter->netdev->dev,
@@ -2999,7 +2999,7 @@ static u32 slic_card_locate(struct adapter *adapter)
 	/* Initialize a new card structure if need be */
 	if (card_hostid == SLIC_HOSTID_DEFAULT) {
 		card = kzalloc(sizeof(struct sliccard), GFP_KERNEL);
-		if (card == NULL)
+		if (!card)
 			return -ENOMEM;
 
 		card->next = slic_global.slic_card;
Signature · 1 line
1.8.3.4
maintainer
#1 lore raw
Quoted 7 lines · Sandhya Bankar

Use !x instead of x == NULL.This patch is found by checkpatch.pl script.

---
Changes in v2:
* No change.
*Compile this patch to check nothing is broken.

Someone sent this patch before you did, sorry about that :(