public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] NFC: st-nci: remove a redundant null pointer check
@ 2018-09-26 12:30 zhong jiang
       [not found] ` <20180926140311.GU15943@smile.fi.intel.com>
  0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-09-26 12:30 UTC (permalink / raw)
  To: gregkh, sameo; +Cc: andriy.shevchenko, linux-wireless, linux-kernel

The dev is impossible is NULL. hence the check is redundant. We
never will hit it.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
v1->v2:
 -  According to Greg's suggestion. just remove the null pointer will be better.

 drivers/nfc/st-nci/spi.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 1470559..864fd90 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -233,13 +233,6 @@ static int st_nci_spi_probe(struct spi_device *dev)
 	dev_dbg(&dev->dev, "%s\n", __func__);
 	dev_dbg(&dev->dev, "IRQ: %d\n", dev->irq);
 
-	/* Check SPI platform functionnalities */
-	if (!dev) {
-		pr_debug("%s: dev is NULL. Device is not accessible.\n",
-			__func__);
-		return -ENODEV;
-	}
-
 	phy = devm_kzalloc(&dev->dev, sizeof(struct st_nci_spi_phy),
 			   GFP_KERNEL);
 	if (!phy)
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-26 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 12:30 [PATCH v2] NFC: st-nci: remove a redundant null pointer check zhong jiang
     [not found] ` <20180926140311.GU15943@smile.fi.intel.com>
2018-09-26 14:23   ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox