From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Maya Rashish <coypu@sdf.org>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] Use char * for struct drm_dp_aux_msg's buffer
Date: Wed, 23 May 2018 12:56:25 +0300 [thread overview]
Message-ID: <87603en19y.fsf@intel.com> (raw)
In-Reply-To: <20180523090928.GT3438@phenom.ffwll.local>
On Wed, 23 May 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, May 22, 2018 at 11:33:35AM +0300, Jani Nikula wrote:
>> On Mon, 21 May 2018, Maya Rashish <coypu@sdf.org> 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
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-05-23 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 23:36 [PATCH 2/2] Use char * for struct drm_dp_aux_msg's buffer Maya Rashish
2018-05-22 8:33 ` Jani Nikula
2018-05-23 9:09 ` Daniel Vetter
2018-05-23 9:56 ` Jani Nikula [this message]
2018-05-24 8:12 ` Daniel Vetter
2018-05-23 10:09 ` coypu
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=87603en19y.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=coypu@sdf.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).