PNP: make pnp_eisa_id_to_string() take __be32 id
Subsystems (2)
PATCH 1/1 PNP: make pnp_eisa_id_to_string() take __be32 id
The pnp_eisa_id_to_string() should take a __be32 id as it passes it immediately to be32_to_cpu(). Change the type of this to fix the following sparse warning:
drivers/pnp/support.c:42:14: warning: cast to restricted __be32
--- drivers/pnp/base.h | 2 +- drivers/pnp/support.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/pnp/base.h +1 -1
@@ -11,7 +11,7 @@ extern const struct bus_type pnp_bus_type;int pnp_register_protocol (struct pnp_protocol *protocol);#define PNP_EISA_ID_MASK 0x7fffffff -void pnp_eisa_id_to_string (u32 id,char *str); +void pnp_eisa_id_to_string (__be32 id,char *str);struct pnp_dev *pnp_alloc_dev (struct pnp_protocol *,int id,const char *pnpid);struct pnp_card *pnp_alloc_card (struct pnp_protocol *,int id,char *pnpid);
drivers/pnp/support.c +2 -2
@@ -37,9 +37,9 @@ EXPORT_SYMBOL(pnp_is_active);* Functionally similar to acpi_ex_eisa_id_to_string(), but that's * buried in the ACPI CA, and we can't depend on it being present. */ -void pnp_eisa_id_to_string (u32 id,char *str) +void pnp_eisa_id_to_string (__be32 _id,char *str) { - id =be32_to_cpu (id); +u32 id =be32_to_cpu (_id);/* * According to the specs, the first three characters are five-bit
Signature · 1 line
2.37.2.352.g3c44437643
Quoted 33 lines · Ben Dooks
The
pnp_eisa_id_to_string()should take a__be32id as it passes it immediately tobe32_to_cpu(). Change the type of this to fix the following sparse warning:
drivers/pnp/support.c:42:14: warning: cast to restricted__be32Signed-off-by Ben Dooks <[email protected]>--- drivers/pnp/base.h | 2 +- drivers/pnp/support.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/pnp/base.h +1
-1@@ -11,7 +11,7 @@ extern const struct bus_type pnp_bus_type;int pnp_register_protocol (struct pnp_protocol *protocol);#define PNP_EISA_ID_MASK 0x7fffffff -void pnp_eisa_id_to_string (u32 id,char *str); +void pnp_eisa_id_to_string (__be32 id,char *str);struct pnp_dev *pnp_alloc_dev (struct pnp_protocol *,int id,const char *pnpid);struct pnp_card *pnp_alloc_card (struct pnp_protocol *,int id,char *pnpid);drivers/pnp/support.c +0
-0@@ -37,9 +37,9 @@ EXPORT_SYMBOL(pnp_is_active);* Functionally similar to acpi_ex_eisa_id_to_string(), but that's * buried in the ACPI CA, and we can't depend on it being present.
drivers/pnp/support.c EXPORT_SYMBOL(pnp_is_active);
Quoted 10 lines
drivers/pnp/support.c +2
-3*/ -void pnp_eisa_id_to_string (u32 id,char *str) +void pnp_eisa_id_to_string (__be32 _id,char *str) { - id =be32_to_cpu (id); +u32 id =be32_to_cpu (_id);/* * According to the specs, the first three characters are five-bit --
Applied as 7.2-rc material, thanks!
Rafael J. Wysocki
maintainerQuoted 42 lines · Rafael J. Wysocki
Quoted 40 lines · Ben Dooks
The
pnp_eisa_id_to_string()should take a__be32id as it passes it immediately tobe32_to_cpu(). Change the type of this to fix the following sparse warning:
drivers/pnp/support.c:42:14: warning: cast to restricted__be32Signed-off-by Ben Dooks <[email protected]>--- drivers/pnp/base.h | 2 +- drivers/pnp/support.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/pnp/base.h +1
-1@@ -11,7 +11,7 @@ extern const struct bus_type pnp_bus_type;int pnp_register_protocol (struct pnp_protocol *protocol);#define PNP_EISA_ID_MASK 0x7fffffff -void pnp_eisa_id_to_string (u32 id,char *str); +void pnp_eisa_id_to_string (__be32 id,char *str);struct pnp_dev *pnp_alloc_dev (struct pnp_protocol *,int id,const char *pnpid);struct pnp_card *pnp_alloc_card (struct pnp_protocol *,int id,char *pnpid);drivers/pnp/support.c +2
-2@@ -37,9 +37,9 @@ EXPORT_SYMBOL(pnp_is_active);* Functionally similar to acpi_ex_eisa_id_to_string(), but that's * buried in the ACPI CA, and we can't depend on it being present. */ -void pnp_eisa_id_to_string (u32 id,char *str) +void pnp_eisa_id_to_string (__be32 _id,char *str) { - id =be32_to_cpu (id); +u32 id =be32_to_cpu (_id);
Quoted 5 lines
drivers/pnp/support.c EXPORT_SYMBOL(pnp_is_active);
Quoted 3 lines
drivers/pnp/support.c +0
-1/* * According to the specs, the first three characters are five-bit -- Applied as 7.2-rc material, thanks!
And dropped because it causes sparse to complain: