mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Rivera-Matos <r-rivera-matos@ti.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<kbuild-all@lists.01.org>, <dmurphy@ti.com>
Subject: Re: [EXTERNAL] Re: [PATCH v8 2/2] power: supply: bq256xx: Introduce the BQ256XX charger driver
Date: Tue, 5 Jan 2021 14:13:55 -0600	[thread overview]
Message-ID: <26235205-f28a-e836-7863-bed2e9cb6f25@ti.com> (raw)
In-Reply-To: <20210105141805.vhf7wrgcwujr7uwn@earth.universe>

Sebastian,

On 1/5/21 8:18 AM, Sebastian Reichel wrote:
> Hi Ricardo,
>
> On Tue, Jan 05, 2021 at 11:24:18AM +0800, kernel test robot wrote:
>> Hi Ricardo,
>>
>> Thank you for the patch! Perhaps something to improve:
>>
>> [auto build test WARNING on power-supply/for-next]
>> [also build test WARNING on robh/for-next v5.11-rc2 next-20210104]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>> And when submitting patch, we suggest to use '--base' as documented in
>> https://git-scm.com/docs/git-format-patch]
>>
>> url:    https://github.com/0day-ci/linux/commits/Ricardo-Rivera-Matos/Introduce-the-BQ256XX-family-of-chargers/20210105-043028
>> base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
>> config: powerpc64-randconfig-r034-20210105 (attached as .config)
>> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5c951623bc8965fa1e89660f2f5f4a2944e4981a)
>> reproduce (this is a W=1 build):
>>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>          chmod +x ~/bin/make.cross
>>          # install powerpc64 cross compiling tool for clang build
>>          # apt-get install binutils-powerpc64-linux-gnu
>>          # https://github.com/0day-ci/linux/commit/82436c2c6d99c4effb187bbd09b47c4dc59a1f3d
>>          git remote add linux-review https://github.com/0day-ci/linux
>>          git fetch --no-tags linux-review Ricardo-Rivera-Matos/Introduce-the-BQ256XX-family-of-chargers/20210105-043028
>>          git checkout 82436c2c6d99c4effb187bbd09b47c4dc59a1f3d
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>     drivers/power/supply/bq256xx_charger.c:1644:29: warning: variable 'psy_cfg' is uninitialized when used here [-Wuninitialized]
>>             ret = bq256xx_parse_dt(bq, psy_cfg, dev);
>>                                        ^~~~~~~
>>     drivers/power/supply/bq256xx_charger.c:1618:37: note: initialize the variable 'psy_cfg' to silence this warning
>>             struct power_supply_config *psy_cfg;
>>                                                ^
>>                                                 = NULL
> bah, I missed this serious issue during review :(
>
> FWIW the compiler provided wrong solution. It would result in
> dereferencing a NULL pointer afterwards since you never allocate
> any memory for psy_cfg. You could of course allocate memory for
> it, but power_supply_config is only needed during device
> registration.
>
> Proper solution is to initialize it as variable instead of pointer,
> so that it ends up on the stack. Also you should initialize it with
> {} to make sure any fields not explicitly configured are 0.
ACK
>
>>>> drivers/power/supply/bq256xx_charger.c:1720:36: warning: unused variable 'bq256xx_acpi_match' [-Wunused-const-variable]
>>     static const struct acpi_device_id bq256xx_acpi_match[] = {
> For this one just change
>
> .acpi_match_table = ACPI_PTR(bq256xx_acpi_match),
>
> into
>
> .acpi_match_table = bq256xx_acpi_match,
ACK
>
>>     2 warnings generated.
>>
>>
>> vim +/bq256xx_acpi_match +1720 drivers/power/supply/bq256xx_charger.c
>>
>>    1719	
>>> 1720	static const struct acpi_device_id bq256xx_acpi_match[] = {
>>    1721		{ "bq25600", BQ25600 },
>>    1722		{ "bq25600d", BQ25600D },
>>    1723		{ "bq25601", BQ25601 },
>>    1724		{ "bq25601d", BQ25601D },
>>    1725		{ "bq25611d", BQ25611D },
>>    1726		{ "bq25618", BQ25618 },
>>    1727		{ "bq25619", BQ25619 },
>>    1728		{},
>>    1729	};
>>    1730	MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match);
>>    1731	
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> Thanks,
>
> -- Sebastian
Thanks for the feedback on this!

Ricardo

  reply	other threads:[~2021-01-05 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 20:24 [PATCH v8 0/2] Introduce the BQ256XX family of chargers Ricardo Rivera-Matos
2021-01-04 20:24 ` [PATCH v8 1/2] dt-bindings: power: Add the bq256xx dt bindings Ricardo Rivera-Matos
2021-01-04 20:24 ` [PATCH v8 2/2] power: supply: bq256xx: Introduce the BQ256XX charger driver Ricardo Rivera-Matos
2021-01-05  3:24   ` kernel test robot
2021-01-05 14:18     ` Sebastian Reichel
2021-01-05 20:13       ` Ricardo Rivera-Matos [this message]
2021-01-05  3:50   ` 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=26235205-f28a-e836-7863-bed2e9cb6f25@ti.com \
    --to=r-rivera-matos@ti.com \
    --cc=dmurphy@ti.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@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®