Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1809754ybh; Mon, 20 Jul 2020 07:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwph+O2pXCAKxFB2AMZkCggomPDbYxrS4e96cu1zGD2sRsIIUGIJK7tkr7fC5vCX91TR44P X-Received: by 2002:a17:906:547:: with SMTP id k7mr20452311eja.287.1595256471025; Mon, 20 Jul 2020 07:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595256471; cv=none; d=google.com; s=arc-20160816; b=o5EHNrpYClAeIWuj6trAyHPfH970C2BYjnqXB+c6RerMqReNLJIYJm57izDmHxd1a6 ngz78j3ZJaxKH+rd2cjlAhrVy52uLph2kQKRKOSKaDoKgjGr379VVc3hVFpv7DS7GOmv /T4zf0O1YlQj4OposdDPMFitzMAgNttMI/ywW7sZA/+eneUb532QaHFGiJBhWSrUMb4t A2mIjEVLlaLDNbIGZJSd1id5jlFIgb/qsD9aCDHhxBqGkcoqKQKVj+Ou4zHGmPNU59Em tV6L5Ep7TNHbL75CJiRGeLdX1RtTO4XkfVVRX9bYyjyiDAJwOr7anMl73Ft/SCpAudg7 ik+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=/s6O9Xlc81b4Ebzh7HW1+cSwOqV/UbLjdPjqZ2MEo1E=; b=tqop5PKZZ8OnFRlL0WpK7ozVYLBOMLJilqECRAFFEfGyoq546BmYmS77PHZF2Icg85 tOkYfHRIrgnE5O0Xyscy7II+qje2mJLQj7+05QfMm6ZndN1vYVJj4M50yLqS09LflqE4 SyYmQbTiZRdxP00783ARCfEm0UxV0pO216e7IIDbdXnZS7SLdAACQbbvvigLdWSlsESj /VCtwiuHeQxqJ2zxpUf3Jy6vV1XfiWDmmsFLnAm0rlo4IDTPlYhTsBnkTfUejBZzNwWK TKAipltngVpbTeGj2JrEfNMcaVY4JA4UGWltMkBXhggQ4fiQRLd+C32L6PC67ZLwoxwe V1mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sNDpARFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si10452883ejc.337.2020.07.20.07.47.21; Mon, 20 Jul 2020 07:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sNDpARFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbgGTOoy (ORCPT + 99 others); Mon, 20 Jul 2020 10:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgGTOoy (ORCPT ); Mon, 20 Jul 2020 10:44:54 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BEDAC061794 for ; Mon, 20 Jul 2020 07:44:54 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d4so10383331pgk.4 for ; Mon, 20 Jul 2020 07:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/s6O9Xlc81b4Ebzh7HW1+cSwOqV/UbLjdPjqZ2MEo1E=; b=sNDpARFxlCIksZScD51+lrLXyPFrLq5HRJgVgRyU/gmeWoaPH+7onPX/KxWpG9droA wSJNmLq9StaFK3XPFP/RmX3qC7SCTPHss+KCDgx71hyfvMapCMeHf5tPyJ8Y9mf2UFww 2Qnnb//JfM0xr9sIlSKgKir5mln1ELlA3W01R1UU+BtqjlpxerVEJd35zaVlxNGdenAS BvmSXgP7l1zEpiG5mnNqSIIiA4Mucr53RoVWzFJb5Sy0IksXpGzxGGR8UYKvJxdgs+LO JLBhvHavyokhaClvfbKRAwIbgeE4QX6mQfM3s45o+7Jc8/ad9CKRHl6s3+tTaMQqQ+DO X0LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/s6O9Xlc81b4Ebzh7HW1+cSwOqV/UbLjdPjqZ2MEo1E=; b=qR+ldeDEIn3q/apdWZJ5MNIBvM1oeSv0Tq2pOSDX+sT3tF5S8G8UnKt9u/jVSxp1It LRFDZvFAE/8eU5kdw1AhhtU18h7UJN+IUd352bovpA9Cp5BG6hHc2fX89E2C+py2jIrj bFpntV4XXfc2v8lZh64SI9I2B6uBFa5jKRNJIqQR8AmBRs2kEY22rmcKbbG/e6dALme1 hYZ2KMge0ccTCaBywd6ksEJWgESIfA41rc3Pqi8bhjiEHNw1EBusC2niGStq0IsN6vk5 GrF/cPkKJih2hGHZkCe9SPKjIWMa5KxZYOIph/+wtK+Pz/XaCKOvpBqyNzplOpO/cNGG KDnA== X-Gm-Message-State: AOAM5322h9eEhrTOifyXWs8IUH18K5SzubcIYTOZy1+A1+yo3SCO5x3z 9aeYgy6jR+4t891a35gF9M/Jv2+O X-Received: by 2002:a63:1a16:: with SMTP id a22mr19147946pga.142.1595256293248; Mon, 20 Jul 2020 07:44:53 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id o136sm9062195pfg.24.2020.07.20.07.44.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2020 07:44:52 -0700 (PDT) Subject: Re: [PATCH] fsi: fsi-occ: fix return value check in occ_probe() To: Xu Wang , jk@ozlabs.org, joel@jms.id.au, alistair@popple.id.au, eajames@linux.ibm.com, linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org References: <20200713033313.21487-1-vulab@iscas.ac.cn> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+A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UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <7b62ee5d-a96e-bcf4-e62c-c5575f137eb3@roeck-us.net> Date: Mon, 20 Jul 2020 07:44:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200713033313.21487-1-vulab@iscas.ac.cn> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/20 8:33 PM, Xu Wang wrote: > In case of error, the function platform_device_register_full() > returns ERR_PTR() and never returns NULL. The NULL test in the > return value check should be replaced with IS_ERR(). > > Signed-off-by: Xu Wang Reviewed-by: Guenter Roeck > --- > drivers/fsi/fsi-occ.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c > index 7da9c81759ac..9eeb856c8905 100644 > --- a/drivers/fsi/fsi-occ.c > +++ b/drivers/fsi/fsi-occ.c > @@ -555,7 +555,7 @@ static int occ_probe(struct platform_device *pdev) > > hwmon_dev_info.id = occ->idx; > hwmon_dev = platform_device_register_full(&hwmon_dev_info); > - if (!hwmon_dev) > + if (IS_ERR(hwmon_dev)) > dev_warn(dev, "failed to create hwmon device\n"); > > return 0; >