From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
tiwai@suse.com, alsa-devel@alsa-project.org,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] ALSA: hda: cirrus_scodec: Add KUnit test
Date: Wed, 20 Sep 2023 18:19:51 +0300 [thread overview]
Message-ID: <ZQsNl146RFAYdjSL@smile.fi.intel.com> (raw)
In-Reply-To: <874jjpwd4i.wl-tiwai@suse.de>
On Wed, Sep 20, 2023 at 08:51:57AM +0200, Takashi Iwai wrote:
> On Tue, 19 Sep 2023 22:44:28 +0200,
> Nick Desaulniers wrote:
> >
> > On Mon, Sep 18, 2023 at 10:51:29AM +0100, Richard Fitzgerald wrote:
> (snip)
> > > +static void cirrus_scodec_test_set_gpio_ref_arg(struct software_node_ref_args *arg,
> > > + int gpio_num)
> > > +{
> > > + struct software_node_ref_args template =
> > > + SOFTWARE_NODE_REFERENCE(&cirrus_scodec_test_gpio_swnode, gpio_num, 0);
> >
> > I'm observing the following error when building with:
> >
> > $ make LLVM=1 -j128 allmodconfig sound/pci/hda/cirrus_scodec_test.o
> >
> > sound/pci/hda/cirrus_scodec_test.c:151:60: error: initializer element is not a compile-time constant
> > 151 | SOFTWARE_NODE_REFERENCE(&cirrus_scodec_test_gpio_swnode, gpio_num, 0);
> > | ^~~~~~~~
> > /builds/linux/include/linux/property.h:291:37: note: expanded from macro 'SOFTWARE_NODE_REFERENCE'
> > 291 | .nargs = ARRAY_SIZE(((u64[]){ 0, ##__VA_ARGS__ })) - 1, \
> > | ^~~~~~~~~~~
> > /builds/linux/include/linux/kernel.h:57:75: note: expanded from macro 'ARRAY_SIZE'
> > 57 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> > | ^~~
> > /builds/linux/include/linux/compiler.h:228:59: note: expanded from macro '__must_be_array'
> > 228 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
> > | ^
> > /builds/linux/include/linux/compiler_types.h:366:63: note: expanded from macro '__same_type'
> > 366 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
> > | ^
> > /builds/linux/include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
> > 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
> > | ^
>
> Hm, this looks like some inconsistent handling of the temporary array
> passed to ARRAY_SIZE() in the SOFTWARE_NODE_REFERENCE macro. LLVM
> can't treat it if it contains a variable in the given array, while GCC
> doesn't care.
>
> A hackish workaround would be the patch like below, but it's really
> ugly. Ideally speaking, it should be fixed in linux/properties.h, but
> I have no idea how to fix there for LLVM.
>
> Adding more relevant people to Cc.
Thank you, I think it's quite easy to fix. Lemme cook the patch...
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-09-20 15:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 9:51 [PATCH 0/2] ALSA: hda: cs35l56: Handle speaker id GPIOs Richard Fitzgerald
2023-09-18 9:51 ` [PATCH 1/2] ALSA: hda: cs35l56: Add support for speaker id Richard Fitzgerald
2023-09-18 9:51 ` [PATCH 2/2] ALSA: hda: cirrus_scodec: Add KUnit test Richard Fitzgerald
2023-09-19 20:44 ` Nick Desaulniers
2023-09-20 6:51 ` Takashi Iwai
2023-09-20 8:27 ` Richard Fitzgerald
2023-09-20 8:42 ` Takashi Iwai
2023-09-20 15:19 ` Andy Shevchenko [this message]
2023-09-18 15:50 ` [PATCH 0/2] ALSA: hda: cs35l56: Handle speaker id GPIOs Takashi Iwai
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=ZQsNl146RFAYdjSL@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=djrscally@gmail.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=ndesaulniers@google.com \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/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