Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965167AbdGTLFY (ORCPT ); Thu, 20 Jul 2017 07:05:24 -0400 Received: from mailout02.webmailer.hosteurope.de ([80.237.138.58]:36113 "EHLO mailout02.webmailer.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965112AbdGTLFV (ORCPT ); Thu, 20 Jul 2017 07:05:21 -0400 X-Squirrel-UserHash: EhVcX1pHQwdXWkQFBhENSgEKLlwACw== X-Squirrel-FromHash: UwFaC1lCF1E= Message-ID: In-Reply-To: <20170716144858.643-3-rjosephwright@gmail.com> References: <20170716144858.643-1-rjosephwright@gmail.com> <20170716144858.643-3-rjosephwright@gmail.com> Date: Thu, 20 Jul 2017 13:05:19 +0200 Subject: Re: [PATCH 2/2] Staging: pi433: check error after kthread_run() From: "Wolf Entwicklungen" To: "Joseph Wright" Cc: gregkh@linuxfoundation.org, linux@Wolf-Entwicklungen.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, "Joseph Wright" Reply-To: Marcus.Wolf@Wolf-Entwicklungen.de User-Agent: Host Europe Webmailer/1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Priority: 3 (Normal) Importance: Normal X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, license restriction X-KLMS-AntiPhishing: not scanned, license restriction X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2017/07/20 02:14:00 #10132889; khse: 2015-01-01 01:01:01 X-KLMS-AntiVirus-Status: Clean, skipped X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de;marcus.wolf@wolf-entwicklungen.de;1500548719;9cfb48e7; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1164 Lines: 36 Reviewed-by: Marcus Wolf Tested-by: Marcus Wolf Am So, 16.07.2017, 16:48 schrieb Joseph Wright: > Error should be checked with IS_ERR after calling kthread_run() > instead of comparing the returned pointer to an int. > > Found by sparse warning: > > incompatible types for operation (<) > left side has type struct task_struct *tx_task_struct > right side has type int > > Signed-off-by: Joseph Wright > --- > drivers/staging/pi433/pi433_if.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c > index 46461b4..4f724a5 100644 > --- a/drivers/staging/pi433/pi433_if.c > +++ b/drivers/staging/pi433/pi433_if.c > @@ -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; > -- > 2.9.3 > > >