Content-Type: multipart/mixed; boundary="===============6024977912575699892==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [PATCH] power: supply_core: fix noderef.cocci warnings Date: Mon, 17 Jan 2022 09:41:58 +0800 Message-ID: <20220117014158.GA3685@07889aeafbfc> In-Reply-To: <202201170953.yxBdZqTf-lkp@intel.com> List-Id: --===============6024977912575699892== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of size= of 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 Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadi= k.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 =3D devm_kzalloc(&client->dev, - sizeof(cw_bat->battery), + sizeof(*cw_bat->battery), GFP_KERNEL); if (!cw_bat->battery) return -ENOMEM; --===============6024977912575699892==--