Linux Input/HID development
 help / color / mirror / Atom feed
From: Orlando Chamberlain <orlandoch.dev@gmail.com>
To: Aditya Garg <gargaditya08@live.com>
Cc: "Thomas Weißschuh" <thomas@t-8ch.de>,
	"Jiri Kosina" <jikos@kernel.org>,
	"jkosina@suse.cz" <jkosina@suse.cz>,
	"benjamin.tissoires@redhat.com" <benjamin.tissoires@redhat.com>,
	"Andy Shevchenko" <andy@infradead.org>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"ronald@innovation.ch" <ronald@innovation.ch>,
	"kekrby@gmail.com" <kekrby@gmail.com>
Subject: Re: [PATCH 1/3] HID: apple-ibridge: Add Apple iBridge HID driver for T1 chip.
Date: Fri, 10 Feb 2023 23:20:43 +1100	[thread overview]
Message-ID: <20230210232043.18483401@redecorated-mbp> (raw)
In-Reply-To: <B9E319F8-6047-40E5-BD9F-D90D6504AA9E@live.com>

On Fri, 10 Feb 2023 12:05:13 +0000
Aditya Garg <gargaditya08@live.com> wrote:

> > On 10-Feb-2023, at 10:26 AM, Thomas Weißschuh <thomas@t-8ch.de>
> > wrote:
> > 
> > Hi,
> > 
> > some comments inline.
> > 
> > On Fri, Feb 10, 2023 at 03:43:24AM +0000, Aditya Garg wrote:
> >   
> >> +
> >> +static struct {
> >> + unsigned int usage;
> >> + struct hid_device_id *dev_id;
> >> +} appleib_usage_map[] = {
> >> + /* Default iBridge configuration, key inputs and mode settings */
> >> + { 0x00010006, &appleib_sub_hid_ids[0] },
> >> + /* OS X iBridge configuration, digitizer inputs */
> >> + { 0x000D0005, &appleib_sub_hid_ids[0] },
> >> + /* All iBridge configurations, display/DFR settings */
> >> + { 0xFF120001, &appleib_sub_hid_ids[0] },
> >> + /* All iBridge configurations, ALS */
> >> + { 0x00200041, &appleib_sub_hid_ids[1] },
> >> +};  
> > 
> > const
> >   
> 
> Constantifying this results in compiler giving warnings
> 
> drivers/hid/apple-ibridge.c:78:23: warning: initialization discards
> 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 78 |         { 0x00200041, &appleib_sub_hid_ids[1] }, |
>         ^ drivers/hid/apple-ibridge.c: In function
> 'appleib_add_sub_dev': drivers/hid/apple-ibridge.c:363:29: warning:
> assignment discards 'const' qualifier from pointer target type
> [-Wdiscarded-qualifiers] 363 |         sub_hdev->ll_driver =
> &appleib_ll_driver; |                             ^
> drivers/hid/apple-ibridge.c: In function 'appleib_hid_probe':
> drivers/hid/apple-ibridge.c:436:12: error: expected '(' before
> 'hid_is_usb' 436 |         if hid_is_usb(hdev) |            ^~~~~~~~~~
>       |            (
> In file included from drivers/hid/apple-ibridge.c:48:
> drivers/hid/apple-ibridge.c: In function 'appleib_probe':
> drivers/hid/apple-ibridge.c:544:35: warning: passing argument 1 of
> '__hid_register_driver' discards 'const' qualifier from pointer
> target type [-Wdiscarded-qualifiers] 544 |         ret =
> hid_register_driver(&appleib_hid_driver); |
>         ^~~~~~~~~~~~~~~~~~~ ./include/linux/hid.h:898:31: note: in
> definition of macro 'hid_register_driver' 898 |
> __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) |
>                      ^~~~~~ ./include/linux/hid.h:893:47: note:
> expected 'struct hid_driver *' but argument is of type 'const struct
> hid_driver *' 893 | extern int __must_check
> __hid_register_driver(struct hid_driver *, |
>                      ^~~~~~~~~~~~~~~~~~~ drivers/hid/apple-ibridge.c:
> In function 'appleib_remove': drivers/hid/apple-ibridge.c:558:31:
> warning: passing argument 1 of 'hid_unregister_driver' discards
> 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
> 558 |         hid_unregister_driver(&appleib_hid_driver); |
>                     ^~~~~~~~~~~~~~~~~~~ ./include/linux/hid.h:900:35:
> note: expected 'struct hid_driver *' but argument is of type 'const
> struct hid_driver *' 900 | extern void hid_unregister_driver(struct
> hid_driver *); |
> ^~~~~~~~~~~~~~~~~~~ make[6]: *** [scripts/Makefile.build:250:
> drivers/hid/apple-ibridge.o] Error 1 make[5]: ***
> [scripts/Makefile.build:500: drivers/hid] Error 2 make[5]: ***
> Waiting for unfinished jobs….
> 
> Some warnings are also due to a typo in if and constantifying `static
> struct hid_driver`, although they probably can be fixed.
> 
> In short, Thomas, do you really want me to constantify the structure
> I am talking about in this email, as well `static struct hid_driver`?
> 

Were the changes needed for these structs to be const in the
linux-input tree for 6.3? If so then if you're applying the patches
onto linus' tree that might be why there are errors about consts.

  reply	other threads:[~2023-02-10 12:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  3:41 [PATCH 0/3] Touch Bar and Keyboard backlight driver for Intel Macs Aditya Garg
2023-02-10  3:43 ` [PATCH 1/3] HID: apple-ibridge: Add Apple iBridge HID driver for T1 chip Aditya Garg
2023-02-10  3:44   ` [PATCH 2/3] HID: apple-touchbar: Add driver for the Touch Bar on MacBook Pros Aditya Garg
2023-02-10  3:45     ` [PATCH 3/3] HID: apple-magic-backlight: Add driver for keyboard backlight on internal Magic Keyboards Aditya Garg
2023-02-10 16:25       ` Thomas Weißschuh
2023-02-10 23:24         ` Orlando Chamberlain
2023-02-11  2:23           ` Thomas Weißschuh
2023-02-11  2:42             ` Thomas Weißschuh
2023-02-11 16:56       ` Pavel Machek
2023-02-12  2:28         ` Orlando Chamberlain
2023-02-12  5:16         ` Aditya Garg
2023-02-12 11:18       ` Andy Shevchenko
2023-02-16  1:17         ` Orlando Chamberlain
2023-02-10 16:13     ` [PATCH 2/3] HID: apple-touchbar: Add driver for the Touch Bar on MacBook Pros Thomas Weißschuh
2023-02-12 11:56     ` Andy Shevchenko
2023-02-10  4:56   ` [PATCH 1/3] HID: apple-ibridge: Add Apple iBridge HID driver for T1 chip Thomas Weißschuh
2023-02-10  8:30     ` Aditya Garg
2023-02-10  8:39       ` Benjamin Tissoires
2023-02-10  8:54         ` Aditya Garg
2023-02-10  9:21           ` Benjamin Tissoires
2023-02-10 12:05     ` Aditya Garg
2023-02-10 12:20       ` Orlando Chamberlain [this message]
2023-02-10 13:07         ` Aditya Garg
2023-02-10 14:01           ` Benjamin Tissoires
2023-02-10 15:33       ` Thomas Weißschuh
2023-02-10 15:49         ` Aditya Garg
2023-02-10 18:36           ` Thomas Weißschuh 
2023-02-12 11:35   ` Andy Shevchenko
2023-02-10 10:18 ` [PATCH 0/3] Touch Bar and Keyboard backlight driver for Intel Macs Andy Shevchenko
2023-02-10 10:41   ` Aditya Garg
2023-02-10 10:47     ` Orlando Chamberlain
2023-02-10 11:12       ` Andy Shevchenko

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=20230210232043.18483401@redecorated-mbp \
    --to=orlandoch.dev@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=gargaditya08@live.com \
    --cc=jikos@kernel.org \
    --cc=jkosina@suse.cz \
    --cc=kekrby@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ronald@innovation.ch \
    --cc=thomas@t-8ch.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