linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Rushikesh S Kadam <rushikesh.s.kadam@intel.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH 5/6] platform/chrome: chros_ec_ishtp: only load for matching devices
Date: Wed, 10 Nov 2021 09:44:10 -0700	[thread overview]
Message-ID: <YYv22iWQ7yTfMNC5@archlinux-ax161> (raw)
In-Reply-To: <20211029152901.297939-6-linux@weissschuh.net>

On Fri, Oct 29, 2021 at 05:29:00PM +0200, Thomas Weißschuh wrote:
> Previously it was loaded for all ISHTP devices.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> 
> ---
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: linux-input@vger.kernel.org
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> ---
>  drivers/platform/chrome/cros_ec_ishtp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
> index 9d1e7e03628e..8c17358e84c1 100644
> --- a/drivers/platform/chrome/cros_ec_ishtp.c
> +++ b/drivers/platform/chrome/cros_ec_ishtp.c
> @@ -774,6 +774,12 @@ static struct ishtp_cl_driver	cros_ec_ishtp_driver = {
>  	},
>  };
>  
> +static const struct ishtp_device_id cros_ec_ishtp_id_table[] = {
> +	{ cros_ish_guid },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(ishtp, cros_ec_ishtp_id_table);
> +
>  static int __init cros_ec_ishtp_mod_init(void)
>  {
>  	return ishtp_cl_driver_register(&cros_ec_ishtp_driver, THIS_MODULE);
> @@ -791,4 +797,3 @@ MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver");
>  MODULE_AUTHOR("Rushikesh S Kadam <rushikesh.s.kadam@intel.com>");
>  
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("ishtp:*");
> -- 
> 2.33.1
> 
> 

This patch in -next as commit facfe0a4fdce ("platform/chrome:
chros_ec_ishtp: only load for matching devices") and the following one
as commit f155dfeaa4ee ("platform/x86: isthp_eclite: only load for
matching devices") break clang and GCC prior to 8.1 (output from
Debian's GCC 6.3.0 below):

$ make -skj"$(nproc)" distclean allmodconfig drivers/platform/
drivers/platform/chrome/cros_ec_ishtp.c:778:4: error: initializer element is not constant
  { cros_ish_guid },
    ^~~~~~~~~~~~~
drivers/platform/chrome/cros_ec_ishtp.c:778:4: note: (near initialization for 'cros_ec_ishtp_id_table[0].guid')
scripts/Makefile.build:288: recipe for target 'drivers/platform/chrome/cros_ec_ishtp.o' failed
make[4]: *** [drivers/platform/chrome/cros_ec_ishtp.o] Error 1
drivers/platform/x86/intel/ishtp_eclite.c:685:4: error: initializer element is not constant
  { ecl_ishtp_guid },
    ^~~~~~~~~~~~~~
drivers/platform/x86/intel/ishtp_eclite.c:685:4: note: (near initialization for 'ecl_ishtp_id_table[0].guid')

I am sure clang should be fixed to recognize this value as a compile
time constant but the kernel supports GCC back to 5.1.0 so this should
be fixed here as well.

Cheers,
Nathan

  parent reply	other threads:[~2021-11-10 16:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 15:28 [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Thomas Weißschuh
2021-10-29 15:28 ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Thomas Weißschuh
2021-10-29 15:28   ` [PATCH 2/6] HID: intel-ish-hid: use constants for modaliases Thomas Weißschuh
2021-10-29 15:28     ` [PATCH 3/6] HID: intel-ish-hid: fw-loader: only load for matching devices Thomas Weißschuh
2021-10-29 15:28       ` [PATCH 4/6] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
2021-10-29 15:29         ` [PATCH 5/6] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
2021-10-29 15:29           ` [PATCH 6/6] platform/x86: isthp_eclite: " Thomas Weißschuh
2021-10-29 15:29             ` Thomas Weißschuh
2021-11-01  9:59             ` Hans de Goede
2021-11-10 16:44           ` Nathan Chancellor [this message]
2021-11-10 23:00             ` [PATCH 1/4] HID: intel-ish-hid: fw-loader: constify devicetable initializer Thomas Weißschuh
2021-11-11  9:10               ` Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 2/4] HID: intel-ish-hid: hid-client: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 3/4] platform/chrome: chros_ec_ishtp: " Thomas Weißschuh
2021-11-10 23:00             ` [PATCH 4/4] platform/x86: isthp_eclite: " Thomas Weißschuh
2021-11-01  9:58   ` [PATCH 1/6] HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() Hans de Goede
2021-11-01 10:09     ` Thomas Weißschuh
2021-11-01 10:15       ` Hans de Goede
2021-11-01  9:56 ` [PATCH 0/6] MODULE_DEVICE_TABLE() support for the ISHTP bus Hans de Goede
2021-11-01 10:12   ` Thomas Weißschuh
2021-11-01 10:17     ` Hans de Goede
2021-11-02 11:50       ` Jiri Kosina
2021-11-02 13:17         ` Srinivas Pandruvada
2021-11-09 10:42 ` Jiri Kosina

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=YYv22iWQ7yTfMNC5@archlinux-ax161 \
    --to=nathan@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=llvm@lists.linux.dev \
    --cc=rushikesh.s.kadam@intel.com \
    --cc=srinivas.pandruvada@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).