* [patch] NFC: remove unneeded NULL check
@ 2012-04-13 19:28 Dan Carpenter
2012-04-16 18:22 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-04-13 19:28 UTC (permalink / raw)
To: Lauro Ramos Venancio
Cc: Aloisio Almeida Jr, Samuel Ortiz, linux-wireless, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index e6ec16d..2e11da0 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] NFC: remove unneeded NULL check
2012-04-13 19:28 [patch] NFC: remove unneeded NULL check Dan Carpenter
@ 2012-04-16 18:22 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-04-16 18:22 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lauro Ramos Venancio, Aloisio Almeida Jr, linux-wireless,
kernel-janitors
Hi Dan,
On Fri, Apr 13, 2012 at 10:28:12PM +0300, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to my nfc-next queue, thanks.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-16 18:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-13 19:28 [patch] NFC: remove unneeded NULL check Dan Carpenter
2012-04-16 18:22 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).