All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniel@fooishbar.org>
To: Jani Nikula <jani.nikula@intel.com>
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 17:27:46 +0000	[thread overview]
Message-ID: <CAPj87rPAT1rEvhJ_BGxRYj46pp9W_AJeg1yeWrWjsAnsxNFE2Q@mail.gmail.com> (raw)
In-Reply-To: <8760yyiumo.fsf@intel.com>

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.

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-12 17:27 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 [this message]
2016-01-12 17:30         ` Jani Nikula
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=CAPj87rPAT1rEvhJ_BGxRYj46pp9W_AJeg1yeWrWjsAnsxNFE2Q@mail.gmail.com \
    --to=daniel@fooishbar.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 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.