linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3 v2] media: dvb-usb: break long strings in dvb_usb_device_init
@ 2021-06-21 11:39 Dongliang Mu
  2021-07-13  8:52 ` Sean Young
  0 siblings, 1 reply; 3+ messages in thread
From: Dongliang Mu @ 2021-06-21 11:39 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Dongliang Mu, linux-media, linux-kernel

Break long strings into multiple lines.

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
 drivers/media/usb/dvb-usb/dvb-usb-init.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index 28e1fd64dd3c..edc477cedaa9 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -286,13 +286,15 @@ int dvb_usb_device_init(struct usb_interface *intf,
 
 	desc = dvb_usb_find_device(udev, &d->props, &cold);
 	if (!desc) {
-		deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n");
+		deb_err("something went very wrong, "
+			"device was not found in current device list.\n");
 		ret = -ENODEV;
 		goto error;
 	}
 
 	if (cold) {
-		info("found a '%s' in cold state, will try to load a firmware", desc->name);
+		info("found a %s in cold state, will try to load a firmware",
+		     desc->name);
 		ret = dvb_usb_download_firmware(udev, props);
 		if (!props->no_reconnect || ret != 0)
 			goto error;
@@ -314,7 +316,7 @@ int dvb_usb_device_init(struct usb_interface *intf,
 	if (du)
 		*du = d;
 
-	info("%s successfully initialized and connected.", desc->name);
+	info("%s is successfully initialized and connected.", desc->name);
 	return 0;
 
  error:
-- 
2.25.1


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

* Re: [PATCH 1/3 v2] media: dvb-usb: break long strings in dvb_usb_device_init
  2021-06-21 11:39 [PATCH 1/3 v2] media: dvb-usb: break long strings in dvb_usb_device_init Dongliang Mu
@ 2021-07-13  8:52 ` Sean Young
  2021-07-13 13:14   ` Dongliang Mu
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Young @ 2021-07-13  8:52 UTC (permalink / raw)
  To: Dongliang Mu; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

On Mon, Jun 21, 2021 at 07:39:59PM +0800, Dongliang Mu wrote:
> Break long strings into multiple lines.
> 
> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
> ---
>  drivers/media/usb/dvb-usb/dvb-usb-init.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> index 28e1fd64dd3c..edc477cedaa9 100644
> --- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
> +++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> @@ -286,13 +286,15 @@ int dvb_usb_device_init(struct usb_interface *intf,
>  
>  	desc = dvb_usb_find_device(udev, &d->props, &cold);
>  	if (!desc) {
> -		deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n");
> +		deb_err("something went very wrong, "
> +			"device was not found in current device list.\n");

Long lines are acceptable unto 100 columns or more if they are string
constants.  Breaking them up does not increase readability.

>  		ret = -ENODEV;
>  		goto error;
>  	}
>  
>  	if (cold) {
> -		info("found a '%s' in cold state, will try to load a firmware", desc->name);
> +		info("found a %s in cold state, will try to load a firmware",
> +		     desc->name);

No reason for removing the quotes, I think.

>  		ret = dvb_usb_download_firmware(udev, props);
>  		if (!props->no_reconnect || ret != 0)
>  			goto error;
> @@ -314,7 +316,7 @@ int dvb_usb_device_init(struct usb_interface *intf,
>  	if (du)
>  		*du = d;
>  
> -	info("%s successfully initialized and connected.", desc->name);
> +	info("%s is successfully initialized and connected.", desc->name);

"is" doesn't really add anything here, and the message is fine without it.

>  	return 0;
>  
>   error:
> -- 
> 2.25.1

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

* Re: [PATCH 1/3 v2] media: dvb-usb: break long strings in dvb_usb_device_init
  2021-07-13  8:52 ` Sean Young
@ 2021-07-13 13:14   ` Dongliang Mu
  0 siblings, 0 replies; 3+ messages in thread
From: Dongliang Mu @ 2021-07-13 13:14 UTC (permalink / raw)
  To: Sean Young; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

On Tue, Jul 13, 2021 at 4:53 PM Sean Young <sean@mess.org> wrote:
>
> On Mon, Jun 21, 2021 at 07:39:59PM +0800, Dongliang Mu wrote:
> > Break long strings into multiple lines.
> >
> > Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
> > ---
> >  drivers/media/usb/dvb-usb/dvb-usb-init.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> > index 28e1fd64dd3c..edc477cedaa9 100644
> > --- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
> > +++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
> > @@ -286,13 +286,15 @@ int dvb_usb_device_init(struct usb_interface *intf,
> >
> >       desc = dvb_usb_find_device(udev, &d->props, &cold);
> >       if (!desc) {
> > -             deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n");
> > +             deb_err("something went very wrong, "
> > +                     "device was not found in current device list.\n");
>
> Long lines are acceptable unto 100 columns or more if they are string
> constants.  Breaking them up does not increase readability.

I see. Thanks for your comments. They are valuable to me.

>
> >               ret = -ENODEV;
> >               goto error;
> >       }
> >
> >       if (cold) {
> > -             info("found a '%s' in cold state, will try to load a firmware", desc->name);
> > +             info("found a %s in cold state, will try to load a firmware",
> > +                  desc->name);
>
> No reason for removing the quotes, I think.
>
> >               ret = dvb_usb_download_firmware(udev, props);
> >               if (!props->no_reconnect || ret != 0)
> >                       goto error;
> > @@ -314,7 +316,7 @@ int dvb_usb_device_init(struct usb_interface *intf,
> >       if (du)
> >               *du = d;
> >
> > -     info("%s successfully initialized and connected.", desc->name);
> > +     info("%s is successfully initialized and connected.", desc->name);
>
> "is" doesn't really add anything here, and the message is fine without it.
>
> >       return 0;
> >
> >   error:
> > --
> > 2.25.1

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

end of thread, other threads:[~2021-07-13 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 11:39 [PATCH 1/3 v2] media: dvb-usb: break long strings in dvb_usb_device_init Dongliang Mu
2021-07-13  8:52 ` Sean Young
2021-07-13 13:14   ` Dongliang Mu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).