PCI: rpaphp: remove set but not used variable 'value'
PATCH 1/1 PCI: rpaphp: remove set but not used variable 'value'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In function is_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]
--- drivers/pci/hotplug/rpaphp_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/hotplug/rpaphp_core.c +1 -2
@@ -288,11 +288,10 @@ EXPORT_SYMBOL_GPL(rpaphp_check_drc_props);static int is_php_type (char *drc_type) { -unsigned long value;char *endptr;/* PCI Hotplug nodes have an integer for drc_type */ - value =simple_strtoul (drc_type, &endptr,10 ); +simple_strtoul (drc_type, &endptr,10 );if (endptr == drc_type)return 0 ;
Signature · 1 line
2.7.4
Quoted 8 lines · Chen Zhou
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In functionis_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]Reported-by Hulk Robot <[email protected]>Signed-off-by Chen Zhou <[email protected]>
Michael, if you want this:
If you don't mind, edit the subject to follow the convention, e.g.,
PCI: rpaphp: Remove unused variable 'value'
Apparently simple_strtoul() is deprecated and we're supposed to use kstrtoul() instead. Looks like kstrtoul() might simplify the code a little, too, e.g.,
if (kstrtoul(drc_type, 0, &value) == 0)
return 1;
return 0;
Quoted 24 lines
--- drivers/pci/hotplug/rpaphp_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pci/hotplug/rpaphp_core.c +1
-2@@ -288,11 +288,10 @@ EXPORT_SYMBOL_GPL(rpaphp_check_drc_props);static int is_php_type (char *drc_type) { -unsigned long value;char *endptr;/* PCI Hotplug nodes have an integer for drc_type */ - value =simple_strtoul (drc_type, &endptr,10 ); +simple_strtoul (drc_type, &endptr,10 );if (endptr == drc_type)return 0 ;Signature · 1 line
2.7.4
Quoted 18 lines · Bjorn Helgaas
Quoted 8 lines · Chen Zhou
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In functionis_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]Reported-by Hulk Robot <[email protected]>Signed-off-by Chen Zhou <[email protected]>Michael, if you want this:
Acked-by Bjorn Helgaas <[email protected]>If you don't mind, edit the subject to follow the convention, e.g.,
PCI: rpaphp: Remove unused variable 'value'
Quoted 8 lines
Apparently
simple_strtoul()is deprecated and we're supposed to usekstrtoul()instead. Looks likekstrtoul()might simplify the code a little, too, e.g.,if (
kstrtoul(drc_type, 0, &value)== 0)return 1;return 0;
I guess there are several other uses of simple_strtoul() in this file. Not sure if it's worth changing them all, just this one, or just the patch below as-is.
Quoted 24 lines
Quoted 24 lines
--- drivers/pci/hotplug/rpaphp_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pci/hotplug/rpaphp_core.c +1
-2@@ -288,11 +288,10 @@ EXPORT_SYMBOL_GPL(rpaphp_check_drc_props);static int is_php_type (char *drc_type) { -unsigned long value;char *endptr;/* PCI Hotplug nodes have an integer for drc_type */ - value =simple_strtoul (drc_type, &endptr,10 ); +simple_strtoul (drc_type, &endptr,10 );if (endptr == drc_type)return 0 ;Signature · 1 line
2.7.4
Tyrel Datwyler
maintainerQuoted 23 lines · Bjorn Helgaas
Quoted 22 lines · Bjorn Helgaas
Quoted 8 lines · Chen Zhou
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In functionis_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]Reported-by Hulk Robot <[email protected]>Signed-off-by Chen Zhou <[email protected]>Michael, if you want this:
Acked-by Bjorn Helgaas <[email protected]>If you don't mind, edit the subject to follow the convention, e.g.,
PCI: rpaphp: Remove unused variable 'value'
Apparently
simple_strtoul()is deprecated and we're supposed to usekstrtoul()instead. Looks likekstrtoul()might simplify the code a little, too, e.g.,
Quoted 8 lines
Quoted 4 lines
if (
kstrtoul(drc_type, 0, &value)== 0)return 1;return 0;
I guess there are several other uses of
simple_strtoul()in this file. Not sure if it's worth changing them all, just this one, or just the patch below as-is.
If we are going to change one might as well do them all at once. If the original submitter wants to send the follow up that is fine, or I can send a patch when I have a minute.
-Tyrel
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
--- drivers/pci/hotplug/rpaphp_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pci/hotplug/rpaphp_core.c +1
-2@@ -288,11 +288,10 @@ EXPORT_SYMBOL_GPL(rpaphp_check_drc_props);static int is_php_type (char *drc_type) { -unsigned long value;char *endptr;/* PCI Hotplug nodes have an integer for drc_type */ - value =simple_strtoul (drc_type, &endptr,10 ); +simple_strtoul (drc_type, &endptr,10 );if (endptr == drc_type)return 0 ;Signature · 1 line
2.7.4
Michael Ellerman
reviewerQuoted 23 lines · Bjorn Helgaas
Quoted 22 lines · Bjorn Helgaas
Quoted 8 lines · Chen Zhou
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In functionis_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]Reported-by Hulk Robot <[email protected]>Signed-off-by Chen Zhou <[email protected]>Michael, if you want this:
Acked-by Bjorn Helgaas <[email protected]>If you don't mind, edit the subject to follow the convention, e.g.,
PCI: rpaphp: Remove unused variable 'value'
Apparently
simple_strtoul()is deprecated and we're supposed to usekstrtoul()instead. Looks likekstrtoul()might simplify the code a little, too, e.g.,
Quoted 8 lines
Quoted 4 lines
if (
kstrtoul(drc_type, 0, &value)== 0)return 1;return 0;
I guess there are several other uses of
simple_strtoul()in this file. Not sure if it's worth changing them all, just this one, or just the patch below as-is.
I'll take this patch as-is, and someone can send a follow-up to convert the whole file to kstrtoul().
cheers
Michael Ellerman
AppliedQuoted 8 lines · Chen Zhou
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/pci/hotplug/rpaphp_core.c: In functionis_php_type:drivers/pci/hotplug/rpaphp_core.c:291:16: warning:
variable value set but not used [-Wunused-but-set-variable]Reported-by Hulk Robot <[email protected]>Signed-off-by Chen Zhou <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/9475af081ec1fb6cc794a17ae90f2c01aa8a7993
cheers