linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] HID: prodikeys: constify snd_rawmidi_ops structures
@ 2017-08-15  8:09 Julia Lawall
  2017-08-15  9:03 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2017-08-15  8:09 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: bhumirks, kernel-janitors, Benjamin Tissoires, linux-input,
	linux-kernel

This snd_rawmidi_ops structure is only passed as the third
argument of snd_rawmidi_set_ops.  This argument is const, so the
snd_rawmidi_ops structure can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/hid/hid-prodikeys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c
index f095bf8..49c4bd3 100644
--- a/drivers/hid/hid-prodikeys.c
+++ b/drivers/hid/hid-prodikeys.c
@@ -593,7 +593,7 @@ static void pcmidi_in_trigger(struct snd_rawmidi_substream *substream, int up)
 	pm->in_triggered = up;
 }
 
-static struct snd_rawmidi_ops pcmidi_in_ops = {
+static const struct snd_rawmidi_ops pcmidi_in_ops = {
 	.open = pcmidi_in_open,
 	.close = pcmidi_in_close,
 	.trigger = pcmidi_in_trigger

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] HID: prodikeys: constify snd_rawmidi_ops structures
  2017-08-15  8:09 [PATCH 2/3] HID: prodikeys: constify snd_rawmidi_ops structures Julia Lawall
@ 2017-08-15  9:03 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2017-08-15  9:03 UTC (permalink / raw)
  To: Julia Lawall
  Cc: bhumirks, kernel-janitors, Benjamin Tissoires, linux-input,
	linux-kernel

On Tue, 15 Aug 2017, Julia Lawall wrote:

> This snd_rawmidi_ops structure is only passed as the third
> argument of snd_rawmidi_set_ops.  This argument is const, so the
> snd_rawmidi_ops structure can be const too.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/hid/hid-prodikeys.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c
> index f095bf8..49c4bd3 100644
> --- a/drivers/hid/hid-prodikeys.c
> +++ b/drivers/hid/hid-prodikeys.c
> @@ -593,7 +593,7 @@ static void pcmidi_in_trigger(struct snd_rawmidi_substream *substream, int up)
>  	pm->in_triggered = up;
>  }
>  
> -static struct snd_rawmidi_ops pcmidi_in_ops = {
> +static const struct snd_rawmidi_ops pcmidi_in_ops = {
>  	.open = pcmidi_in_open,
>  	.close = pcmidi_in_close,
>  	.trigger = pcmidi_in_trigger

Applied to for-4.14/upstream, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-15  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-15  8:09 [PATCH 2/3] HID: prodikeys: constify snd_rawmidi_ops structures Julia Lawall
2017-08-15  9:03 ` Jiri Kosina

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).