public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Matt Roper <matthew.d.roper@intel.com>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@gmail.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning
Date: Tue, 17 Oct 2023 00:10:49 +0200	[thread overview]
Message-ID: <ZS206TuYnhE3PozK@ashyti-mobl2.lan> (raw)
In-Reply-To: <20231016201012.1022812-1-arnd@kernel.org>

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.

Andi

  reply	other threads:[~2023-10-16 22:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 20:10 [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning Arnd Bergmann
2023-10-16 22:10 ` Andi Shyti [this message]
2023-10-17  5:27   ` Arnd Bergmann
2023-10-17  4:29 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mtl: avoid stringop-overflow warning (rev3) Patchwork
2023-10-17  4:47 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-23 12:49 ` [Intel-gfx] [PATCH] drm/i915/mtl: avoid stringop-overflow warning Jani Nikula
2023-10-24 17:41   ` Andi Shyti
2023-10-25 11:53     ` Jani Nikula
2023-10-26 12:18   ` Jani Nikula
2023-10-24 22:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mtl: avoid stringop-overflow warning (rev4) Patchwork
2023-10-24 22:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-25 14:26 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=ZS206TuYnhE3PozK@ashyti-mobl2.lan \
    --to=andi.shyti@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel@ffwll.ch \
    --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 \
    /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