On Wed, 23 May 2018, Daniel Vetter <[email protected]> wrote:
> On Tue, May 22, 2018 at 11:33:35AM +0300, Jani Nikula wrote:
>> On Mon, 21 May 2018, Maya Rashish <[email protected]> wrote:
>> > In drm_dp_i2c_drain_msg we do msg.buffer += err which isn't
>> > legal for void *.
>>
>> Well, this isn't pedantic C, it's GCC. There are tons of pointer
>> arithmetics for void pointers all over the kernel.
>
TTBOMK,
> I thought C99 even deprecated char * as the generic pointer, recommending
> void * instead,
True.
> which guarantees the exact same pointer arithmetic as char *
False.
> (but has the special casting rules).
True.
Void pointer arithmetics is still just a GCC extension, also supported
by Clang for compatibility.
> Which static checker came up with this?
Should be enough to turn GCC warning knobs to 11. But I don't imagine
being able to change this in the kernel code base.
BR,
Jani.
> -Daniel
>
>>
>> BR,
>> Jani.
>>
>> > ---
>> > include/drm/drm_dp_helper.h | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
>> > index 62903bae..06f9a61f 100644
>> > --- a/include/drm/drm_dp_helper.h
>> > +++ b/include/drm/drm_dp_helper.h
>> > @@ -1058,7 +1058,7 @@ struct drm_dp_aux_msg {
>> > unsigned int address;
>> > u8 request;
>> > u8 reply;
>> > - void *buffer;
>> > + char *buffer;
>> > size_t size;
>> > };
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
>> _______________________________________________
>> dri-devel mailing list
>> [email protected]
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel