* [PATCH] Input: ati_remote2: constify usb_device_id
@ 2017-08-08 16:54 Arvind Yadav
2017-08-15 5:11 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-08 16:54 UTC (permalink / raw)
To: syrjala, dmitry.torokhov; +Cc: linux-kernel, linux-input
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/input/misc/ati_remote2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 1c5914c..ebf4448 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -110,7 +110,7 @@ static const struct kernel_param_ops param_ops_mode_mask = {
module_param(mode_mask, mode_mask, 0644);
MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>");
-static struct usb_device_id ati_remote2_id_table[] = {
+static const struct usb_device_id ati_remote2_id_table[] = {
{ USB_DEVICE(0x0471, 0x0602) }, /* ATI Remote Wonder II */
{ }
};
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: ati_remote2: constify usb_device_id
2017-08-08 16:54 [PATCH] Input: ati_remote2: constify usb_device_id Arvind Yadav
@ 2017-08-15 5:11 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2017-08-15 5:11 UTC (permalink / raw)
To: Arvind Yadav; +Cc: syrjala, linux-kernel, linux-input
On Tue, Aug 08, 2017 at 10:24:12PM +0530, Arvind Yadav wrote:
> usb_device_id are not supposed to change at runtime. All functions
> working with usb_device_id provided by <linux/usb.h> work with
> const usb_device_id. So mark the non-const structs as const.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Applied, thank you.
> ---
> drivers/input/misc/ati_remote2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
> index 1c5914c..ebf4448 100644
> --- a/drivers/input/misc/ati_remote2.c
> +++ b/drivers/input/misc/ati_remote2.c
> @@ -110,7 +110,7 @@ static const struct kernel_param_ops param_ops_mode_mask = {
> module_param(mode_mask, mode_mask, 0644);
> MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>");
>
> -static struct usb_device_id ati_remote2_id_table[] = {
> +static const struct usb_device_id ati_remote2_id_table[] = {
> { USB_DEVICE(0x0471, 0x0602) }, /* ATI Remote Wonder II */
> { }
> };
> --
> 2.7.4
>
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-15 5:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 16:54 [PATCH] Input: ati_remote2: constify usb_device_id Arvind Yadav
2017-08-15 5:11 ` Dmitry Torokhov
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).