mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Gautam <vivek.gautam@codeaurora.org>
To: Wei Yongjun <weiyj.lk@gmail.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] phy: qcom-qmp: fix invalid use of sizeof in qcom_qmp_phy_vreg_init()
Date: Tue, 25 Apr 2017 13:43:50 +0530	[thread overview]
Message-ID: <02f41a36-d12c-d61a-ff51-f89e609704b5@codeaurora.org> (raw)
In-Reply-To: <20170425065703.11211-1-weiyj.lk@gmail.com>

Hi,


On 04/25/2017 12:27 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Apparently Kbuild had caught this and sent a similar patch. But I missed
that.

Thank you for the patch. I have requested Kishon to pull in the patch
from Kbuild along with your patch [1] fixing the return value for of_iomap.

[1] https://lkml.org/lkml/2017/4/24/1080

Best Regards
Vivek

>   drivers/phy/phy-qcom-qmp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/phy-qcom-qmp.c b/drivers/phy/phy-qcom-qmp.c
> index 727e23b..7d6085f 100644
> --- a/drivers/phy/phy-qcom-qmp.c
> +++ b/drivers/phy/phy-qcom-qmp.c
> @@ -844,7 +844,7 @@ static int qcom_qmp_phy_vreg_init(struct device *dev)
>   	int num = qmp->cfg->num_vregs;
>   	int i;
>   
> -	qmp->vregs = devm_kcalloc(dev, num, sizeof(qmp->vregs), GFP_KERNEL);
> +	qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL);
>   	if (!qmp->vregs)
>   		return -ENOMEM;
>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

      reply	other threads:[~2017-04-25  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  6:57 Wei Yongjun
2017-04-25  8:13 ` Vivek Gautam [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=02f41a36-d12c-d61a-ff51-f89e609704b5@codeaurora.org \
    --to=vivek.gautam@codeaurora.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj.lk@gmail.com \
    --cc=weiyongjun1@huawei.com \
    /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®