From nobody Mon Feb 9 09:15:32 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C76AC83F14 for ; Wed, 30 Aug 2023 21:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241965AbjH3Vkm (ORCPT ); Wed, 30 Aug 2023 17:40:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242037AbjH3Vkk (ORCPT ); Wed, 30 Aug 2023 17:40:40 -0400 Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E54ECFC for ; Wed, 30 Aug 2023 14:40:10 -0700 (PDT) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4Rbd330fnTzTw; Wed, 30 Aug 2023 23:38:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1693431535; bh=myJ3VN4kme6b3IyeciKx5wc/7mhpCeWqhBkhEBhrxQA=; h=Date:In-Reply-To:References:Subject:From:To:Cc:From; b=V0Vzy/vb1FI56RGjX/1c+/higRB1MqWSNbbmkAPVn6oS2hiGumONNuy5eFHyBt7G0 2O7iqQAZuiUJlLT+SxIX5RBbJtg9AA+eoVpFn7QMIzC8TEBpuEYFrXtmEN2XV/2VOR yaRJWmHsLPqusX5noYPO0JiXbvOoVBlLuAql2VUGAkVzRmi+UW8fUdn4AyUrjofQey pDN1XSVIAPokAFoefVlyf6gSgbn9f3X/DHC9Zw3tJMVT79quyYsRgNR7e+dgmFdc3O mdANqOhrh7qOM4FjuBsY/pFDhX3ioB37SurwQZkrGYg+boH8jwgeDVZf0kXIcbMzD7 WpvHd3CcUcL3A== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at mail Date: Wed, 30 Aug 2023 23:38:54 +0200 Message-Id: <5fb938f4a07063fbca4893db2e6da1b63da87dc9.1693431144.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: Subject: [PATCH 2/9] regulator/core: set_consumer_device_supply: remove `has_dev` MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org `has_dev` is only ever used once to check if the name is non-NULL. Inline the check and make the intent obvious. Signed-off-by: Micha=C5=82 Miros=C5=82aw --- drivers/regulator/core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index d440cd137c38..a467be1f198b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1726,16 +1726,10 @@ static int set_consumer_device_supply(struct regula= tor_dev *rdev, const char *supply) { struct regulator_map *node, *new_node; - int has_dev; =20 if (supply =3D=3D NULL) return -EINVAL; =20 - if (consumer_dev_name !=3D NULL) - has_dev =3D 1; - else - has_dev =3D 0; - new_node =3D kzalloc(sizeof(struct regulator_map), GFP_KERNEL); if (new_node =3D=3D NULL) return -ENOMEM; @@ -1743,7 +1737,7 @@ static int set_consumer_device_supply(struct regulato= r_dev *rdev, new_node->regulator =3D rdev; new_node->supply =3D supply; =20 - if (has_dev) { + if (consumer_dev_name !=3D NULL) { new_node->dev_name =3D kstrdup(consumer_dev_name, GFP_KERNEL); if (new_node->dev_name =3D=3D NULL) { kfree(new_node); --=20 2.39.2