[PATCH 2/3] ALSA: usb-audio: Extend quirk_flags to 64bit

Takashi Iwai <[email protected]>
Newsgroups org.kernel.vger.linux-sound
Message-ID <[email protected]>
Now we reached the limit of 32bit bitmap for quirk flags.
In order to be future-ready, simply extend the flag bitmap to 64bit.

Signed-off-by: Takashi Iwai <[email protected]>
---
 sound/usb/card.c     |  2 +-
 sound/usb/quirks.c   | 10 +++++-----
 sound/usb/quirks.h   |  2 +-
 sound/usb/usbaudio.h |  4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index b36f513dccb9..24112e491779 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -715,7 +715,7 @@ static void snd_usb_init_quirk_flags(int idx, struct snd_usb_audio *chip)
 
 	/* old style option found: the position-based integer value */
 	if (quirk_flags[idx] &&
-	    !kstrtou32(quirk_flags[idx], 0, &chip->quirk_flags)) {
+	    !kstrtou64(quirk_flags[idx], 0, &chip->quirk_flags)) {
 		snd_usb_apply_flag_dbg("module param", chip, chip->quirk_flags);
 		return;
 	}
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 52dbbdb7f9a1..77adefe4f9cb 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2145,7 +2145,7 @@ struct usb_string_match {
 
 struct usb_audio_quirk_flags_table {
 	u32 id;
-	u32 flags;
+	u64 flags;
 	const struct usb_string_match *usb_string_match;
 };
 
@@ -2638,7 +2638,7 @@ const char *snd_usb_quirk_flag_find_name(unsigned long index)
 	return snd_usb_audio_quirk_flag_names[index];
 }
 
-u32 snd_usb_quirk_flags_from_name(const char *name)
+u64 snd_usb_quirk_flags_from_name(const char *name)
 {
 	int i;
 
@@ -2647,7 +2647,7 @@ u32 snd_usb_quirk_flags_from_name(const char *name)
 
 	for (i = 0; snd_usb_audio_quirk_flag_names[i]; i++) {
 		if (strcasecmp(name, snd_usb_audio_quirk_flag_names[i]) == 0)
-			return BIT_U32(i);
+			return BIT_U64(i);
 	}
 
 	return 0;
@@ -2705,7 +2705,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
 {
 	u16 chip_vid = USB_ID_VENDOR(chip->usb_id);
 	u16 chip_pid = USB_ID_PRODUCT(chip->usb_id);
-	u32 mask_flags, unmask_flags, bit;
+	u64 mask_flags, unmask_flags, bit;
 	char *p, *field, *flag;
 	bool is_unmask;
 	u16 vid, pid;
@@ -2759,7 +2759,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
 				is_unmask = false;
 			}
 
-			if (!kstrtou32(flag, 16, &bit)) {
+			if (!kstrtou64(flag, 16, &bit)) {
 				if (is_unmask)
 					unmask_flags |= bit;
 				else
diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h
index f24d6a5a197a..54f4cca8d7af 100644
--- a/sound/usb/quirks.h
+++ b/sound/usb/quirks.h
@@ -57,6 +57,6 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
 					   const char *str);
 
 const char *snd_usb_quirk_flag_find_name(unsigned long flag);
-u32 snd_usb_quirk_flags_from_name(const char *name);
+u64 snd_usb_quirk_flags_from_name(const char *name);
 
 #endif /* __USBAUDIO_QUIRKS_H */
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index dc1d0c8c9c80..31e612500050 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -44,7 +44,7 @@ struct snd_usb_audio {
 	atomic_t active;
 	atomic_t shutdown;
 	struct snd_refcount usage_count;
-	unsigned int quirk_flags;
+	u64 quirk_flags;
 	unsigned int need_delayed_register:1; /* warn for delayed registration */
 	int num_interfaces;
 	int last_iface;
@@ -298,7 +298,7 @@ enum {
 /* Please also edit snd_usb_audio_quirk_flag_names */
 };
 
-#define QUIRK_FLAG(x)	BIT_U32(QUIRK_TYPE_ ## x)
+#define QUIRK_FLAG(x)	BIT_U64(QUIRK_TYPE_ ## x)
 
 #define QUIRK_FLAG_GET_SAMPLE_RATE		QUIRK_FLAG(GET_SAMPLE_RATE)
 #define QUIRK_FLAG_SHARE_MEDIA_DEVICE		QUIRK_FLAG(SHARE_MEDIA_DEVICE)
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.