Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1021480ybh; Mon, 13 Jul 2020 07:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfgAcXjPYUYJlG7w+pk+vhozixuvt6Nvop4A1aDjHcRijg6yL125BcDiEfyOKJhe+mddhI X-Received: by 2002:aa7:cd52:: with SMTP id v18mr87247668edw.196.1594650288549; Mon, 13 Jul 2020 07:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594650288; cv=none; d=google.com; s=arc-20160816; b=vfsJ64GHe8Ry1YsZ30E4/AQaSDMScWMhYRQnLhv4sruKLcv231PTOLqiS/ciMuBCER NIiwk2aY4jsqb9ymPKElG8eQXpNy6jTVKmYfPi/Pl3+P0DNLkk2xV5iojNFopo0MvSw8 lIyrMYedH+EPwBeSrIWbT4Jrm///o1DPRHiWDABVGE5DbYqs6tBvOMgHb5R06efyBvFS wGbEk6jguK8BtbmBFg4dFHc60nd0K49hIRZnt4htH6xja+YvK7ReSkGUTZNyYbBANIiw 0GzZqSMfUcBPR64I8J2/ElOJAAShr+YMNsOKfw9t4SpdfwSOL8y1IcbVkXnInVz8pfZ1 pSow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NK8eKgjxAM6PUEx4+p5T4c8uJDhqAJ+z/IfmJLblGjc=; b=QCEAaOj/GeIA7+c0tSJoS3Qbpi7zggBejZ9KmJqnyL/te0b13kjI4gVQnwMuNhlkhB x48ONqp8JXLnCbuGuQ9qIsLOzDXDt+2T7YZ5eBpHsv58/lK3wINvwgbG1FjvDMgof2Ap 4C8ihZ/qR5OfkHIE+mlUV2li2adwAGqMqiJtYpkYHYZTTwzU8DC/TlvX1we+UfBv0tnK uQ+Pb4U3qdgyADYQxp7gEwLQ0mU5zzZS27mgvGZjwANCsjNrdZQDNJ7IGvUAK4zMpUV0 +3+G+EwdobB3ncURazcsjP3BLuzcFNZFUj2K0dQv0XdcD7b3KXYq9+3MOjh27ZvglL9t gYlQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si9312440eds.173.2020.07.13.07.24.24; Mon, 13 Jul 2020 07:24:48 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729954AbgGMOVz (ORCPT + 99 others); Mon, 13 Jul 2020 10:21:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:3894 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbgGMOVz (ORCPT ); Mon, 13 Jul 2020 10:21:55 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06DE4MNw099007; Mon, 13 Jul 2020 10:21:44 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3276afrvpt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 10:21:44 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06DEFCSp003644; Mon, 13 Jul 2020 14:21:43 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01wdc.us.ibm.com with ESMTP id 3275288j40-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 14:21:43 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06DELgI443975114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Jul 2020 14:21:42 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7393F7805E; Mon, 13 Jul 2020 14:21:42 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B90A78063; Mon, 13 Jul 2020 14:21:42 +0000 (GMT) Received: from [9.163.41.130] (unknown [9.163.41.130]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 13 Jul 2020 14:21:41 +0000 (GMT) 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, linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org References: <20200713033313.21487-1-vulab@iscas.ac.cn> From: Eddie James Message-ID: Date: Mon, 13 Jul 2020 09:21:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200713033313.21487-1-vulab@iscas.ac.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_11:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1011 lowpriorityscore=0 suspectscore=21 spamscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130106 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/20 10: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(). Thanks, Reviewed-by: Eddie James > > Signed-off-by: Xu Wang > --- > 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;