Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: David Laight <david.laight.linux@gmail.com>
Cc: "Ryan Neph" <ryanneph@google.com>,
	"Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/xe/configfs: fix clang warnings for missing parameter name
Date: Tue, 21 Oct 2025 08:39:57 +0200	[thread overview]
Message-ID: <20251021063957.GA757076@ax162> (raw)
In-Reply-To: <20251020110513.48d18788@pumpkin>

On Mon, Oct 20, 2025 at 11:05:13AM +0100, David Laight wrote:
> On Fri, 17 Oct 2025 12:46:26 -0700
> Ryan Neph <ryanneph@google.com> wrote:
> 
> > Fixes warning from clang-17 that look like:
> > 
> > drivers/gpu/drm/xe/xe_configfs.h:35:97: error: omitting the parameter name in a function definition is a C2x extension [-Werror,-Wc2x-extensions]
> >    35 | static inline u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
> 
> Why did that become invalid?
> It has pretty much always been used - and can be used to avoid -Wshadow warnings.
> This looks like a clang bug.
> And you'd want a specific -W 'knob' for it as well.
> 
> At a guess the C2x extension lets the name be omitted in the function body for
> an unused parameter (the same as C++).
> I think that is the 'definition' and the ones being changed here are the 'declaration'.
> But I might be wrong.

I don't think you read the patch clearly enough. Both declarations and
'static inline' definitions are being updated in this patch, likely for
consistency rather than necessity (but the commit message could call
this out). I don't see how there is a clang bug here.

> > 
> > Signed-off-by: Ryan Neph <ryanneph@google.com>
> > ---
> >  drivers/gpu/drm/xe/xe_configfs.h | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h
> > index fed57be0b90e146d57d966bab0e55e1723513997..a0d614b37efd54b89390f04a238aef1a8d4df4e2 100644
> > --- a/drivers/gpu/drm/xe/xe_configfs.h
> > +++ b/drivers/gpu/drm/xe/xe_configfs.h
> > @@ -21,9 +21,9 @@ bool xe_configfs_primary_gt_allowed(struct pci_dev *pdev);
> >  bool xe_configfs_media_gt_allowed(struct pci_dev *pdev);
> >  u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev);
> >  bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev);
> > -u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev, enum xe_engine_class,
> > +u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev, enum xe_engine_class class,
> >  				       const u32 **cs);
> > -u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
> > +u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class class,
> >  					const u32 **cs);
> >  #ifdef CONFIG_PCI_IOV
> >  unsigned int xe_configfs_get_max_vfs(struct pci_dev *pdev);
> > @@ -37,9 +37,11 @@ static inline bool xe_configfs_primary_gt_allowed(struct pci_dev *pdev) { return
> >  static inline bool xe_configfs_media_gt_allowed(struct pci_dev *pdev) { return true; }
> >  static inline u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev) { return U64_MAX; }
> >  static inline bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev) { return false; }
> > -static inline u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev, enum xe_engine_class,
> > +static inline u32 xe_configfs_get_ctx_restore_mid_bb(struct pci_dev *pdev,
> > +						     enum xe_engine_class class,
> >  						     const u32 **cs) { return 0; }
> > -static inline u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev, enum xe_engine_class,
> > +static inline u32 xe_configfs_get_ctx_restore_post_bb(struct pci_dev *pdev,
> > +						      enum xe_engine_class class,
> >  						      const u32 **cs) { return 0; }
> >  static inline unsigned int xe_configfs_get_max_vfs(struct pci_dev *pdev) { return UINT_MAX; }
> >  #endif
> > 
> 

  reply	other threads:[~2025-10-21  6:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 19:46 [PATCH 0/2] Fix additional sysfs node access CFI violations Ryan Neph
2025-10-17 19:46 ` [PATCH 1/2] drm/xe/sysfs: " Ryan Neph
2025-10-17 19:46 ` [PATCH 2/2] drm/xe/configfs: fix clang warnings for missing parameter name Ryan Neph
2025-10-20 10:05   ` David Laight
2025-10-21  6:39     ` Nathan Chancellor [this message]
2025-10-21 16:47       ` Ryan Neph
2025-10-22 16:38       ` David Laight
2025-10-17 19:53 ` ✗ CI.checkpatch: warning for Fix additional sysfs node access CFI violations Patchwork
2025-10-17 19:54 ` ✓ CI.KUnit: success " Patchwork
2025-10-17 20:33 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-18 19:05 ` ✗ Xe.CI.Full: 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=20251021063957.GA757076@ax162 \
    --to=nathan@kernel.org \
    --cc=airlied@gmail.com \
    --cc=david.laight.linux@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ryanneph@google.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@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