Skip to contentSkip to conversation

USB: hcd: remove unused hcd_name variables

PATCH In review Greg Kroah-Hartman 2 participants 3 messages Aug 31, 2022 – Sep 1, 2022

Subsystems (4)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 USB: hcd: remove unused hcd_name variables

In the commit 10174220f55a ("usb: reduce kernel log spam on driver registration") a lot of unneeded kernel log messages were removed, but that caused a few build warnings to show up where the variable hcd_name was being set but never used anymore.

Resolve this by just removing these variables as they are not needed anymore

Cc Ard Biesheuvel <[email protected]>
Cc Alan Stern <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Alim Akhtar <[email protected]>
Cc Rob Herring <[email protected]>
Fixes 10174220f55a ("usb: reduce kernel log spam on driver registration")
---
 drivers/usb/host/ehci-exynos.c   | 1 -
 drivers/usb/host/ehci-platform.c | 2 --
 drivers/usb/host/ohci-platform.c | 2 --
 3 files changed, 5 deletions(-)
drivers/usb/host/ehci-exynos.c +0 -1
index a65e365e3a04..c8e152c2e0ce 100644
@@ -32,7 +32,6 @@
 	(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 |	\
 	 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
 
-static const char hcd_name[] = "ehci-exynos";
 static struct hc_driver __read_mostly exynos_ehci_hc_driver;
 
 #define PHY_NUMBER 3
drivers/usb/host/ehci-platform.c +0 -2
index 50491eea9409..fe497c876d76 100644
@@ -53,8 +53,6 @@ struct ehci_platform_priv {
 	struct delayed_work poll_work;
 };
 
-static const char hcd_name[] = "ehci-platform";
-
 static int ehci_platform_reset(struct usb_hcd *hcd)
 {
 	struct platform_device *pdev = to_platform_device(hcd->self.controller);
drivers/usb/host/ohci-platform.c +0 -2
index 6d56b52966c7..4e7946024ce7 100644
@@ -41,8 +41,6 @@ struct ohci_platform_priv {
 	struct reset_control *resets;
 };
 
-static const char hcd_name[] = "ohci-platform";
-
 static int ohci_platform_power_on(struct platform_device *dev)
 {
 	struct usb_hcd *hcd = platform_get_drvdata(dev);
Signature · 1 line
2.37.2
maintainer
#1 lore raw
Quoted 20 lines · Greg Kroah-Hartman

In the commit 10174220f55a ("usb: reduce kernel log spam on driver registration") a lot of unneeded kernel log messages were removed, but that caused a few build warnings to show up where the variable hcd_name was being set but never used anymore.

Resolve this by just removing these variables as they are not needed anymore

Cc Ard Biesheuvel <[email protected]>
Cc Alan Stern <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Alim Akhtar <[email protected]>
Cc Rob Herring <[email protected]>
Fixes 10174220f55a ("usb: reduce kernel log spam on driver registration")
Quoted 5 lines
---
 drivers/usb/host/ehci-exynos.c   | 1 -
 drivers/usb/host/ehci-platform.c | 2 --
 drivers/usb/host/ohci-platform.c | 2 --
 3 files changed, 5 deletions(-)

This isn't enough, as you can see from this kernel test robot excerpt:

clang_recent_errors

|-- arm-s5pv210_defconfig
|   |-- drivers-usb-host-ehci-exynos.c:warning:unused-variable-hcd_name
|   `-- drivers-usb-host-ohci-exynos.c:warning:unused-variable-hcd_name
|-- hexagon-randconfig-r024-20220830
|   |-- drivers-usb-host-ehci-atmel.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-exynos.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-orion.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ehci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-spear.c:warning:unused-variable-hcd_name
|   `-- 
drivers-usb-host-ohci-platform.c:warning:unused-variable-hcd_name
|-- hexagon-randconfig-r036-20220830
|   |-- drivers-usb-host-ehci-atmel.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-npcm7xx.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ehci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-st.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-at91.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ohci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-s3c2410.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-spear.c:warning:unused-variable-hcd_name
|   `-- drivers-usb-host-ohci-st.c:warning:unused-variable-hcd_name

Yes, it has duplicates and your patch handles some of these. But there are others that still need to be fixed. Also, this list is missing ohci-pxa27x.c.

Alan Stern

author maintainer
#2 lore raw
Quoted 55 lines · Alan Stern
Quoted 20 lines · Greg Kroah-Hartman

In the commit 10174220f55a ("usb: reduce kernel log spam on driver registration") a lot of unneeded kernel log messages were removed, but that caused a few build warnings to show up where the variable hcd_name was being set but never used anymore.

Resolve this by just removing these variables as they are not needed anymore

Cc Ard Biesheuvel <[email protected]>
Cc Alan Stern <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Alim Akhtar <[email protected]>
Cc Rob Herring <[email protected]>
Fixes 10174220f55a ("usb: reduce kernel log spam on driver registration")
Quoted 5 lines
---
 drivers/usb/host/ehci-exynos.c   | 1 -
 drivers/usb/host/ehci-platform.c | 2 --
 drivers/usb/host/ohci-platform.c | 2 --
 3 files changed, 5 deletions(-)

This isn't enough, as you can see from this kernel test robot excerpt:

clang_recent_errors

|-- arm-s5pv210_defconfig
|   |-- drivers-usb-host-ehci-exynos.c:warning:unused-variable-hcd_name
|   `-- drivers-usb-host-ohci-exynos.c:warning:unused-variable-hcd_name
|-- hexagon-randconfig-r024-20220830
|   |-- drivers-usb-host-ehci-atmel.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-exynos.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-orion.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ehci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-spear.c:warning:unused-variable-hcd_name
|   `-- 
drivers-usb-host-ohci-platform.c:warning:unused-variable-hcd_name
|-- hexagon-randconfig-r036-20220830
|   |-- drivers-usb-host-ehci-atmel.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-npcm7xx.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ehci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ehci-st.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-at91.c:warning:unused-variable-hcd_name
|   |-- 
drivers-usb-host-ohci-platform.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-s3c2410.c:warning:unused-variable-hcd_name
|   |-- drivers-usb-host-ohci-spear.c:warning:unused-variable-hcd_name
|   `-- drivers-usb-host-ohci-st.c:warning:unused-variable-hcd_name
Quoted 3 lines

Yes, it has duplicates and your patch handles some of these. But there are others that still need to be fixed. Also, this list is missing ohci-pxa27x.c.

Ick, ok, I went off of a different kbuild report. Let me fix this up later today...

greg k-h