ALSA: ymfpci: remove unused snd_ymfpci_readb function
PATCH 1/1 ALSA: ymfpci: remove unused snd_ymfpci_readb function
clang with W=1 reports sound/pci/ymfpci/ymfpci_main.c:34:18: error:
unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function]
static inline u8 snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset)
^
This static function is not used, so remove it.
--- sound/pci/ymfpci/ymfpci_main.c | 5 ----- 1 file changed, 5 deletions(-)
sound/pci/ymfpci/ymfpci_main.c +0 -5
@@ -31,11 +31,6 @@static void snd_ymfpci_irq_wait (struct snd_ymfpci *chip); -static inline u8 snd_ymfpci_readb (struct snd_ymfpci *chip,u32 offset) -{ -return readb (chip->reg_area_virt + offset); -} -static inline void snd_ymfpci_writeb (struct snd_ymfpci *chip,u32 offset,u8 val) {writeb (val, chip->reg_area_virt + offset);
Signature · 1 line
2.27.0
Quoted 9 lines · Tom Rix
clang with W=1 reports
sound/pci/ymfpci/ymfpci_main.c:34:18: error:
unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function]
static inline u8snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset)^This static function is not used, so remove it.
Signed-off-by Tom Rix <[email protected]>
I applied now, but still wondering why it warns at all even if it's a static inline function...
thanks,
Takashi
Quoted 23 lines
--- sound/pci/ymfpci/ymfpci_main.c | 5 ----- 1 file changed, 5 deletions(-)sound/pci/ymfpci/ymfpci_main.c +0
-5@@ -31,11 +31,6 @@static void snd_ymfpci_irq_wait (struct snd_ymfpci *chip); -static inline u8 snd_ymfpci_readb (struct snd_ymfpci *chip,u32 offset) -{ -return readb (chip->reg_area_virt + offset); -} -static inline void snd_ymfpci_writeb (struct snd_ymfpci *chip,u32 offset,u8 val) {writeb (val, chip->reg_area_virt + offset);Signature · 1 line
2.27.0
Quoted 10 lines · Takashi Iwai
Quoted 8 lines · Tom Rix
clang with W=1 reports
sound/pci/ymfpci/ymfpci_main.c:34:18: error:
unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function]
static inline u8snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset)^This static function is not used, so remove it.
Quoted 4 lines
Quoted 1 line
Signed-off-by Tom Rix <[email protected]>I applied now, but still wondering why it warns at all even if it's a static inline function...
See commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build") for some more information. The key part of the commit message is 'with W=1', this will not happen with a normal clang build.
Cheers,
Nathan
Quoted 23 lines
Quoted 23 lines
--- sound/pci/ymfpci/ymfpci_main.c | 5 ----- 1 file changed, 5 deletions(-)sound/pci/ymfpci/ymfpci_main.c +0
-5@@ -31,11 +31,6 @@static void snd_ymfpci_irq_wait (struct snd_ymfpci *chip); -static inline u8 snd_ymfpci_readb (struct snd_ymfpci *chip,u32 offset) -{ -return readb (chip->reg_area_virt + offset); -} -static inline void snd_ymfpci_writeb (struct snd_ymfpci *chip,u32 offset,u8 val) {writeb (val, chip->reg_area_virt + offset);Signature · 1 line
2.27.0
Quoted 10 lines · Nathan Chancellor
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Tom Rix
clang with W=1 reports
sound/pci/ymfpci/ymfpci_main.c:34:18: error:
unused function 'snd_ymfpci_readb' [-Werror,-Wunused-function]
static inline u8snd_ymfpci_readb(struct snd_ymfpci *chip, u32 offset)^This static function is not used, so remove it.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Tom Rix <[email protected]>I applied now, but still wondering why it warns at all even if it's a static inline function...
See commit
6863f5643dd7("kbuild: allow Clang to find unused static inline functions for W=1 build") for some more information. The key part of the commit message is 'with W=1', this will not happen with a normal clang build.
IMO from this general cleanup, being at W=1, is the correct location.
There many functions that could be removed and some that should not be.
Tom
Quoted 27 lines
Cheers,
NathanQuoted 23 lines
Quoted 23 lines
--- sound/pci/ymfpci/ymfpci_main.c | 5 ----- 1 file changed, 5 deletions(-)sound/pci/ymfpci/ymfpci_main.c +0
-5@@ -31,11 +31,6 @@static void snd_ymfpci_irq_wait (struct snd_ymfpci *chip); -static inline u8 snd_ymfpci_readb (struct snd_ymfpci *chip,u32 offset) -{ -return readb (chip->reg_area_virt + offset); -} -static inline void snd_ymfpci_writeb (struct snd_ymfpci *chip,u32 offset,u8 val) {writeb (val, chip->reg_area_virt + offset);Signature · 1 line
2.27.0