Re: [PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-12-06 Thread Rafael J. Wysocki
On Thu, Dec 6, 2018 at 3:57 PM Greg Kroah-Hartman
 wrote:
>
> On Thu, Nov 29, 2018 at 06:08:44PM +, Colin King wrote:
> > From: Colin Ian King 
> >
> > Currently the node name is being formatting into a temporary string
> > node_name, however, kobject_init_and_add allows one to format up
> > a node name, so use that instead. This removes the need for the
> > node_name string and also cleans up the following warning:
> >
> > Fixes clang warning:
> > warning: format string is not a string literal (potentially
> > insecure) [-Wformat-security]
> >
> > Signed-off-by: Colin Ian King 
> > ---
> >  drivers/base/swnode.c | 5 +
>
> I don't know where this file comes from.  It's not in my
> driver-core-next branch, who is creating it?

It is in my linux-next one, comes from a series of device properties
patches by Heikki (CCed to you).

This is the patch adding it: https://patchwork.kernel.org/patch/10676063/

So Colin, please resend and CC linux-a...@vger.kernel.org.


Re: [PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-12-06 Thread Rafael J. Wysocki
On Thu, Dec 6, 2018 at 3:57 PM Greg Kroah-Hartman
 wrote:
>
> On Thu, Nov 29, 2018 at 06:08:44PM +, Colin King wrote:
> > From: Colin Ian King 
> >
> > Currently the node name is being formatting into a temporary string
> > node_name, however, kobject_init_and_add allows one to format up
> > a node name, so use that instead. This removes the need for the
> > node_name string and also cleans up the following warning:
> >
> > Fixes clang warning:
> > warning: format string is not a string literal (potentially
> > insecure) [-Wformat-security]
> >
> > Signed-off-by: Colin Ian King 
> > ---
> >  drivers/base/swnode.c | 5 +
>
> I don't know where this file comes from.  It's not in my
> driver-core-next branch, who is creating it?

It is in my linux-next one, comes from a series of device properties
patches by Heikki (CCed to you).

This is the patch adding it: https://patchwork.kernel.org/patch/10676063/

So Colin, please resend and CC linux-a...@vger.kernel.org.


Re: [PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-12-06 Thread Greg Kroah-Hartman
On Thu, Nov 29, 2018 at 06:08:44PM +, Colin King wrote:
> From: Colin Ian King 
> 
> Currently the node name is being formatting into a temporary string
> node_name, however, kobject_init_and_add allows one to format up
> a node name, so use that instead. This removes the need for the
> node_name string and also cleans up the following warning:
> 
> Fixes clang warning:
> warning: format string is not a string literal (potentially
> insecure) [-Wformat-security]
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/base/swnode.c | 5 +

I don't know where this file comes from.  It's not in my
driver-core-next branch, who is creating it?

thanks,

greg k-h


Re: [PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-12-06 Thread Greg Kroah-Hartman
On Thu, Nov 29, 2018 at 06:08:44PM +, Colin King wrote:
> From: Colin Ian King 
> 
> Currently the node name is being formatting into a temporary string
> node_name, however, kobject_init_and_add allows one to format up
> a node name, so use that instead. This removes the need for the
> node_name string and also cleans up the following warning:
> 
> Fixes clang warning:
> warning: format string is not a string literal (potentially
> insecure) [-Wformat-security]
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/base/swnode.c | 5 +

I don't know where this file comes from.  It's not in my
driver-core-next branch, who is creating it?

thanks,

greg k-h


[PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-11-29 Thread Colin King
From: Colin Ian King 

Currently the node name is being formatting into a temporary string
node_name, however, kobject_init_and_add allows one to format up
a node name, so use that instead. This removes the need for the
node_name string and also cleans up the following warning:

Fixes clang warning:
warning: format string is not a string literal (potentially
insecure) [-Wformat-security]

Signed-off-by: Colin Ian King 
---
 drivers/base/swnode.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 9c63ec8d8ab4..306bb93287af 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -553,7 +553,6 @@ fwnode_create_software_node(const struct property_entry 
*properties,
 {
struct software_node *p = NULL;
struct software_node *swnode;
-   char node_name[20];
int ret;
 
if (parent) {
@@ -576,8 +575,6 @@ fwnode_create_software_node(const struct property_entry 
*properties,
}
 
swnode->id = ret;
-   sprintf(node_name, "node%d", swnode->id);
-
swnode->kobj.kset = swnode_kset;
swnode->fwnode.ops = _node_ops;
 
@@ -590,7 +587,7 @@ fwnode_create_software_node(const struct property_entry 
*properties,
list_add_tail(>entry, >children);
 
ret = kobject_init_and_add(>kobj, _node_type,
-  p ? >kobj : NULL, node_name);
+  p ? >kobj : NULL, "node%d", swnode->id);
if (ret) {
kobject_put(>kobj);
return ERR_PTR(ret);
-- 
2.19.1



[PATCH][next] drivers: base: remove need for a temporary string for the node name

2018-11-29 Thread Colin King
From: Colin Ian King 

Currently the node name is being formatting into a temporary string
node_name, however, kobject_init_and_add allows one to format up
a node name, so use that instead. This removes the need for the
node_name string and also cleans up the following warning:

Fixes clang warning:
warning: format string is not a string literal (potentially
insecure) [-Wformat-security]

Signed-off-by: Colin Ian King 
---
 drivers/base/swnode.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 9c63ec8d8ab4..306bb93287af 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -553,7 +553,6 @@ fwnode_create_software_node(const struct property_entry 
*properties,
 {
struct software_node *p = NULL;
struct software_node *swnode;
-   char node_name[20];
int ret;
 
if (parent) {
@@ -576,8 +575,6 @@ fwnode_create_software_node(const struct property_entry 
*properties,
}
 
swnode->id = ret;
-   sprintf(node_name, "node%d", swnode->id);
-
swnode->kobj.kset = swnode_kset;
swnode->fwnode.ops = _node_ops;
 
@@ -590,7 +587,7 @@ fwnode_create_software_node(const struct property_entry 
*properties,
list_add_tail(>entry, >children);
 
ret = kobject_init_and_add(>kobj, _node_type,
-  p ? >kobj : NULL, node_name);
+  p ? >kobj : NULL, "node%d", swnode->id);
if (ret) {
kobject_put(>kobj);
return ERR_PTR(ret);
-- 
2.19.1