Backport new field_prep()/get() particularly useful to handle case where a bitmask is not const and FIELD_PREP can't be used. This permit to replace manual shift with these macro. (also needed to permit backport of some patch without modification) Backport reworked patch that drop the local field_prep()/get() macro in favor of the global one. Link: https://github.com/openwrt/openwrt/pull/22479 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From b1cff2f4b2391a13bd3e9263502072df1ee5d035 Mon Sep 17 00:00:00 2001
|
|
From: Geert Uytterhoeven <geert+renesas@glider.be>
|
|
Date: Thu, 6 Nov 2025 14:34:10 +0100
|
|
Subject: [PATCH] ALSA: usb-audio: Convert to common field_{get,prep}() helpers
|
|
|
|
Drop the driver-specific field_get() and field_prep() macros, in favor
|
|
of the globally available variants from <linux/bitfield.h>.
|
|
|
|
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
|
|
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
|
|
---
|
|
sound/usb/mixer_quirks.c | 6 ------
|
|
1 file changed, 6 deletions(-)
|
|
|
|
--- a/sound/usb/mixer_quirks.c
|
|
+++ b/sound/usb/mixer_quirks.c
|
|
@@ -3367,10 +3367,6 @@ static int snd_bbfpro_controls_create(st
|
|
#define RME_DIGIFACE_REGISTER(reg, mask) (((reg) << 16) | (mask))
|
|
#define RME_DIGIFACE_INVERT BIT(31)
|
|
|
|
-/* Nonconst helpers */
|
|
-#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
|
|
-#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
|
|
-
|
|
static int snd_rme_digiface_write_reg(struct snd_kcontrol *kcontrol, int item, u16 mask, u16 val)
|
|
{
|
|
struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
|