All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [RFC PATCH 3/7] regulator: IRQ based event/error notification helpers
Date: Mon, 15 Feb 2021 14:11:35 +0300	[thread overview]
Message-ID: <20210215111135.GC2087@kadam> (raw)
In-Reply-To: <3daf0531910c25d8b0da3964778ae2a6c9049d43.1613042245.git.matti.vaittinen@fi.rohmeurope.com>

[-- Attachment #1: Type: text/plain, Size: 4325 bytes --]

Hi Matti,

url:    https://github.com/0day-ci/linux/commits/Matti-Vaittinen/Extend-regulator-notification-support/20210211-204336
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: x86_64-randconfig-m001-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/regulator/irq_helpers.c:194 regulator_notifier_isr() error: uninitialized symbol 'ret'.

vim +/ret +194 drivers/regulator/irq_helpers.c

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  155  static irqreturn_t regulator_notifier_isr(int irq, void *data)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  156  {
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  157  	struct regulator_irq *h = data;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  158  	struct regulator_irq_desc *d;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  159  	struct regulator_irq_data *rid;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  160  	unsigned long rdev_map = 0;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  161  	int num_rdevs;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  162  	int ret, i, j;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  163  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  164  	d = &h->desc;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  165  	rid = &h->rdata;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  166  	num_rdevs = rid->num_states;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  167  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  168  	if (d->fatal_cnt)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  169  		h->retry_cnt++;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  170  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  171  	/*
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  172  	 * we spare few cycles by not clearing statuses prior this call.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  173  	 * The IC driver must initialize the status buffers for rdevs
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  174  	 * which it indicates having active events via rdev_map.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  175  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  176  	 * Maybe we should just to be on a safer side(?)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  177  	 */
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  178  	if (d->map_event)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  179  		ret = d->map_event(irq, rid, &rdev_map);

"ret" not initialized on else path.

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  180  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  181  	/*
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  182  	 * If status reading fails (which is unlikely) we don't ack/disable
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  183  	 * IRQ but just increase fail count and retry when IRQ fires again.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  184  	 * If retry_count exceeds given safety limit we call IC specific die
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  185  	 * handler which can try disabling regulator(s).
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  186  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  187  	 * If no die handler is given we will just bug() as a last resort.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  188  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  189  	 * We could try disabling all associated rdevs - but we might shoot
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  190  	 * ourself in the head and leave problematic regulator enabled. So
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  191  	 * if IC has no die-handler populated we just assume the regulator
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  192  	 * can't be disabled.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  193  	 */
1844ad67f3ebe1 Matti Vaittinen 2021-02-11 @194  	if (unlikely(ret == REGULATOR_FAILED_RETRY))
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  195  		goto fail_out;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  196  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  197  	h->retry_cnt = 0;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29633 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 3/7] regulator: IRQ based event/error notification helpers
Date: Mon, 15 Feb 2021 14:11:35 +0300	[thread overview]
Message-ID: <20210215111135.GC2087@kadam> (raw)
In-Reply-To: <3daf0531910c25d8b0da3964778ae2a6c9049d43.1613042245.git.matti.vaittinen@fi.rohmeurope.com>

[-- Attachment #1: Type: text/plain, Size: 4325 bytes --]

Hi Matti,

url:    https://github.com/0day-ci/linux/commits/Matti-Vaittinen/Extend-regulator-notification-support/20210211-204336
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: x86_64-randconfig-m001-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/regulator/irq_helpers.c:194 regulator_notifier_isr() error: uninitialized symbol 'ret'.

vim +/ret +194 drivers/regulator/irq_helpers.c

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  155  static irqreturn_t regulator_notifier_isr(int irq, void *data)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  156  {
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  157  	struct regulator_irq *h = data;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  158  	struct regulator_irq_desc *d;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  159  	struct regulator_irq_data *rid;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  160  	unsigned long rdev_map = 0;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  161  	int num_rdevs;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  162  	int ret, i, j;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  163  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  164  	d = &h->desc;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  165  	rid = &h->rdata;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  166  	num_rdevs = rid->num_states;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  167  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  168  	if (d->fatal_cnt)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  169  		h->retry_cnt++;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  170  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  171  	/*
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  172  	 * we spare few cycles by not clearing statuses prior this call.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  173  	 * The IC driver must initialize the status buffers for rdevs
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  174  	 * which it indicates having active events via rdev_map.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  175  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  176  	 * Maybe we should just to be on a safer side(?)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  177  	 */
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  178  	if (d->map_event)
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  179  		ret = d->map_event(irq, rid, &rdev_map);

"ret" not initialized on else path.

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  180  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  181  	/*
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  182  	 * If status reading fails (which is unlikely) we don't ack/disable
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  183  	 * IRQ but just increase fail count and retry when IRQ fires again.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  184  	 * If retry_count exceeds given safety limit we call IC specific die
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  185  	 * handler which can try disabling regulator(s).
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  186  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  187  	 * If no die handler is given we will just bug() as a last resort.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  188  	 *
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  189  	 * We could try disabling all associated rdevs - but we might shoot
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  190  	 * ourself in the head and leave problematic regulator enabled. So
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  191  	 * if IC has no die-handler populated we just assume the regulator
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  192  	 * can't be disabled.
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  193  	 */
1844ad67f3ebe1 Matti Vaittinen 2021-02-11 @194  	if (unlikely(ret == REGULATOR_FAILED_RETRY))
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1844ad67f3ebe1 Matti Vaittinen 2021-02-11  195  		goto fail_out;
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  196  
1844ad67f3ebe1 Matti Vaittinen 2021-02-11  197  	h->retry_cnt = 0;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29633 bytes --]

  parent reply	other threads:[~2021-02-15 11:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 12:33 [RFC PATCH 0/7] Extend regulator notification support Matti Vaittinen
2021-02-11 12:34 ` [RFC PATCH 1/7] dt_bindings: Add protection limit properties Matti Vaittinen
2021-03-05 19:30   ` Rob Herring
2021-03-08  5:34     ` Vaittinen, Matti
2021-02-11 12:34 ` [RFC PATCH 2/7] regulator: add warning flags Matti Vaittinen
2021-02-11 12:35 ` [RFC PATCH 3/7] regulator: IRQ based event/error notification helpers Matti Vaittinen
2021-02-11 14:40   ` kernel test robot
2021-02-11 14:40   ` [RFC PATCH] regulator: dev_delayed_work_autocancel() can be static kernel test robot
2021-02-12  9:33   ` [RFC PATCH 3/7] regulator: IRQ based event/error notification helpers Vaittinen, Matti
2021-02-12 13:56     ` Mark Brown
2021-02-15 10:25   ` Vaittinen, Matti
2021-02-15 11:11   ` Dan Carpenter [this message]
2021-02-15 11:11     ` Dan Carpenter
2021-02-11 12:35 ` [RFC PATCH 4/7] regulator: add property parsing and callbacks to set protection limits Matti Vaittinen
2021-02-11 14:11   ` kernel test robot
2021-02-12  7:29   ` Matti Vaittinen
2021-02-11 12:35 ` [RFC PATCH 5/7] dt-bindings: regulator: bd9576 add FET ON-resistance for OCW Matti Vaittinen
2021-02-11 14:56   ` Rob Herring
2021-02-17 21:34   ` Rob Herring
2021-02-18  6:15     ` Vaittinen, Matti
2021-02-11 12:36 ` [RFC PATCH 6/7] regulator: bd9576: Support error reporting Matti Vaittinen
2021-02-11 12:36 ` [RFC PATCH 7/7] regulator: bd9576: Fix the driver name in id table Matti Vaittinen
  -- strict thread matches above, loose matches on Subject: below --
2021-02-11 18:47 [RFC PATCH 3/7] regulator: IRQ based event/error notification helpers kernel test robot

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=20210215111135.GC2087@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.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 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.