From patchwork Sat Jan 14 18:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 43790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp408700wrn; Sat, 14 Jan 2023 11:00:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvI3ohwLuAcNgvgiZBZoddHiHDiFGArhOPPqXsHQYm4WjoXsr62S0DxqJ7MQZYa9d+pa91t X-Received: by 2002:a05:6a20:1384:b0:af:864d:e7bc with SMTP id w4-20020a056a20138400b000af864de7bcmr120937063pzh.25.1673722848459; Sat, 14 Jan 2023 11:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673722848; cv=none; d=google.com; s=arc-20160816; b=aq77oKR29BXDevYdf55VGN0g6pcXWMGWsp1E+eryDc0Rj7r83tZAmpBAMk8QyznOFj Tx9haxIIvqwqwKDNDVq1EVYst+vchJEAY3BjP9oxW0dE14aghyGJOnqRJBBDNPSLSloe pPEKDbcfrawlqq8z/0JuIxBdVucM/TJuaJ2e1QerxaY7v9H1o6uE3r4l2pODgJfJQSOC ozXsAgdcOTidN8WiAEiaXDdzd64FQBVP9jmFZ14bWiS6KX3NcoU9s3SXG4iSYU3/+0Dh QtNNfeX/+h/eNWazdLa/pZqU8wQbbNKUqOMDYNfxEoZlviEkl/bLhhmVzXI9CRU6IKwA jWOg== 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=COfo/oBaSIMqiEbzejZ+tc/RTs2C5/+Q+HgjZl4m/5Q=; b=kUHXq2ETrX3+BZStbaE6eqcT82wmAL7Te9Hunr7VtdXIb2/E4TGLvBL1HY4VIPA6Wa axIG74NuMArGA5JahP7SqKH70H8YfzFwry33435ZBASPEn7m4iehDXSzjdKmFprssK65 TL6V9VX6xhNSKBdLEBjKSU2noaQhvrki3xAthJkioYSRVENTPlQ9XphfBjjmuRLxKXiO 9Rj0N8tR/UKAuYHDhEk5Nh294tK+bztUtgd47PL+Zo6WpfB68hqqXjI36YF1HK4QPL/1 CYJb9+mb+N79a96025y1fjwghbnRdDlJdtIBwNYVE4q/TuYB6n+VwdNTnjHOZrp5Hrku Ugqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=nN5H6ijp; 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 79-20020a630252000000b004792f347556si26316118pgc.623.2023.01.14.11.00.32; Sat, 14 Jan 2023 11:00:48 -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=nN5H6ijp; 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 S230235AbjANS5k (ORCPT + 99 others); Sat, 14 Jan 2023 13:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjANS5j (ORCPT ); Sat, 14 Jan 2023 13:57:39 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9D3B76D; Sat, 14 Jan 2023 10:57:38 -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=COfo/oBaSIMqiEbzejZ+tc/RTs2C5/+Q+HgjZl4m/5Q=; b=nN5H6ijpvyI0WhD3m22iQZr6W7 +5YKA0DdaE6ip5ViwvmqcWedP7YM+ybK/WyHv0nQK6ZjUCkYboQvvOns5QaYWGUd1OHBU/WiPyfye aTc/WgGTLyhK+k4aaQuHgpCR6M6tx4IloALsQD1OCAIZNq9Wf7+N0ZilJ9XXqF0tXzQtR3Jo4qNM+ h2dOZfRUWC4z3CD/qsVD2sS51uk2tISK0FIrQKfBACQvYLNAqqs/IWsKifhcOevg0nMFCxI/JEhwL dYaC8nmS4z6fVoFVa11/zXhghpQdUIVsT/x1HcKdv9dCeAcP3spn8N5qW/5Pi+vSMTWijnYLZZgKv PmIT69BA==; 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 1pGlij-006MF8-7c; Sat, 14 Jan 2023 18:57:37 +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 v2] regulator: tps65219: use IS_ERR() to detect an error pointer Date: Sat, 14 Jan 2023 10:57:36 -0800 Message-Id: <20230114185736.2076-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?1755025609555729736?= 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 Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators support") Signed-off-by: Randy Dunlap Cc: Jerome Neanne Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Cc: Liam Girdwood Cc: Mark Brown --- v2: correct Jerome's email address; add Fixes: tag. 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;