Skip to contentSkip to conversation

NFC: trf7970a: Handle timeout values of zero

DISCUSSION Dan Carpenter 2 participants 2 messages Oct 1, 2014

lore
Share & tools
lore
#0 lore raw

Hello Mark A. Greer,

The patch 1961843ceeca: "NFC: trf7970a: Handle timeout values of zero" from Sep 2, 2014, leads to the following static checker warning:

	drivers/nfc/trf7970a.c:897 trf7970a_irq()
	warn: passing zero to 'ERR_PTR'

drivers/nfc/trf7970a.c
892 trf7970a_cmd(trf, TRF7970A_CMD_FIFO_RESET);
893
894 if (!trf->timeout) {
895 trf->ignore_timeout = !cancel_delayed_work(
896 &trf->timeout_work);

   897                                  trf->rx_skb = ERR_PTR(0);
                                                      ^^^^^^^^^^

Why not just say "NULL"?

   898                                  trf7970a_send_upstream(trf);
   899                                  break;
   900                          }

regards,
dan carpenter

#1 lore raw
Quoted 9 lines · Dan Carpenter

Hello Mark A. Greer,

The patch 1961843ceeca: "NFC: trf7970a: Handle timeout values of zero" from Sep 2, 2014, leads to the following static checker warning:

	drivers/nfc/trf7970a.c:897 trf7970a_irq()
	warn: passing zero to 'ERR_PTR'

drivers/nfc/trf7970a.c

Quoted 8 lines
   892                          trf7970a_cmd(trf, TRF7970A_CMD_FIFO_RESET);
   893  
   894                          if (!trf->timeout) {
   895                                  trf->ignore_timeout = !cancel_delayed_work(
   896                                                  &trf->timeout_work);
   897                                  trf->rx_skb = ERR_PTR(0);
                                                      ^^^^^^^^^^

Why not just say "NULL"?

No reason. I thought I'd fixed them all.

Mark
--