Skip to contentSkip to conversation

staging: pi433: use IS_ERR to check kthread_run return value

PATCH In review Paolo Cretaro 1 participant 2 messages Jul 22, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: pi433: use IS_ERR to check kthread_run return value

Fix compiler warning: ordered comparison of pointer with integer zero

---
 drivers/staging/pi433/pi433_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/pi433_if.c +1 -1
index 1bc478a7f49e..79bd19123239 100644
@@ -1152,7 +1152,7 @@ static int pi433_probe(struct spi_device *spi)
 	device->tx_task_struct = kthread_run(pi433_tx_thread,
 					     device,
 					     "pi433_tx_task");
-	if (device->tx_task_struct < 0)
+	if (IS_ERR(device->tx_task_struct))
 	{
 		dev_dbg(device->dev, "start of send thread failed");
 		goto send_thread_failed;
Signature · 1 line
2.13.3
#1 lore raw
Quoted 1 line · Paolo Cretaro

Fix compiler warning: ordered comparison of pointer with integer zero

Sorry, just noticed a similar patch has been submitted a few days ago, please ignore this patch.

Paolo

Quoted 20 lines
---
 drivers/staging/pi433/pi433_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/pi433_if.c +1 -1
index 1bc478a7f49e..79bd19123239 100644
@@ -1152,7 +1152,7 @@ static int pi433_probe(struct spi_device *spi)
 	device->tx_task_struct = kthread_run(pi433_tx_thread,
 					     device,
 					     "pi433_tx_task");
-	if (device->tx_task_struct < 0)
+	if (IS_ERR(device->tx_task_struct))
 	{
 		dev_dbg(device->dev, "start of send thread failed");
 		goto send_thread_failed;