From: Jani Nikula <jani.nikula@intel.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Yetunde Adebisi <yetundex.adebisi@intel.com>,
intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/i915: Add Backlight Control using DPCD for eDP connectors (v5)
Date: Tue, 12 Jan 2016 19:30:08 +0200 [thread overview]
Message-ID: <8737u2iu3j.fsf@intel.com> (raw)
In-Reply-To: <CAPj87rPAT1rEvhJ_BGxRYj46pp9W_AJeg1yeWrWjsAnsxNFE2Q@mail.gmail.com>
On Tue, 12 Jan 2016, Daniel Stone <daniel@fooishbar.org> wrote:
> On 12 January 2016 at 17:18, Jani Nikula <jani.nikula@intel.com> wrote:
>> On Tue, 12 Jan 2016, Daniel Stone <daniel@fooishbar.org> wrote:
>>> On 12 January 2016 at 15:59, Yetunde Adebisi <yetundex.adebisi@intel.com> wrote:
>>>> + memset(intel_dp->edp_dpcd, 0, sizeof(intel_dp->edp_dpcd));
>>>
>>> gcc should've warned you about this; you're memsetting too small a size.
>>
>> Really? I think it's fine.
>
> foo.c:11:23: warning: argument to ‘sizeof’ in ‘memset’ call is the
> same expression as the destination; did you mean to dereference it?
> [-Wsizeof-pointer-memaccess]
> memset(bar, 0, sizeof(bar));
> ^
>
> Either it should be memset(&intel_dp->edp_dpcd, ...), or it should be
> sizeof(*intel_dp->edp_dpcd). Unless the intention is genuinely just to
> clear the size of one pointer and not the entire structure, in which
> case this is terribly misleading.
It's defined as
+ uint8_t edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
so sizeof(intel_dp->edp_dpcd) will be EDP_DISPLAY_CTL_CAP_SIZE.
BR,
Jani.
>
> Cheers,
> Daniel
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-01-12 17:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 15:59 [PATCH 0/2] DPCD Backlight Control Yetunde Adebisi
2016-01-12 15:59 ` [PATCH 1/2] drm/dp: Add definition for Display Control DPCD Registers capability size Yetunde Adebisi
2016-01-12 15:59 ` [PATCH 2/2] drm/i915: Add Backlight Control using DPCD for eDP connectors (v5) Yetunde Adebisi
2016-01-12 16:16 ` Daniel Stone
2016-01-12 17:18 ` Jani Nikula
2016-01-12 17:27 ` Daniel Stone
2016-01-12 17:30 ` Jani Nikula [this message]
2016-01-12 17:49 ` ✗ warning: Fi.CI.BAT Patchwork
2016-01-21 15:07 ` Adebisi, YetundeX
2016-01-22 14:35 ` Jani Nikula
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=8737u2iu3j.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=daniel@fooishbar.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=yetundex.adebisi@intel.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