All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: quoted string split across lines
@ 2020-04-04  0:51 Gokce Kuler
  2020-04-04 23:31 ` [Outreachy kernel] " Stefano Brivio
  2020-04-05  7:15 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Gokce Kuler @ 2020-04-04  0:51 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: gregkh, elder, johan, mgreer, vaibhav.sr

Quoted string merge to upper line.

Signed-off-by: Gokce Kuler <gokcekuler@gmail.com>
---
 drivers/staging/greybus/audio_manager_sysfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
index ab882cc..d7216e9 100644
--- a/drivers/staging/greybus/audio_manager_sysfs.c
+++ b/drivers/staging/greybus/audio_manager_sysfs.c
@@ -18,8 +18,7 @@ static ssize_t manager_sysfs_add_store(struct kobject *kobj,
 	struct gb_audio_manager_module_descriptor desc = { {0} };
 
 	int num = sscanf(buf,
-			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
-			"vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
+			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
 			desc.name, &desc.vid, &desc.pid, &desc.intf_id,
 			&desc.ip_devices, &desc.op_devices);
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: greybus: quoted string split across lines
  2020-04-04  0:51 [PATCH] staging: greybus: quoted string split across lines Gokce Kuler
@ 2020-04-04 23:31 ` Stefano Brivio
  2020-04-05  7:15 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Brivio @ 2020-04-04 23:31 UTC (permalink / raw)
  To: Gokce Kuler; +Cc: outreachy-kernel, gregkh, elder, johan, mgreer, vaibhav.sr

Gökçe,

On Sat, 4 Apr 2020 03:51:22 +0300
Gokce Kuler <gokcekuler@gmail.com> wrote:

> Quoted string merge to upper line.
> 
> Signed-off-by: Gokce Kuler <gokcekuler@gmail.com>
> ---
>  drivers/staging/greybus/audio_manager_sysfs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
> index ab882cc..d7216e9 100644
> --- a/drivers/staging/greybus/audio_manager_sysfs.c
> +++ b/drivers/staging/greybus/audio_manager_sysfs.c
> @@ -18,8 +18,7 @@ static ssize_t manager_sysfs_add_store(struct kobject *kobj,
>  	struct gb_audio_manager_module_descriptor desc = { {0} };
>  
>  	int num = sscanf(buf,
> -			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
> -			"vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
> +			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",

Is this reported by...? checkpatch? Because I don't see the problem
with a sscanf().

That is, the rationale for keeping quoted strings unwrapped is that
they end up in kernel logs, and one might want to find the equivalent
point in the sources. But with a sscanf(), I'm not sure we need it.

-- 
Stefano



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: greybus: quoted string split across lines
  2020-04-04  0:51 [PATCH] staging: greybus: quoted string split across lines Gokce Kuler
  2020-04-04 23:31 ` [Outreachy kernel] " Stefano Brivio
@ 2020-04-05  7:15 ` Greg KH
  2020-04-06 10:15   ` Johan Hovold
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2020-04-05  7:15 UTC (permalink / raw)
  To: Gokce Kuler; +Cc: outreachy-kernel, elder, johan, mgreer, vaibhav.sr

On Sat, Apr 04, 2020 at 03:51:22AM +0300, Gokce Kuler wrote:
> Quoted string merge to upper line.
> 
> Signed-off-by: Gokce Kuler <gokcekuler@gmail.com>
> ---
>  drivers/staging/greybus/audio_manager_sysfs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
> index ab882cc..d7216e9 100644
> --- a/drivers/staging/greybus/audio_manager_sysfs.c
> +++ b/drivers/staging/greybus/audio_manager_sysfs.c
> @@ -18,8 +18,7 @@ static ssize_t manager_sysfs_add_store(struct kobject *kobj,
>  	struct gb_audio_manager_module_descriptor desc = { {0} };
>  
>  	int num = sscanf(buf,
> -			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
> -			"vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
> +			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",

No, try breaking this line by putting the "s " on the next line, so
there is only quoted string there.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: greybus: quoted string split across lines
  2020-04-05  7:15 ` Greg KH
@ 2020-04-06 10:15   ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2020-04-06 10:15 UTC (permalink / raw)
  To: Greg KH; +Cc: Gokce Kuler, outreachy-kernel, elder, johan, mgreer, vaibhav.sr

On Sun, Apr 05, 2020 at 09:15:17AM +0200, Greg Kroah-Hartman wrote:
> On Sat, Apr 04, 2020 at 03:51:22AM +0300, Gokce Kuler wrote:
> > Quoted string merge to upper line.
> > 
> > Signed-off-by: Gokce Kuler <gokcekuler@gmail.com>
> > ---
> >  drivers/staging/greybus/audio_manager_sysfs.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
> > index ab882cc..d7216e9 100644
> > --- a/drivers/staging/greybus/audio_manager_sysfs.c
> > +++ b/drivers/staging/greybus/audio_manager_sysfs.c
> > @@ -18,8 +18,7 @@ static ssize_t manager_sysfs_add_store(struct kobject *kobj,
> >  	struct gb_audio_manager_module_descriptor desc = { {0} };
> >  
> >  	int num = sscanf(buf,
> > -			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
> > -			"vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
> > +			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
> 
> No, try breaking this line by putting the "s " on the next line, so
> there is only quoted string there.

Not sure that would improve things; I'd say that "s " really does belong on the
same line as the "name=%" and field width define.

As Stefano pointed out, splitting a string like this isn't really an issue with
sscanf either.

I suggest we just leave this one as is.

Johan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-06 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04  0:51 [PATCH] staging: greybus: quoted string split across lines Gokce Kuler
2020-04-04 23:31 ` [Outreachy kernel] " Stefano Brivio
2020-04-05  7:15 ` Greg KH
2020-04-06 10:15   ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.