From patchwork Sat Jan 14 18:42:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 43789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp405716wrn; Sat, 14 Jan 2023 10:50:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvv3KKseFQJ0UhZhxHD6VRrKKRnuaFZtSHQyHgS6vRopVhGdPRyG+8S80DAb9mEiu4ATklK X-Received: by 2002:a17:907:6d0c:b0:7c1:652:d109 with SMTP id sa12-20020a1709076d0c00b007c10652d109mr90760584ejc.35.1673722241039; Sat, 14 Jan 2023 10:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673722241; cv=none; d=google.com; s=arc-20160816; b=mzo0v0GcZlas7W0FWL+2seNSKFbUaeSJCoLtQMlY4ksWHlYjllQcYNxHqcB9IQmASJ 7GGyYR/dCOx1QZTVSCSVpNdCqP259mtljSei1dWDwG1Vns8zVg7n4gaS8YpZAGcmDlNX rugJYjWCn4xteG2Mm/9EWRMReOriV0dZ+v3/x9NZ/+V9kilTRX+pSkTgQHRK5Cl0raip X++OwldZNx9tayxnBRgIVwyiA4bKN1xQOmIPoocahMUYpXg2jJtpxpMY7MhXqKOgada3 GW1X/LzadTzKEVxZUJ2JbJwLF6uAuV4JRJNkMbXVg3yxLsw4gcQdQpYs/MSrrPhRmBEu XJRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=r2z4I/Nj+Ntpxa2lOB55jiImAMYuUh4qJEwkx6RSCvY=; b=Wp9yZa4jzNmsVH8k6SWTWa5ck3CW+bnik9Ksvd8Y3dzLT4/JckfZvmDdESin+e5JSb 669K72ad8Sk/wyaib/fl4HuG+cfbrHj1eg0jeTn0YCWvgtr0WddCAuvAGwajN7F4v5G+ FyVMNjCAwjcKf015ossEecLqNlbLhX8t+iSAzgNUl+wp8gFnWb2POKG8J1uFQ8TQeY2Y HfaU7G+nV4yoYE/4tnz7D7CEwKw4a5oSdcEOsul57AzKZGM519D7n4r6Q9/7LbYUWsWp GFEQOP75HjKyrrIFL5FtMjBNXlD3B1/aaWw8apiEclEYN5iuSQsz+mFn0bvVltf3M16a H3wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="adJU1Z/g"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm3-20020a170907948300b007c0edce0846si27005193ejc.670.2023.01.14.10.50.17; Sat, 14 Jan 2023 10:50:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="adJU1Z/g"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbjANSmV (ORCPT + 99 others); Sat, 14 Jan 2023 13:42:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbjANSmU (ORCPT ); Sat, 14 Jan 2023 13:42:20 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D136F900D; Sat, 14 Jan 2023 10:42:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=r2z4I/Nj+Ntpxa2lOB55jiImAMYuUh4qJEwkx6RSCvY=; b=adJU1Z/gJpKZL25AYl3h9bqtRh ZaBRjmyuwXxyT/BtJ98IWWHup0HYeEVWHxQwshdz0q6QJQB6dFf5Jlsq8/BEsQgtVNOonUFeQsHJ/ hm7wMZQY3KzuVoiMvs9zl+Ls+zlwqTldd1i3kX+WvR87QE6ZIGdL+gu0FHn78eOko2R0I/RRCXtWy NO+xQ7kQ69hwLnmSpgAlqvz5vQLwtwhYFOCoLqlqrWJNwXcVuy15P6DkRKxCF8/cXvYQpiGv1fGc6 1xzQXeYuD/SxsbSv8iprHyidZa0979x0NQVTtOomgI9nEkiymttjOfry8HBJ0+rFF0aEvVl0YDytb fev7/TEw==; Received: from [2601:1c2:d80:3110::9307] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGlTs-006Lab-7u; Sat, 14 Jan 2023 18:42:16 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Jerome Neanne , Tony Lindgren , linux-omap@vger.kernel.org, Liam Girdwood , Mark Brown Subject: [PATCH] regulator: tps65219: use IS_ERR() to detect an error pointer Date: Sat, 14 Jan 2023 10:42:15 -0800 Message-Id: <20230114184215.27806-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755024972522430439?= X-GMAIL-MSGID: =?utf-8?q?1755024972522430439?= Fix pointer comparison to integer warning from gcc & sparse: GCC: ../drivers/regulator/tps65219-regulator.c:370:26: warning: ordered comparison of pointer with integer zero [-Wextra] 370 | if (rdev < 0) { | ^ sparse warning: drivers/regulator/tps65219-regulator.c:370:26: sparse: error: incompatible types for operation (<): drivers/regulator/tps65219-regulator.c:370:26: sparse: struct regulator_dev *[assigned] rdev drivers/regulator/tps65219-regulator.c:370:26: sparse: int Signed-off-by: Randy Dunlap Cc: Jerome Neanne Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Cc: Liam Girdwood Cc: Mark Brown --- drivers/regulator/tps65219-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -- a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c --- a/drivers/regulator/tps65219-regulator.c +++ b/drivers/regulator/tps65219-regulator.c @@ -367,7 +367,7 @@ static int tps65219_regulator_probe(stru irq_data[i].type = irq_type; tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev); - if (rdev < 0) { + if (IS_ERR(rdev)) { dev_err(tps->dev, "Failed to get rdev for %s\n", irq_type->regulator_name); return -EINVAL;