From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbcBCBiS (ORCPT ); Tue, 2 Feb 2016 20:38:18 -0500 Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:58590 "HELO gproxy7-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754866AbcBCBiQ (ORCPT ); Tue, 2 Feb 2016 20:38:16 -0500 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Tue, 02 Feb 2016 20:38:16 EST X-Authority-Analysis: v=2.1 cv=dqRIVTQ4 c=1 sm=1 tr=0 a=6lV6tj8ir7tGSl/9xQZNPA==:117 a=6lV6tj8ir7tGSl/9xQZNPA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=N659UExz7-8A:10 a=05RPwmwRPNYA:10 a=I4ko-sDDNxYA:10 a=jFJIQSaiL_oA:10 a=VwQbUJbxAAAA:8 a=gIUBli0hutz2-EWihksA:9 a=pILNOxqGKmIA:10 a=Y0aGYQcFUxYA:10 a=aLKfsH_uT_gA:10 a=pRQRx_yQ9a0A:10 Subject: Re: [PATCH] aoe: remove unnecessary check for failing kthread creation To: Insu Yun , linux-kernel@vger.kernel.org References: <1454342039-14068-1-git-send-email-wuninsu@gmail.com> Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu, changwoo@gatech.edu From: Ed Cashin Message-ID: <56B15871.8020206@acm.org> Date: Tue, 2 Feb 2016 20:31:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454342039-14068-1-git-send-email-wuninsu@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {2969:box320.bluehost.com:cashinwo:cashinworks.com} {sentby:smtp auth 98.192.52.118 authed with ed@cashinworks.com} Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/2016 10:53 AM, Insu Yun wrote: > When kthread_run fails, it returns ERR, not NULL. > Therefore, NULL checking is redundant. > (https://www.kernel.org/doc/htmldocs/device-drivers/API-kthread-run.html) Thanks, the change looks reasonable. ... > task = kthread_run(kthread, k, "%s", k->name); > - if (task == NULL || IS_ERR(task)) > + if (IS_ERR(task)) > return -ENOMEM; Interestingly, after this change, it's more clear that returning -ENOMEM is a bit misleading when the underlying kernel/kthread.c function, kthread_create_on_node returns ERR_PTR(-EINTR). But because that would happen when the process we need to have the driver working gets killed, I'm not sure it matters. -- Ed