dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Andi Shyti" <andi.shyti@linux.intel.com>,
	"Arnd Bergmann" <arnd@kernel.org>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Badal Nilawar <badal.nilawar@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning
Date: Tue, 17 Oct 2023 07:27:56 +0200	[thread overview]
Message-ID: <f1f8daa4-cfb9-458a-a2ca-10d654ea83fc@app.fastmail.com> (raw)
In-Reply-To: <ZS206TuYnhE3PozK@ashyti-mobl2.lan>

On Tue, Oct 17, 2023, at 00:10, Andi Shyti wrote:
> Hi Arnd,
>
>>  static void rc6_res_reg_init(struct intel_rc6 *rc6)
>>  {
>> -	memset(rc6->res_reg, INVALID_MMIO_REG.reg, sizeof(rc6->res_reg));
>
> This is a complex initialization, indeed... how about just
>
>    memset(rc6->res_reg, 0, sizeof(rc6->res_reg));
>
>> +	i915_reg_t res_reg[INTEL_RC6_RES_MAX] = {
>> +		[0 ... INTEL_RC6_RES_MAX - 1] = INVALID_MMIO_REG,
>> +	};
>
> This is basically a
>
>    i915_reg_t res_reg[INTEL_RC6_RES_MAX] = { };
>
> Don't know which one is clearer.

Right, the original code went out of its way to use INVALID_MMIO_REG
instead of assuming it is zero, so I tried to preserve that for
consistency.

    Arnd

  reply	other threads:[~2023-10-17  5:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 20:10 [PATCH] drm/i915/mtl: avoid stringop-overflow warning Arnd Bergmann
2023-10-16 22:10 ` [Intel-gfx] " Andi Shyti
2023-10-17  5:27   ` Arnd Bergmann [this message]
2023-10-23 12:49 ` Jani Nikula
2023-10-24 17:41   ` Andi Shyti
2023-10-25 11:53     ` Jani Nikula
2023-10-26 12:18   ` [Intel-gfx] " 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=f1f8daa4-cfb9-458a-a2ca-10d654ea83fc@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andi.shyti@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.d.roper@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@linux.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;
as well as URLs for NNTP newsgroup(s).