Message ID | 20170124122908.13950-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 2017-01-24 08:29 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > prop_string is initialized to NULL and then re-assigned immediately > afterwards. Remove the redundant initialization. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/opal/cpu_info.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c > index 1d5ec3c..22cccbf 100644 > --- a/src/opal/cpu_info.c > +++ b/src/opal/cpu_info.c > @@ -34,9 +34,8 @@ static int get_xscom_property(fwts_framework *fw, > { > int node, prop_len, failures = 0; > const char *prop_buf; > - char *prop_string = NULL; > + char *prop_string = strstr(my_path, "/xscom"); > > - prop_string = strstr(my_path, "/xscom"); > if (prop_string) { > node = fdt_path_offset(fw->fdt, prop_string); > if (node >= 0) { > Acked-by: Alex Hung <alex.hung@canonical.com>
On 2017年01月24日 20:29, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > prop_string is initialized to NULL and then re-assigned immediately > afterwards. Remove the redundant initialization. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/opal/cpu_info.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c > index 1d5ec3c..22cccbf 100644 > --- a/src/opal/cpu_info.c > +++ b/src/opal/cpu_info.c > @@ -34,9 +34,8 @@ static int get_xscom_property(fwts_framework *fw, > { > int node, prop_len, failures = 0; > const char *prop_buf; > - char *prop_string = NULL; > + char *prop_string = strstr(my_path, "/xscom"); > > - prop_string = strstr(my_path, "/xscom"); > if (prop_string) { > node = fdt_path_offset(fw->fdt, prop_string); > if (node >= 0) { > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c index 1d5ec3c..22cccbf 100644 --- a/src/opal/cpu_info.c +++ b/src/opal/cpu_info.c @@ -34,9 +34,8 @@ static int get_xscom_property(fwts_framework *fw, { int node, prop_len, failures = 0; const char *prop_buf; - char *prop_string = NULL; + char *prop_string = strstr(my_path, "/xscom"); - prop_string = strstr(my_path, "/xscom"); if (prop_string) { node = fdt_path_offset(fw->fdt, prop_string); if (node >= 0) {