All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: perex@perex.cz, tiwai@suse.com, zonque@gmail.com, clemens@ladisch.de
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] ALSA: usb-audio: constify usb_device_id.
Date: Sun,  6 Aug 2017 12:18:56 +0530	[thread overview]
Message-ID: <1502002139-10787-5-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1502002139-10787-1-git-send-email-arvind.yadav.cs@gmail.com>

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>
---
 sound/usb/card.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 6640277..3dc36d9 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -486,7 +486,7 @@ static bool get_alias_id(struct usb_device *dev, unsigned int *id)
 	return false;
 }
 
-static struct usb_device_id usb_audio_ids[]; /* defined below */
+static const struct usb_device_id usb_audio_ids[]; /* defined below */
 
 /* look for the corresponding quirk */
 static const struct snd_usb_audio_quirk *
@@ -814,7 +814,7 @@ static int usb_audio_reset_resume(struct usb_interface *intf)
 #define usb_audio_reset_resume	NULL
 #endif		/* CONFIG_PM */
 
-static struct usb_device_id usb_audio_ids [] = {
+static const struct usb_device_id usb_audio_ids [] = {
 #include "quirks-table.h"
     { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS),
       .bInterfaceClass = USB_CLASS_AUDIO,
-- 
2.7.4

  parent reply	other threads:[~2017-08-06  6:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-06  6:48 [PATCH 0/7] constify ALSA usb_device_id Arvind Yadav
2017-08-06  6:48 ` [PATCH 1/7] ALSA: 6fire: constify usb_device_id Arvind Yadav
2017-08-06  6:48 ` [PATCH 2/7] ALSA: bcd2000: " Arvind Yadav
2017-08-06  6:48 ` [PATCH 3/7] ALSA: snd-usb-caiaq: " Arvind Yadav
2017-08-06  6:48 ` Arvind Yadav [this message]
2017-08-06  6:48 ` [PATCH 5/7] ALSA: ua101: " Arvind Yadav
2017-08-06  6:48 ` [PATCH 6/7] ALSA: us122l: " Arvind Yadav
2017-08-06  6:48 ` [PATCH 7/7] ALSA: usbusx2y: " Arvind Yadav
2017-08-06 20:21 ` [PATCH 0/7] constify ALSA usb_device_id Takashi Iwai
2017-08-06 20:21   ` 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=1502002139-10787-5-git-send-email-arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zonque@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.