All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
To: <u-boot@lists.denx.de>
Cc: <michal.simek@amd.com>, <peng.fan@nxp.com>,
	<jh80.chung@samsung.com>, <git@amd.com>,
	Algapally Santosh Sagar <santoshsagar.algapally@amd.com>,
	Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Subject: [PATCH v2 2/4] gpio: zynqmp: Handle error from get_gpio_modepin
Date: Thu, 19 Jan 2023 22:36:15 -0700	[thread overview]
Message-ID: <20230120053617.32463-3-ashok.reddy.soma@amd.com> (raw)
In-Reply-To: <20230120053617.32463-1-ashok.reddy.soma@amd.com>

From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>

There is a unused variable ret, due to which we are getting sparse warning
as below.
warning: variable 'ret' set but not used [-Wunused-but-set-variable].

Return ret incase of error.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
---

Changes in v2:
 - Instead of removing ret variable, take it and return incase of error.
 - Updated description as per this.

 drivers/gpio/zynqmp_gpio_modepin.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/zynqmp_gpio_modepin.c b/drivers/gpio/zynqmp_gpio_modepin.c
index 078fd83395..e9565ff543 100644
--- a/drivers/gpio/zynqmp_gpio_modepin.c
+++ b/drivers/gpio/zynqmp_gpio_modepin.c
@@ -48,6 +48,9 @@ static int modepin_gpio_set_value(struct udevice *dev, unsigned int offset,
 	int ret;
 
 	ret = get_gpio_modepin(ret_payload);
+	if (ret)
+		return ret;
+
 	if (value)
 		out_val = OUTVAL(offset) | ret_payload[1];
 	else
-- 
2.17.1


  parent reply	other threads:[~2023-01-20  5:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  5:36 [PATCH v2 0/4] Fix sparse warnings Ashok Reddy Soma
2023-01-20  5:36 ` [PATCH v2 1/4] xilinx: common: Include header file to fix warning Ashok Reddy Soma
2023-01-20  5:36 ` Ashok Reddy Soma [this message]
2023-01-20  5:36 ` [PATCH v2 3/4] xilinx: versal: Add missing header Ashok Reddy Soma
2023-01-20  5:36 ` [PATCH v2 4/4] drivers: mmc: Change datatype of tuning_loop_counter to int Ashok Reddy Soma
2023-01-27  8:48 ` [PATCH v2 0/4] Fix sparse warnings Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230120053617.32463-3-ashok.reddy.soma@amd.com \
    --to=ashok.reddy.soma@amd.com \
    --cc=git@amd.com \
    --cc=jh80.chung@samsung.com \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@nxp.com \
    --cc=santoshsagar.algapally@amd.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.