Skip to contentSkip to conversation

NFC: remove unneeded NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 13, 2012 – Apr 16, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFC: remove unneeded NULL check

container_of() works by subtracting the offset of the member. The math can't really return a zero here. Sometimes people check it when they actually meant to check something else but in this case we can just remove the check.

drivers/nfc/pn533.c +0 -3
index e6ec16d..2e11da0 100644
@@ -394,9 +394,6 @@ static void pn533_wq_cmd_complete(struct work_struct *work)
 	struct pn533_frame *in_frame;
 	int rc;
 
-	if (dev = NULL)
-		return;
-
 	in_frame = dev->wq_in_frame;
 
 	if (dev->wq_in_error)
Applied
#1 lore raw

Hi Dan,

Quoted 6 lines · Dan Carpenter

container_of() works by subtracting the offset of the member. The math can't really return a zero here. Sometimes people check it when they actually meant to check something else but in this case we can just remove the check.

Applied to my nfc-next queue, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/