All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: core: Fix Sparse incompatible types warning
Date: Wed, 09 Apr 2014 13:30:47 +0200	[thread overview]
Message-ID: <53452F67.3060400@metafoo.de> (raw)
In-Reply-To: <1397041934.11424.2.camel@AMDC1943>

On 04/09/2014 01:12 PM, Krzysztof Kozlowski wrote:
> On śro, 2014-04-09 at 12:57 +0200, Lars-Peter Clausen wrote:
>> On 04/09/2014 09:21 AM, Krzysztof Kozlowski wrote:
>>> Fix following Sparse warning:
>>> sound/soc/soc-core.c:252:20: error: incompatible types in comparison expression (different type sizes)
>>>
>>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>>> ---
>>>    sound/soc/soc-core.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>>> index 051c006281f5..41f6178249df 100644
>>> --- a/sound/soc/soc-core.c
>>> +++ b/sound/soc/soc-core.c
>>> @@ -249,7 +249,7 @@ static ssize_t codec_reg_write_file(struct file *file,
>>>    	struct snd_soc_codec *codec = file->private_data;
>>>    	int ret;
>>>
>>> -	buf_size = min(count, (sizeof(buf)-1));
>>> +	buf_size = min(count, (size_t)(sizeof(buf)-1));
>>
>> But shouldn't the type of sizeof already be size_t?
>
> Hmmm... yes it should. It looks like a false positive from Sparse so the
> commit message should be rather "Suppress" than "Fix".

I'm pretty sure it is a bug in sparse, we shouldn't suppress those, but 
rather fix them in sparse itself.

  reply	other threads:[~2014-04-09 11:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09  7:21 [PATCH] ASoC: core: Fix Sparse incompatible types warning Krzysztof Kozlowski
2014-04-09 10:57 ` Lars-Peter Clausen
2014-04-09 11:12   ` Krzysztof Kozlowski
2014-04-09 11:30     ` Lars-Peter Clausen [this message]
2014-04-09 20:25       ` Mark Brown
2014-04-09 20:28         ` Lars-Peter Clausen
2014-04-10  3:01           ` Al Viro
2014-04-10  7:13             ` Krzysztof Kozlowski

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=53452F67.3060400@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=k.kozlowski@samsung.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.