From: Guenter Roeck <linux@roeck-us.net>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs()
Date: Wed, 7 Feb 2024 13:32:24 -0800 [thread overview]
Message-ID: <dcd18c2f-716b-4bc8-8ae9-9aa240a7e5d0@roeck-us.net> (raw)
In-Reply-To: <20240207-chipcap2_init_vars-v1-2-08cafe43e20e@gmail.com>
On Wed, Feb 07, 2024 at 10:17:09PM +0100, Javier Carrasco wrote:
> The return path can be improved by returning upon first failure. The
> current implementation would try to register the second interrupt even
> if the first one failed, which is unnecessary.
>
> Moreover, if no irqs are available, the return value should be zero
> (the driver supports the use case with no interrupts). Currently the
> initial value is unassigned and that may lead to returning an unknown
> value if stack variables are not automatically set to zero and no irqs
> were provided.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/linux-hwmon/294e4634-89d4-415e-a723-b208d8770d7c@gmail.com/T/#t
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied.
Thanks,
Guenter
prev parent reply other threads:[~2024-02-07 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 21:17 [PATCH 0/2] hwmon: chipcap2: fix uninitialized symbols Javier Carrasco
2024-02-07 21:17 ` [PATCH 1/2] hwmon: chipcap2: fix uninitialized variable in cc2_get_reg_val() Javier Carrasco
2024-02-07 21:31 ` Guenter Roeck
2024-02-07 21:17 ` [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs() Javier Carrasco
2024-02-07 21:32 ` Guenter Roeck [this message]
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=dcd18c2f-716b-4bc8-8ae9-9aa240a7e5d0@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dan.carpenter@linaro.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®