[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACzaYTNGou67KhL5iRW8w2qViu2Q05TMdnUjmeSVebdYwS9g0A@mail.gmail.com>
Date: Sun, 10 Mar 2013 21:59:13 +0200
From: Vicentiu Ciorbaru <cvicentiu@...il.com>
To: Clemens Ladisch <clemens@...isch.de>
Cc: perex@...ex.cz, tiwai@...e.de, wfp5p@...ginia.edu,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] emu10k1: Fix coccicheck warning
>> My reasoning behind the patch is that the C standard does not require a
>> specific cast of a void pointer in order to set it to the type of the
>> member gpr_map of the struct snd_emu10k1_fx8010_code. I named it redundant
>> because the compiler would cast to it anyway.
>
> That's correct as far as the C standard is concerned. However, __user is
> a non-standard extension.
>
>> The line also appears as a warning when running make coccicheck.
>
> And when you remove the __user, you get a warning when running make C=x.
>
> Both coccinelle and sparse are merely tools for finding likely bugs.
> When it isn't possible to make them both happy with or without the cast,
> that just shows that the code itself is badly designed.
>
> The driver should be redesigned to not access user and kernel space
> memory through the same pointer.
In that case I thank you for the quick feedback and I will try looking
more deeply into the issue.
Vicentiu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists