public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] power: supply_core: fix noderef.cocci warnings
Date: Mon, 17 Jan 2022 09:41:58 +0800	[thread overview]
Message-ID: <20220117014158.GA3685@07889aeafbfc> (raw)
In-Reply-To: <202201170953.yxBdZqTf-lkp@intel.com>

From: kernel test robot <lkp@intel.com>

drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Fixes: 0839e7a54fc2 ("power: supply_core: Pass pointer to battery info")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ux500-href-charging-v5.16-rc1
head:   1e846b0b60ac01cac4f283975a1bc395ff73d995
commit: 0839e7a54fc2233ea74b21651d022b981c124f78 [32/58] power: supply_core: Pass pointer to battery info
:::::: branch date: 2 days ago
:::::: commit date: 4 weeks ago

 cw2015_battery.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -689,7 +689,7 @@ static int cw_bat_probe(struct i2c_clien
 	if (ret) {
 		/* Allocate an empty battery */
 		cw_bat->battery = devm_kzalloc(&client->dev,
-					       sizeof(cw_bat->battery),
+					       sizeof(*cw_bat->battery),
 					       GFP_KERNEL);
 		if (!cw_bat->battery)
 			return -ENOMEM;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-01-17  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17  1:48 [linusw-nomadik:ux500-href-charging-v5.16-rc1 32/58] drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of sizeof to pointer kernel test robot
2022-01-17  1:41 ` kernel test robot [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=20220117014158.GA3685@07889aeafbfc \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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