From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 119B5C433F5 for ; Wed, 27 Apr 2022 10:44:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 541D683EAD; Wed, 27 Apr 2022 12:43:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="aC3DUgL/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B99B083E9B; Wed, 27 Apr 2022 12:42:47 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3A57583E4F for ; Wed, 27 Apr 2022 12:42:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A0FB61D41; Wed, 27 Apr 2022 10:42:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD27C385A9; Wed, 27 Apr 2022 10:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056149; bh=QZf6lN6o+2WF+RT5f6SiWB8aYggj3yl9hQbRdo1tDWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aC3DUgL/uy6tnc2tO74fZFfba4eUH1H0Cf3ah9EaukwJMP10IWX4uum7AdHiNehd3 fD64v7i2XedjeWzQuZ0l2ttOaRin+rSme3O+UBERtGkHXPUksTp6HSTrn4hFUXkI5V /Hy7m9Ja+CYq0jb7qyQARv7JDmyO3GT2W3ngjsockNF+mp2PDvit9iU4o8lotAVBqx p/L2rSFZ+qTuXPPNhwY79BodbiJhFJy3tQiCYFjolqjmRwPQDbRh98ljzq26jB7GOL kCMiYRC0OvLYPd8LqwTl/g3UooivlFzD5g8iqfDCmXI5S5Y0X9DWY2wO3/q4LZTJE3 WHFTgyh5dI4rQ== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?UTF-8?q?Pali=20Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 09/19] net: mvneta: Fix unused variable warning if DM_GPIO is disabled Date: Wed, 27 Apr 2022 12:41:52 +0200 Message-Id: <20220427104202.1205-10-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn The `ret` variable in mvneta_probe() is unused if DM_GPIO is disabled. Since the variable is used only once after assigning value, we can inline the usage and drop the variable. Signed-off-by: Marek BehĂșn --- drivers/net/mvneta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 19f8145fc0..72789fc5c6 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1570,7 +1570,6 @@ static int mvneta_probe(struct udevice *dev) int node = dev_of_offset(dev); void *bd_space; int fl_node; - int ret; /* * Allocate buffer area for descs and rx_buffers. This is only @@ -1617,8 +1616,8 @@ static int mvneta_probe(struct udevice *dev) } #if CONFIG_IS_ENABLED(DM_GPIO) - ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args); - if (!ret && ofnode_is_enabled(sfp_args.node)) + if (!dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) && + ofnode_is_enabled(sfp_args.node)) gpio_request_by_name_nodev(sfp_args.node, "tx-disable-gpio", 0, &pp->sfp_tx_disable_gpio, GPIOD_IS_OUT); -- 2.35.1