From: Jason Yan <yanaijie@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <gregkh@linuxfoundation.org>, <matthias.bgg@gmail.com>,
<nishkadg.linux@gmail.com>, <devel@driverdev.osuosl.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: mt7621-pinctrl: Use correct pointer type argument for sizeof
Date: Mon, 20 Apr 2020 20:34:59 +0800 [thread overview]
Message-ID: <c6b155a6-28ae-e0f9-b866-4d17e8a45706@huawei.com> (raw)
In-Reply-To: <20200420121900.GD2659@kadam>
在 2020/4/20 20:19, Dan Carpenter 写道:
> On Mon, Apr 20, 2020 at 08:37:55PM +0800, Jason Yan wrote:
>> Fix the following coccicheck warning:
>>
>> drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c:223:14-36: WARNING: Use
>> correct pointer type argument for sizeof
>>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>> drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
>> index d0f06790d38f..8883f2a8ea57 100644
>> --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
>> +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
>> @@ -220,7 +220,7 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
>> /* allocate our function and group mapping index buffers */
>> f = p->func = devm_kcalloc(p->dev,
>> p->func_count,
>> - sizeof(struct rt2880_pmx_func),
>> + sizeof(struct rt2880_pmx_func *),
>
> Yes. This fixes a bug. We were allocating too much data. But the
> prefered style is:
>
> sizeof(*p->func),
>
> Please could you resend?
>
Sure, I will cook a new one.
> regards,
> dan carpenter
>
>
> .
>
next prev parent reply other threads:[~2020-04-20 12:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 12:37 Jason Yan
2020-04-20 12:19 ` Dan Carpenter
2020-04-20 12:34 ` Jason Yan [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-08 7:11 R Veera Kumar
2020-04-08 7:33 ` Greg Kroah-Hartman
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=c6b155a6-28ae-e0f9-b866-4d17e8a45706@huawei.com \
--to=yanaijie@huawei.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nishkadg.linux@gmail.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®