All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
@ 2018-10-06 19:21 Dafna Hirschfeld
  2018-10-06 23:03 ` [Outreachy kernel] " Sasha Levin
  2018-10-07 12:57 ` Helen Koike
  0 siblings, 2 replies; 7+ messages in thread
From: Dafna Hirschfeld @ 2018-10-06 19:21 UTC (permalink / raw)
  To: isely, mchehab, helen.koike, hverkuil
  Cc: outreachy-kernel, dafna3, Linux Media Mailing List

Replace calls to `printk` with the appropriate `pr_*`
macro.

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c      |  8 ++++----
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 14 ++++++--------
 drivers/media/usb/pvrusb2/pvrusb2-main.c     |  4 ++--
 drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |  4 ++--
 4 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index a8519da0020b..7702285c1519 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -3293,12 +3293,12 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
 	int nr = pvr2_hdw_get_unit_number(hdw);
 	LOCK_TAKE(hdw->big_lock);
 	do {
-		printk(KERN_INFO "pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
+		pr_info("pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
 		v4l2_device_call_all(&hdw->v4l2_dev, 0, core, log_status);
 		pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
 		cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
 		pvr2_hdw_state_log_state(hdw);
-		printk(KERN_INFO "pvrusb2: ==================  END STATUS CARD #%d  ==================\n", nr);
+		pr_info("pvrusb2: ==================  END STATUS CARD #%d  ==================\n", nr);
 	} while (0);
 	LOCK_GIVE(hdw->big_lock);
 }
@@ -4851,7 +4851,7 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *hdw)
 	for (idx = 0; ; idx++) {
 		ccnt = pvr2_hdw_report_unlocked(hdw,idx,buf,sizeof(buf));
 		if (!ccnt) break;
-		printk(KERN_INFO "%s %.*s\n",hdw->name,ccnt,buf);
+		pr_info("%s %.*s\n", hdw->name, ccnt, buf);
 	}
 	ccnt = pvr2_hdw_report_clients(hdw, buf, sizeof(buf));
 	if (ccnt >= sizeof(buf))
@@ -4863,7 +4863,7 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *hdw)
 		while ((lcnt + ucnt < ccnt) && (buf[lcnt + ucnt] != '\n')) {
 			lcnt++;
 		}
-		printk(KERN_INFO "%s %.*s\n", hdw->name, lcnt, buf + ucnt);
+		pr_info("%s %.*s\n", hdw->name, lcnt, buf + ucnt);
 		ucnt += lcnt + 1;
 	}
 }
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
index ec7d32759e39..06c7e875fa0f 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
@@ -478,8 +478,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
 		unsigned int idx,offs,cnt;
 		for (idx = 0; idx < num; idx++) {
 			cnt = msgs[idx].len;
-			printk(KERN_INFO
-			       "pvrusb2 i2c xfer %u/%u: addr=0x%x len=%d %s",
+			pr_info("pvrusb2 i2c xfer %u/%u: addr=0x%x len=%d %s",
 			       idx+1,num,
 			       msgs[idx].addr,
 			       cnt,
@@ -501,8 +500,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
 			printk(KERN_CONT "\n");
 		}
 		if (!num) {
-			printk(KERN_INFO
-			       "pvrusb2 i2c xfer null transfer result=%d\n",
+			pr_info("pvrusb2 i2c xfer null transfer result=%d\n",
 			       ret);
 		}
 	}
@@ -542,14 +540,14 @@ static int do_i2c_probe(struct pvr2_hdw *hdw, int addr)
 static void do_i2c_scan(struct pvr2_hdw *hdw)
 {
 	int i;
-	printk(KERN_INFO "%s: i2c scan beginning\n", hdw->name);
+	pr_info("%s: i2c scan beginning\n", hdw->name);
 	for (i = 0; i < 128; i++) {
 		if (do_i2c_probe(hdw, i)) {
-			printk(KERN_INFO "%s: i2c scan: found device @ 0x%x\n",
+			pr_info("%s: i2c scan: found device @ 0x%x\n",
 			       hdw->name, i);
 		}
 	}
-	printk(KERN_INFO "%s: i2c scan done.\n", hdw->name);
+	pr_info("%s: i2c scan done.\n", hdw->name);
 }
 
 static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
@@ -612,7 +610,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
 
 	/* However, deal with various special cases for 24xxx hardware. */
 	if (ir_mode[hdw->unit_number] == 0) {
-		printk(KERN_INFO "%s: IR disabled\n",hdw->name);
+		pr_info("%s: IR disabled\n", hdw->name);
 		hdw->i2c_func[0x18] = i2c_black_hole;
 	} else if (ir_mode[hdw->unit_number] == 1) {
 		if (hdw->ir_scheme_active == PVR2_IR_SCHEME_24XXX) {
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-main.c b/drivers/media/usb/pvrusb2/pvrusb2-main.c
index cbe2c3a22458..23672dd352f5 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-main.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-main.c
@@ -132,10 +132,10 @@ static int __init pvr_init(void)
 	ret = usb_register(&pvr_driver);
 
 	if (ret == 0)
-		printk(KERN_INFO "pvrusb2: " DRIVER_VERSION ":"
+		pr_info("pvrusb2: " DRIVER_VERSION ":"
 		       DRIVER_DESC "\n");
 	if (pvrusb2_debug)
-		printk(KERN_INFO "pvrusb2: Debug mask is %d (0x%x)\n",
+		pr_info("pvrusb2: Debug mask is %d (0x%x)\n",
 		       pvrusb2_debug,pvrusb2_debug);
 
 	pvr2_trace(PVR2_TRACE_INIT,"pvr_init complete");
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index cea232a3302d..97a93ed4bcda 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -869,7 +869,7 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 	   are gone. */
 	video_unregister_device(&dip->devbase);
 
-	printk(KERN_INFO "%s\n", msg);
+	pr_info("%s\n", msg);
 
 }
 
@@ -1260,7 +1260,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
 			": Failed to register pvrusb2 v4l device\n");
 	}
 
-	printk(KERN_INFO "pvrusb2: registered device %s [%s]\n",
+	pr_info("pvrusb2: registered device %s [%s]\n",
 	       video_device_node_name(&dip->devbase),
 	       pvr2_config_get_name(dip->config));
 
-- 
2.17.1



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

* Re: [Outreachy kernel] [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-06 19:21 [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*` Dafna Hirschfeld
@ 2018-10-06 23:03 ` Sasha Levin
  2018-10-07  8:27   ` Hans Verkuil
  2018-10-07 12:57 ` Helen Koike
  1 sibling, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2018-10-06 23:03 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: isely, mchehab, helen.koike, hverkuil, outreachy-kernel,
	Linux Media Mailing List

On Sat, Oct 06, 2018 at 10:21:38PM +0300, Dafna Hirschfeld wrote:
>Replace calls to `printk` with the appropriate `pr_*`
>macro.

Hi Dafna,

I'd encourage you to look into the dev_ family of print functions (such
as dev_info() ). They can avoid having to repeat the driver name in
every print call.

--
Thanks,
Sasha


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

* Re: [Outreachy kernel] [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-06 23:03 ` [Outreachy kernel] " Sasha Levin
@ 2018-10-07  8:27   ` Hans Verkuil
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Verkuil @ 2018-10-07  8:27 UTC (permalink / raw)
  To: Sasha Levin, Dafna Hirschfeld
  Cc: isely, mchehab, helen.koike, outreachy-kernel, Linux Media Mailing List

On 10/07/2018 01:03 AM, Sasha Levin wrote:
> On Sat, Oct 06, 2018 at 10:21:38PM +0300, Dafna Hirschfeld wrote:
>> Replace calls to `printk` with the appropriate `pr_*`
>> macro.
> 
> Hi Dafna,
> 
> I'd encourage you to look into the dev_ family of print functions (such
> as dev_info() ). They can avoid having to repeat the driver name in
> every print call.

Not for this driver. The hdw->name is the right prefix to use and the code
already uses it.

For almost any other media driver Sasha would be right, just not this one
due to historical reasons.

Regards,

	Hans


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

* Re: [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-06 19:21 [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*` Dafna Hirschfeld
  2018-10-06 23:03 ` [Outreachy kernel] " Sasha Levin
@ 2018-10-07 12:57 ` Helen Koike
  1 sibling, 0 replies; 7+ messages in thread
From: Helen Koike @ 2018-10-07 12:57 UTC (permalink / raw)
  To: Dafna Hirschfeld, isely, mchehab, hverkuil
  Cc: outreachy-kernel, Linux Media Mailing List

Hi Dafna,

Thanks for you patch.

On 10/6/18 4:21 PM, Dafna Hirschfeld wrote:
> Replace calls to `printk` with the appropriate `pr_*`
> macro.
> 
> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c      |  8 ++++----
>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 14 ++++++--------
>  drivers/media/usb/pvrusb2/pvrusb2-main.c     |  4 ++--
>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |  4 ++--

Could you also update drivers/media/usb/pvrusb2/pvrusb2-debug.h please?
So we can get rid of all the printk in this driver.

>  4 files changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index a8519da0020b..7702285c1519 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -3293,12 +3293,12 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
>  	int nr = pvr2_hdw_get_unit_number(hdw);
>  	LOCK_TAKE(hdw->big_lock);
>  	do {
> -		printk(KERN_INFO "pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
> +		pr_info("pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
>  		v4l2_device_call_all(&hdw->v4l2_dev, 0, core, log_status);
>  		pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
>  		cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
>  		pvr2_hdw_state_log_state(hdw);
> -		printk(KERN_INFO "pvrusb2: ==================  END STATUS CARD #%d  ==================\n", nr);
> +		pr_info("pvrusb2: ==================  END STATUS CARD #%d  ==================\n", nr);
>  	} while (0);
>  	LOCK_GIVE(hdw->big_lock);
>  }
> @@ -4851,7 +4851,7 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *hdw)
>  	for (idx = 0; ; idx++) {
>  		ccnt = pvr2_hdw_report_unlocked(hdw,idx,buf,sizeof(buf));
>  		if (!ccnt) break;
> -		printk(KERN_INFO "%s %.*s\n",hdw->name,ccnt,buf);
> +		pr_info("%s %.*s\n", hdw->name, ccnt, buf);
>  	}
>  	ccnt = pvr2_hdw_report_clients(hdw, buf, sizeof(buf));
>  	if (ccnt >= sizeof(buf))
> @@ -4863,7 +4863,7 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *hdw)
>  		while ((lcnt + ucnt < ccnt) && (buf[lcnt + ucnt] != '\n')) {
>  			lcnt++;
>  		}
> -		printk(KERN_INFO "%s %.*s\n", hdw->name, lcnt, buf + ucnt);
> +		pr_info("%s %.*s\n", hdw->name, lcnt, buf + ucnt);
>  		ucnt += lcnt + 1;
>  	}
>  }> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> index ec7d32759e39..06c7e875fa0f 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> @@ -478,8 +478,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
>  		unsigned int idx,offs,cnt;
>  		for (idx = 0; idx < num; idx++) {
>  			cnt = msgs[idx].len;
> -			printk(KERN_INFO
> -			       "pvrusb2 i2c xfer %u/%u: addr=0x%x len=%d %s",
> +			pr_info("pvrusb2 i2c xfer %u/%u: addr=0x%x len=%d %s",
>  			       idx+1,num,
>  			       msgs[idx].addr,
>  			       cnt,
> @@ -501,8 +500,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
>  			printk(KERN_CONT "\n");
>  		}
>  		if (!num) {
> -			printk(KERN_INFO
> -			       "pvrusb2 i2c xfer null transfer result=%d\n",
> +			pr_info("pvrusb2 i2c xfer null transfer result=%d\n",
>  			       ret);
>  		}
>  	}
> @@ -542,14 +540,14 @@ static int do_i2c_probe(struct pvr2_hdw *hdw, int addr)
>  static void do_i2c_scan(struct pvr2_hdw *hdw)
>  {
>  	int i;
> -	printk(KERN_INFO "%s: i2c scan beginning\n", hdw->name);
> +	pr_info("%s: i2c scan beginning\n", hdw->name);
>  	for (i = 0; i < 128; i++) {
>  		if (do_i2c_probe(hdw, i)) {
> -			printk(KERN_INFO "%s: i2c scan: found device @ 0x%x\n",
> +			pr_info("%s: i2c scan: found device @ 0x%x\n",
>  			       hdw->name, i);
>  		}
>  	}
> -	printk(KERN_INFO "%s: i2c scan done.\n", hdw->name);
> +	pr_info("%s: i2c scan done.\n", hdw->name);
>  }
>  
>  static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
> @@ -612,7 +610,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
>  
>  	/* However, deal with various special cases for 24xxx hardware. */
>  	if (ir_mode[hdw->unit_number] == 0) {
> -		printk(KERN_INFO "%s: IR disabled\n",hdw->name);
> +		pr_info("%s: IR disabled\n", hdw->name);
>  		hdw->i2c_func[0x18] = i2c_black_hole;
>  	} else if (ir_mode[hdw->unit_number] == 1) {
>  		if (hdw->ir_scheme_active == PVR2_IR_SCHEME_24XXX) {

This file has some printk(KERN_CONT, I believe you can also change it to
pr_cont.

> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-main.c b/drivers/media/usb/pvrusb2/pvrusb2-main.c
> index cbe2c3a22458..23672dd352f5 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-main.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-main.c
> @@ -132,10 +132,10 @@ static int __init pvr_init(void)
>  	ret = usb_register(&pvr_driver);
>  
>  	if (ret == 0)
> -		printk(KERN_INFO "pvrusb2: " DRIVER_VERSION ":"
> +		pr_info("pvrusb2: " DRIVER_VERSION ":"
>  		       DRIVER_DESC "\n");
>  	if (pvrusb2_debug)
> -		printk(KERN_INFO "pvrusb2: Debug mask is %d (0x%x)\n",
> +		pr_info("pvrusb2: Debug mask is %d (0x%x)\n",
>  		       pvrusb2_debug,pvrusb2_debug);
>  
>  	pvr2_trace(PVR2_TRACE_INIT,"pvr_init complete");
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index cea232a3302d..97a93ed4bcda 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -869,7 +869,7 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
>  	   are gone. */
>  	video_unregister_device(&dip->devbase);
>  
> -	printk(KERN_INFO "%s\n", msg);
> +	pr_info("%s\n", msg);
>  
>  }
>  
> @@ -1260,7 +1260,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
>  			": Failed to register pvrusb2 v4l device\n");
>  	}
>  
> -	printk(KERN_INFO "pvrusb2: registered device %s [%s]\n",
> +	pr_info("pvrusb2: registered device %s [%s]\n",
>  	       video_device_node_name(&dip->devbase),
>  	       pvr2_config_get_name(dip->config));
>  
> 


Thanks
Helen


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

* Re: [Outreachy kernel] [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-08 13:29   ` Hans Verkuil
@ 2018-10-08 13:52     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2018-10-08 13:52 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Dafna Hirschfeld, isely, mchehab, helen.koike, outreachy-kernel,
	Linux Media Mailing List

On Mon, Oct 08, 2018 at 03:29:03PM +0200, Hans Verkuil wrote:
> On 10/08/2018 03:07 PM, Greg KH wrote:
> > On Mon, Oct 08, 2018 at 03:06:47PM +0300, Dafna Hirschfeld wrote:
> >> Replace calls to `printk` with the appropriate `pr_*`
> >> macro.
> >>
> >> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> >> ---
> >>  drivers/media/usb/pvrusb2/pvrusb2-debug.h    |  2 +-
> >>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c      |  8 +++---
> >>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 28 +++++++++-----------
> >>  drivers/media/usb/pvrusb2/pvrusb2-main.c     |  4 +--
> >>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |  4 +--
> >>  5 files changed, 22 insertions(+), 24 deletions(-)
> >>
> >> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-debug.h b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> >> index 5cd16292e2fa..1323f949f454 100644
> >> --- a/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> >> +++ b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> >> @@ -17,7 +17,7 @@
> >>  
> >>  extern int pvrusb2_debug;
> >>  
> >> -#define pvr2_trace(msk, fmt, arg...) do {if(msk & pvrusb2_debug) printk(KERN_INFO "pvrusb2: " fmt "\n", ##arg); } while (0)
> >> +#define pvr2_trace(msk, fmt, arg...) do {if (msk & pvrusb2_debug) pr_info("pvrusb2: " fmt "\n", ##arg); } while (0)
> > 
> > You should not need prefixes for pr_info() calls.
> > 
> >>  
> >>  /* These are listed in *rough* order of decreasing usefulness and
> >>     increasing noise level. */
> >> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> >> index a8519da0020b..7702285c1519 100644
> >> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> >> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> >> @@ -3293,12 +3293,12 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
> >>  	int nr = pvr2_hdw_get_unit_number(hdw);
> >>  	LOCK_TAKE(hdw->big_lock);
> >>  	do {
> >> -		printk(KERN_INFO "pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
> >> +		pr_info("pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
> > 
> > A driver should be using dev_info(), not pr_*.
> 
> pvrusb2 is an exception due to historical reasons. I'd rather not switch
> over to dev_*.

Why should a historical reason be needed to fix up code to be correct?

Why not use the correct functions?  You will just constantly be
rejecting patches like this for the next 20+ years :(

thanks,

greg k-h


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

* Re: [Outreachy kernel] [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-08 13:07 ` [Outreachy kernel] " Greg KH
@ 2018-10-08 13:29   ` Hans Verkuil
  2018-10-08 13:52     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2018-10-08 13:29 UTC (permalink / raw)
  To: Greg KH, Dafna Hirschfeld
  Cc: isely, mchehab, helen.koike, outreachy-kernel, Linux Media Mailing List

On 10/08/2018 03:07 PM, Greg KH wrote:
> On Mon, Oct 08, 2018 at 03:06:47PM +0300, Dafna Hirschfeld wrote:
>> Replace calls to `printk` with the appropriate `pr_*`
>> macro.
>>
>> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
>> ---
>>  drivers/media/usb/pvrusb2/pvrusb2-debug.h    |  2 +-
>>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c      |  8 +++---
>>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 28 +++++++++-----------
>>  drivers/media/usb/pvrusb2/pvrusb2-main.c     |  4 +--
>>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |  4 +--
>>  5 files changed, 22 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-debug.h b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
>> index 5cd16292e2fa..1323f949f454 100644
>> --- a/drivers/media/usb/pvrusb2/pvrusb2-debug.h
>> +++ b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
>> @@ -17,7 +17,7 @@
>>  
>>  extern int pvrusb2_debug;
>>  
>> -#define pvr2_trace(msk, fmt, arg...) do {if(msk & pvrusb2_debug) printk(KERN_INFO "pvrusb2: " fmt "\n", ##arg); } while (0)
>> +#define pvr2_trace(msk, fmt, arg...) do {if (msk & pvrusb2_debug) pr_info("pvrusb2: " fmt "\n", ##arg); } while (0)
> 
> You should not need prefixes for pr_info() calls.
> 
>>  
>>  /* These are listed in *rough* order of decreasing usefulness and
>>     increasing noise level. */
>> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
>> index a8519da0020b..7702285c1519 100644
>> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
>> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
>> @@ -3293,12 +3293,12 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
>>  	int nr = pvr2_hdw_get_unit_number(hdw);
>>  	LOCK_TAKE(hdw->big_lock);
>>  	do {
>> -		printk(KERN_INFO "pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
>> +		pr_info("pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
> 
> A driver should be using dev_info(), not pr_*.

pvrusb2 is an exception due to historical reasons. I'd rather not switch
over to dev_*.

> 
> Also, for the outreachy application process, I can not accept patches
> outside of drivers/staging/.

Hmm, that means media drivers are out of bounds since drivers in staging/media
are either high-quality drivers waiting for missing core features or that need maturing,
or they are deprecated drivers that will be removed in the not-too-distant future and
we're not accepting patches for those.

Whereas there are loads of old media drivers in driver/media that could use some TLC.
Although pvrusb2 was an unfortunate driver to pick, but Dafna had no way of knowing that.

There might be the odd checkpatch issue in staging/media, but I expect that that will be
slim pickings...

Sorry Dafna, I wasn't aware of this restriction. It looks like you will need to look
elsewhere in staging.

Regards,

	Hans

> 
> sorry,
> 
> greg k-h
> 



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

* Re: [Outreachy kernel] [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*`
  2018-10-08 12:06 Dafna Hirschfeld
@ 2018-10-08 13:07 ` Greg KH
  2018-10-08 13:29   ` Hans Verkuil
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2018-10-08 13:07 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: isely, mchehab, helen.koike, hverkuil, outreachy-kernel,
	Linux Media Mailing List

On Mon, Oct 08, 2018 at 03:06:47PM +0300, Dafna Hirschfeld wrote:
> Replace calls to `printk` with the appropriate `pr_*`
> macro.
> 
> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-debug.h    |  2 +-
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c      |  8 +++---
>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 28 +++++++++-----------
>  drivers/media/usb/pvrusb2/pvrusb2-main.c     |  4 +--
>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |  4 +--
>  5 files changed, 22 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-debug.h b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> index 5cd16292e2fa..1323f949f454 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-debug.h
> @@ -17,7 +17,7 @@
>  
>  extern int pvrusb2_debug;
>  
> -#define pvr2_trace(msk, fmt, arg...) do {if(msk & pvrusb2_debug) printk(KERN_INFO "pvrusb2: " fmt "\n", ##arg); } while (0)
> +#define pvr2_trace(msk, fmt, arg...) do {if (msk & pvrusb2_debug) pr_info("pvrusb2: " fmt "\n", ##arg); } while (0)

You should not need prefixes for pr_info() calls.

>  
>  /* These are listed in *rough* order of decreasing usefulness and
>     increasing noise level. */
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index a8519da0020b..7702285c1519 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -3293,12 +3293,12 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
>  	int nr = pvr2_hdw_get_unit_number(hdw);
>  	LOCK_TAKE(hdw->big_lock);
>  	do {
> -		printk(KERN_INFO "pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);
> +		pr_info("pvrusb2: =================  START STATUS CARD #%d  =================\n", nr);

A driver should be using dev_info(), not pr_*.

Also, for the outreachy application process, I can not accept patches
outside of drivers/staging/.

sorry,

greg k-h


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

end of thread, other threads:[~2018-10-08 14:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-06 19:21 [PATCH vicodec] media: pvrusb2: replace `printk` with `pr_*` Dafna Hirschfeld
2018-10-06 23:03 ` [Outreachy kernel] " Sasha Levin
2018-10-07  8:27   ` Hans Verkuil
2018-10-07 12:57 ` Helen Koike
2018-10-08 12:06 Dafna Hirschfeld
2018-10-08 13:07 ` [Outreachy kernel] " Greg KH
2018-10-08 13:29   ` Hans Verkuil
2018-10-08 13:52     ` Greg KH

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.