All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
@ 2015-02-17 20:18 Ksenija Stanojevic
  2015-02-17 21:27 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojevic @ 2015-02-17 20:18 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ksenija Stanojevic

Making variants of existing macros is against kernel coding style. This
patch removes all definitions made by macro dprinkt() and replaces them
with dev_dbg().

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
 drivers/staging/media/vino/saa7191.c | 58 ++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/media/vino/saa7191.c b/drivers/staging/media/vino/saa7191.c
index 087acab..2aa68c6 100644
--- a/drivers/staging/media/vino/saa7191.c
+++ b/drivers/staging/media/vino/saa7191.c
@@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
 MODULE_LICENSE("GPL");
 
 
-/* #define SAA7191_DEBUG */
 
-#ifdef SAA7191_DEBUG
-#define dprintk(x...) printk("SAA7191: " x);
-#else
-#define dprintk(x...)
-#endif
 
 #define SAA7191_SYNC_COUNT	30
 #define SAA7191_SYNC_DELAY	100	/* milliseconds */
@@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev *sd, u8 *value)
 
 	ret = i2c_master_recv(client, value, 1);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed\n");
+		dev_dbg("saa7191_read_status(): read failed\n");
 		return ret;
 	}
 
@@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev *sd,
 
 	ret = i2c_master_send(client, data, length);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
+		dev_dbg("saa7191_write_block(): "
 		       "write failed\n");
 		return ret;
 	}
@@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
 
 	decoder->norm = norm;
 
-	dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
+	dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
 		stdc, chcv);
-	dprintk("norm: %llx\n", norm);
+	dev_dbg("norm: %llx\n", norm);
 
 	return 0;
 }
@@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
 {
 	int i = 0;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
 		if (saa7191_read_status(sd, status))
 			return -EIO;
 
 		if (((*status) & SAA7191_STATUS_HLCK) == 0) {
-			dprintk("Signal found\n");
+			dev_dbg("Signal found\n");
 			return 0;
 		}
 
 		msleep(SAA7191_SYNC_DELAY);
 	}
 
-	dprintk("No signal\n");
+	dev_dbg("No signal\n");
 
 	return -EBUSY;
 }
@@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 	v4l2_std_id old_norm = decoder->norm;
 	int err = 0;
 
-	dprintk("SAA7191 extended signal auto-detection...\n");
+	dev_dbg("SAA7191 extended signal auto-detection...\n");
 
 	*norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
 	stdc &= ~SAA7191_STDC_SECS;
@@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60Hz signal -> NTSC */
-		dprintk("60Hz signal: NTSC\n");
+		dev_dbg("60Hz signal: NTSC\n");
 		*norm &= V4L2_STD_NTSC;
 		return 0;
 	}
 
 	/* 50Hz signal */
-	dprintk("50Hz signal: Trying PAL...\n");
+	dev_dbg("50Hz signal: Trying PAL...\n");
 
 	/* try PAL first */
 	err = saa7191_s_std(sd, V4L2_STD_PAL);
@@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		saa7191_s_std(sd, old_norm);
 		*norm = V4L2_STD_UNKNOWN;
 		return 0;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		*norm &= V4L2_STD_PAL;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with PAL - Trying SECAM...\n");
+	dev_dbg("No color detected with PAL - Trying SECAM...\n");
 
 	/* no color detected ? -> try SECAM */
 	err = saa7191_s_std(sd, V4L2_STD_SECAM);
@@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
 
 	/* not 50Hz ? */
 	if (status & SAA7191_STATUS_FIDT) {
-		dprintk("No 50Hz signal\n");
+		dev_dbg("No 50Hz signal\n");
 		*norm = V4L2_STD_UNKNOWN;
 		goto out;
 	}
 
 	if (status & SAA7191_STATUS_CODE) {
 		/* Color detected -> SECAM */
-		dprintk("SECAM\n");
+		dev_dbg("SECAM\n");
 		*norm &= V4L2_STD_SECAM;
 		return saa7191_s_std(sd, old_norm);
 	}
 
-	dprintk("No color detected with SECAM - Going back to PAL.\n");
+	dev_dbg("No color detected with SECAM - Going back to PAL.\n");
 	*norm = V4L2_STD_UNKNOWN;
 
 out:
@@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)
 {
 	u8 status;
 
-	dprintk("SAA7191 signal auto-detection...\n");
+	dev_dbg("SAA7191 signal auto-detection...\n");
 
-	dprintk("Reading status...\n");
+	dev_dbg("Reading status...\n");
 
 	if (saa7191_read_status(sd, &status))
 		return -EIO;
 
-	dprintk("Checking for signal...\n");
+	dev_dbg("Checking for signal...\n");
 
 	/* no signal ? */
 	if (status & SAA7191_STATUS_HLCK) {
-		dprintk("No signal\n");
+		dev_dbg("No signal\n");
 		return -EBUSY;
 	}
 
-	dprintk("Signal found\n");
+	dev_dbg("Signal found\n");
 
 	if (status & SAA7191_STATUS_FIDT) {
 		/* 60hz signal -> NTSC */
-		dprintk("NTSC\n");
+		dev_dbg("NTSC\n");
 		return saa7191_s_std(sd, V4L2_STD_NTSC);
 	} else {
 		/* 50hz signal -> PAL */
-		dprintk("PAL\n");
+		dev_dbg("PAL\n");
 		return saa7191_s_std(sd, V4L2_STD_PAL);
 	}
 }
@@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
 
 	err = saa7191_write_block(sd, sizeof(initseq), initseq);
 	if (err) {
-		printk(KERN_ERR "SAA7191 initialization failed\n");
+		dev_dbg("SAA7191 initialization failed\n");
 		return err;
 	}
 
-	printk(KERN_INFO "SAA7191 initialized\n");
+	dev_dbg("SAA7191 initialized\n");
 
 	decoder->input = SAA7191_INPUT_COMPOSITE;
 	decoder->norm = V4L2_STD_PAL;
 
 	err = saa7191_autodetect_norm(sd);
 	if (err && (err != -EBUSY))
-		printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
+		dev_dbg("SAA7191: Signal auto-detection failed\n");
 
 	return 0;
 }
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-17 20:18 [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg() Ksenija Stanojevic
@ 2015-02-17 21:27 ` Julia Lawall
  2015-02-17 21:52   ` Ksenija Stanojević
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2015-02-17 21:27 UTC (permalink / raw)
  To: Ksenija Stanojevic; +Cc: outreachy-kernel

On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:

> Making variants of existing macros is against kernel coding style. This
> patch removes all definitions made by macro dprinkt() and replaces them
> with dev_dbg().
> 
> Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> ---

What change is made for v2?

julia

>  drivers/staging/media/vino/saa7191.c | 58 ++++++++++++++++--------------------
>  1 file changed, 26 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/staging/media/vino/saa7191.c b/drivers/staging/media/vino/saa7191.c
> index 087acab..2aa68c6 100644
> --- a/drivers/staging/media/vino/saa7191.c
> +++ b/drivers/staging/media/vino/saa7191.c
> @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
>  MODULE_LICENSE("GPL");
>  
>  
> -/* #define SAA7191_DEBUG */
>  
> -#ifdef SAA7191_DEBUG
> -#define dprintk(x...) printk("SAA7191: " x);
> -#else
> -#define dprintk(x...)
> -#endif
>  
>  #define SAA7191_SYNC_COUNT	30
>  #define SAA7191_SYNC_DELAY	100	/* milliseconds */
> @@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev *sd, u8 *value)
>  
>  	ret = i2c_master_recv(client, value, 1);
>  	if (ret < 0) {
> -		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed\n");
> +		dev_dbg("saa7191_read_status(): read failed\n");
>  		return ret;
>  	}
>  
> @@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev *sd,
>  
>  	ret = i2c_master_send(client, data, length);
>  	if (ret < 0) {
> -		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
> +		dev_dbg("saa7191_write_block(): "
>  		       "write failed\n");
>  		return ret;
>  	}
> @@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
>  
>  	decoder->norm = norm;
>  
> -	dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
> +	dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
>  		stdc, chcv);
> -	dprintk("norm: %llx\n", norm);
> +	dev_dbg("norm: %llx\n", norm);
>  
>  	return 0;
>  }
> @@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
>  {
>  	int i = 0;
>  
> -	dprintk("Checking for signal...\n");
> +	dev_dbg("Checking for signal...\n");
>  
>  	for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
>  		if (saa7191_read_status(sd, status))
>  			return -EIO;
>  
>  		if (((*status) & SAA7191_STATUS_HLCK) == 0) {
> -			dprintk("Signal found\n");
> +			dev_dbg("Signal found\n");
>  			return 0;
>  		}
>  
>  		msleep(SAA7191_SYNC_DELAY);
>  	}
>  
> -	dprintk("No signal\n");
> +	dev_dbg("No signal\n");
>  
>  	return -EBUSY;
>  }
> @@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
>  	v4l2_std_id old_norm = decoder->norm;
>  	int err = 0;
>  
> -	dprintk("SAA7191 extended signal auto-detection...\n");
> +	dev_dbg("SAA7191 extended signal auto-detection...\n");
>  
>  	*norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
>  	stdc &= ~SAA7191_STDC_SECS;
> @@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
>  
>  	if (status & SAA7191_STATUS_FIDT) {
>  		/* 60Hz signal -> NTSC */
> -		dprintk("60Hz signal: NTSC\n");
> +		dev_dbg("60Hz signal: NTSC\n");
>  		*norm &= V4L2_STD_NTSC;
>  		return 0;
>  	}
>  
>  	/* 50Hz signal */
> -	dprintk("50Hz signal: Trying PAL...\n");
> +	dev_dbg("50Hz signal: Trying PAL...\n");
>  
>  	/* try PAL first */
>  	err = saa7191_s_std(sd, V4L2_STD_PAL);
> @@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
>  
>  	/* not 50Hz ? */
>  	if (status & SAA7191_STATUS_FIDT) {
> -		dprintk("No 50Hz signal\n");
> +		dev_dbg("No 50Hz signal\n");
>  		saa7191_s_std(sd, old_norm);
>  		*norm = V4L2_STD_UNKNOWN;
>  		return 0;
>  	}
>  
>  	if (status & SAA7191_STATUS_CODE) {
> -		dprintk("PAL\n");
> +		dev_dbg("PAL\n");
>  		*norm &= V4L2_STD_PAL;
>  		return saa7191_s_std(sd, old_norm);
>  	}
>  
> -	dprintk("No color detected with PAL - Trying SECAM...\n");
> +	dev_dbg("No color detected with PAL - Trying SECAM...\n");
>  
>  	/* no color detected ? -> try SECAM */
>  	err = saa7191_s_std(sd, V4L2_STD_SECAM);
> @@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev *sd, v4l2_std_id *norm)
>  
>  	/* not 50Hz ? */
>  	if (status & SAA7191_STATUS_FIDT) {
> -		dprintk("No 50Hz signal\n");
> +		dev_dbg("No 50Hz signal\n");
>  		*norm = V4L2_STD_UNKNOWN;
>  		goto out;
>  	}
>  
>  	if (status & SAA7191_STATUS_CODE) {
>  		/* Color detected -> SECAM */
> -		dprintk("SECAM\n");
> +		dev_dbg("SECAM\n");
>  		*norm &= V4L2_STD_SECAM;
>  		return saa7191_s_std(sd, old_norm);
>  	}
>  
> -	dprintk("No color detected with SECAM - Going back to PAL.\n");
> +	dev_dbg("No color detected with SECAM - Going back to PAL.\n");
>  	*norm = V4L2_STD_UNKNOWN;
>  
>  out:
> @@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)
>  {
>  	u8 status;
>  
> -	dprintk("SAA7191 signal auto-detection...\n");
> +	dev_dbg("SAA7191 signal auto-detection...\n");
>  
> -	dprintk("Reading status...\n");
> +	dev_dbg("Reading status...\n");
>  
>  	if (saa7191_read_status(sd, &status))
>  		return -EIO;
>  
> -	dprintk("Checking for signal...\n");
> +	dev_dbg("Checking for signal...\n");
>  
>  	/* no signal ? */
>  	if (status & SAA7191_STATUS_HLCK) {
> -		dprintk("No signal\n");
> +		dev_dbg("No signal\n");
>  		return -EBUSY;
>  	}
>  
> -	dprintk("Signal found\n");
> +	dev_dbg("Signal found\n");
>  
>  	if (status & SAA7191_STATUS_FIDT) {
>  		/* 60hz signal -> NTSC */
> -		dprintk("NTSC\n");
> +		dev_dbg("NTSC\n");
>  		return saa7191_s_std(sd, V4L2_STD_NTSC);
>  	} else {
>  		/* 50hz signal -> PAL */
> -		dprintk("PAL\n");
> +		dev_dbg("PAL\n");
>  		return saa7191_s_std(sd, V4L2_STD_PAL);
>  	}
>  }
> @@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
>  
>  	err = saa7191_write_block(sd, sizeof(initseq), initseq);
>  	if (err) {
> -		printk(KERN_ERR "SAA7191 initialization failed\n");
> +		dev_dbg("SAA7191 initialization failed\n");
>  		return err;
>  	}
>  
> -	printk(KERN_INFO "SAA7191 initialized\n");
> +	dev_dbg("SAA7191 initialized\n");
>  
>  	decoder->input = SAA7191_INPUT_COMPOSITE;
>  	decoder->norm = V4L2_STD_PAL;
>  
>  	err = saa7191_autodetect_norm(sd);
>  	if (err && (err != -EBUSY))
> -		printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
> +		dev_dbg("SAA7191: Signal auto-detection failed\n");
>  
>  	return 0;
>  }
> -- 
> 1.9.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-send-email-ksenija.stanojevic%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-17 21:27 ` [Outreachy kernel] " Julia Lawall
@ 2015-02-17 21:52   ` Ksenija Stanojević
  2015-02-17 22:04     ` Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojević @ 2015-02-17 21:52 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 8583 bytes --]

I removed variables KERN_ERR and KERN_INFO
 and added device argument to dev_dbg in line 230, I don't know where else
to put that argument.

On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:

> On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
>
> > Making variants of existing macros is against kernel coding style. This
> > patch removes all definitions made by macro dprinkt() and replaces them
> > with dev_dbg().
> >
> > Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> > ---
>
> What change is made for v2?
>
> julia
>
> >  drivers/staging/media/vino/saa7191.c | 58
> ++++++++++++++++--------------------
> >  1 file changed, 26 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/staging/media/vino/saa7191.c
> b/drivers/staging/media/vino/saa7191.c
> > index 087acab..2aa68c6 100644
> > --- a/drivers/staging/media/vino/saa7191.c
> > +++ b/drivers/staging/media/vino/saa7191.c
> > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi
> >");
> >  MODULE_LICENSE("GPL");
> >
> >
> > -/* #define SAA7191_DEBUG */
> >
> > -#ifdef SAA7191_DEBUG
> > -#define dprintk(x...) printk("SAA7191: " x);
> > -#else
> > -#define dprintk(x...)
> > -#endif
> >
> >  #define SAA7191_SYNC_COUNT   30
> >  #define SAA7191_SYNC_DELAY   100     /* milliseconds */
> > @@ -116,7 +110,7 @@ static int saa7191_read_status(struct v4l2_subdev
> *sd, u8 *value)
> >
> >       ret = i2c_master_recv(client, value, 1);
> >       if (ret < 0) {
> > -             printk(KERN_ERR "SAA7191: saa7191_read_status(): read
> failed\n");
> > +             dev_dbg("saa7191_read_status(): read failed\n");
> >               return ret;
> >       }
> >
> > @@ -147,7 +141,7 @@ static int saa7191_write_block(struct v4l2_subdev
> *sd,
> >
> >       ret = i2c_master_send(client, data, length);
> >       if (ret < 0) {
> > -             printk(KERN_ERR "SAA7191: saa7191_write_block(): "
> > +             dev_dbg("saa7191_write_block(): "
> >                      "write failed\n");
> >               return ret;
> >       }
> > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct v4l2_subdev *sd,
> v4l2_std_id norm)
> >
> >       decoder->norm = norm;
> >
> > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
> > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
> >               stdc, chcv);
> > -     dprintk("norm: %llx\n", norm);
> > +     dev_dbg("norm: %llx\n", norm);
> >
> >       return 0;
> >  }
> > @@ -241,21 +235,21 @@ static int saa7191_wait_for_signal(struct
> v4l2_subdev *sd, u8 *status)
> >  {
> >       int i = 0;
> >
> > -     dprintk("Checking for signal...\n");
> > +     dev_dbg("Checking for signal...\n");
> >
> >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
> >               if (saa7191_read_status(sd, status))
> >                       return -EIO;
> >
> >               if (((*status) & SAA7191_STATUS_HLCK) == 0) {
> > -                     dprintk("Signal found\n");
> > +                     dev_dbg("Signal found\n");
> >                       return 0;
> >               }
> >
> >               msleep(SAA7191_SYNC_DELAY);
> >       }
> >
> > -     dprintk("No signal\n");
> > +     dev_dbg("No signal\n");
> >
> >       return -EBUSY;
> >  }
> > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct v4l2_subdev *sd,
> v4l2_std_id *norm)
> >       v4l2_std_id old_norm = decoder->norm;
> >       int err = 0;
> >
> > -     dprintk("SAA7191 extended signal auto-detection...\n");
> > +     dev_dbg("SAA7191 extended signal auto-detection...\n");
> >
> >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
> >       stdc &= ~SAA7191_STDC_SECS;
> > @@ -301,13 +295,13 @@ static int saa7191_querystd(struct v4l2_subdev
> *sd, v4l2_std_id *norm)
> >
> >       if (status & SAA7191_STATUS_FIDT) {
> >               /* 60Hz signal -> NTSC */
> > -             dprintk("60Hz signal: NTSC\n");
> > +             dev_dbg("60Hz signal: NTSC\n");
> >               *norm &= V4L2_STD_NTSC;
> >               return 0;
> >       }
> >
> >       /* 50Hz signal */
> > -     dprintk("50Hz signal: Trying PAL...\n");
> > +     dev_dbg("50Hz signal: Trying PAL...\n");
> >
> >       /* try PAL first */
> >       err = saa7191_s_std(sd, V4L2_STD_PAL);
> > @@ -322,19 +316,19 @@ static int saa7191_querystd(struct v4l2_subdev
> *sd, v4l2_std_id *norm)
> >
> >       /* not 50Hz ? */
> >       if (status & SAA7191_STATUS_FIDT) {
> > -             dprintk("No 50Hz signal\n");
> > +             dev_dbg("No 50Hz signal\n");
> >               saa7191_s_std(sd, old_norm);
> >               *norm = V4L2_STD_UNKNOWN;
> >               return 0;
> >       }
> >
> >       if (status & SAA7191_STATUS_CODE) {
> > -             dprintk("PAL\n");
> > +             dev_dbg("PAL\n");
> >               *norm &= V4L2_STD_PAL;
> >               return saa7191_s_std(sd, old_norm);
> >       }
> >
> > -     dprintk("No color detected with PAL - Trying SECAM...\n");
> > +     dev_dbg("No color detected with PAL - Trying SECAM...\n");
> >
> >       /* no color detected ? -> try SECAM */
> >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
> > @@ -349,19 +343,19 @@ static int saa7191_querystd(struct v4l2_subdev
> *sd, v4l2_std_id *norm)
> >
> >       /* not 50Hz ? */
> >       if (status & SAA7191_STATUS_FIDT) {
> > -             dprintk("No 50Hz signal\n");
> > +             dev_dbg("No 50Hz signal\n");
> >               *norm = V4L2_STD_UNKNOWN;
> >               goto out;
> >       }
> >
> >       if (status & SAA7191_STATUS_CODE) {
> >               /* Color detected -> SECAM */
> > -             dprintk("SECAM\n");
> > +             dev_dbg("SECAM\n");
> >               *norm &= V4L2_STD_SECAM;
> >               return saa7191_s_std(sd, old_norm);
> >       }
> >
> > -     dprintk("No color detected with SECAM - Going back to PAL.\n");
> > +     dev_dbg("No color detected with SECAM - Going back to PAL.\n");
> >       *norm = V4L2_STD_UNKNOWN;
> >
> >  out:
> > @@ -372,30 +366,30 @@ static int saa7191_autodetect_norm(struct
> v4l2_subdev *sd)
> >  {
> >       u8 status;
> >
> > -     dprintk("SAA7191 signal auto-detection...\n");
> > +     dev_dbg("SAA7191 signal auto-detection...\n");
> >
> > -     dprintk("Reading status...\n");
> > +     dev_dbg("Reading status...\n");
> >
> >       if (saa7191_read_status(sd, &status))
> >               return -EIO;
> >
> > -     dprintk("Checking for signal...\n");
> > +     dev_dbg("Checking for signal...\n");
> >
> >       /* no signal ? */
> >       if (status & SAA7191_STATUS_HLCK) {
> > -             dprintk("No signal\n");
> > +             dev_dbg("No signal\n");
> >               return -EBUSY;
> >       }
> >
> > -     dprintk("Signal found\n");
> > +     dev_dbg("Signal found\n");
> >
> >       if (status & SAA7191_STATUS_FIDT) {
> >               /* 60hz signal -> NTSC */
> > -             dprintk("NTSC\n");
> > +             dev_dbg("NTSC\n");
> >               return saa7191_s_std(sd, V4L2_STD_NTSC);
> >       } else {
> >               /* 50hz signal -> PAL */
> > -             dprintk("PAL\n");
> > +             dev_dbg("PAL\n");
> >               return saa7191_s_std(sd, V4L2_STD_PAL);
> >       }
> >  }
> > @@ -606,18 +600,18 @@ static int saa7191_probe(struct i2c_client *client,
> >
> >       err = saa7191_write_block(sd, sizeof(initseq), initseq);
> >       if (err) {
> > -             printk(KERN_ERR "SAA7191 initialization failed\n");
> > +             dev_dbg("SAA7191 initialization failed\n");
> >               return err;
> >       }
> >
> > -     printk(KERN_INFO "SAA7191 initialized\n");
> > +     dev_dbg("SAA7191 initialized\n");
> >
> >       decoder->input = SAA7191_INPUT_COMPOSITE;
> >       decoder->norm = V4L2_STD_PAL;
> >
> >       err = saa7191_autodetect_norm(sd);
> >       if (err && (err != -EBUSY))
> > -             printk(KERN_ERR "SAA7191: Signal auto-detection failed\n");
> > +             dev_dbg("SAA7191: Signal auto-detection failed\n");
> >
> >       return 0;
> >  }
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-send-email-ksenija.stanojevic%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>

[-- Attachment #2: Type: text/html, Size: 12205 bytes --]

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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-17 21:52   ` Ksenija Stanojević
@ 2015-02-17 22:04     ` Julia Lawall
  2015-02-18 17:01       ` Ksenija Stanojevic
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2015-02-17 22:04 UTC (permalink / raw)
  To: Ksenija Stanojević; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 11944 bytes --]

On Tue, 17 Feb 2015, Ksenija Stanojević wrote:

> I removed variables KERN_ERR and KERN_INFO
>  and added device argument to dev_dbg in line 230,

When you send a v2 patch, you could describe the change that you have made 
as compared to the previous patch under the ---

> I don't know where else to put that argument.

Every call to dev_dbg needs a pointer to a device structure as the first 
argument.

Did you compile your code?  If so, perhaps this file was not selected in 
your configuration and thus it was not compiled.  You can see if it was 
compiled by looking to see if it has a corresponding .o file.  If not, you 
can try selecting the driver in your configuration.

julia

> On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall <julia.lawall@lip6.fr>
> wrote:
>       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
> 
>       > Making variants of existing macros is against kernel coding
>       style. This
>       > patch removes all definitions made by macro dprinkt() and
>       replaces them
>       > with dev_dbg().
>       >
>       > Signed-off-by: Ksenija Stanojevic
>       <ksenija.stanojevic@gmail.com>
>       > ---
> 
>       What change is made for v2?
> 
>       julia
> 
>       >  drivers/staging/media/vino/saa7191.c | 58
>       ++++++++++++++++--------------------
>       >  1 file changed, 26 insertions(+), 32 deletions(-)
>       >
>       > diff --git a/drivers/staging/media/vino/saa7191.c
>       b/drivers/staging/media/vino/saa7191.c
>       > index 087acab..2aa68c6 100644
>       > --- a/drivers/staging/media/vino/saa7191.c
>       > +++ b/drivers/staging/media/vino/saa7191.c
>       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen
>       <tmnousia@cc.hut.fi>");
>       >  MODULE_LICENSE("GPL");
>       >
>       >
>       > -/* #define SAA7191_DEBUG */
>       >
>       > -#ifdef SAA7191_DEBUG
>       > -#define dprintk(x...) printk("SAA7191: " x);
>       > -#else
>       > -#define dprintk(x...)
>       > -#endif
>       >
>       >  #define SAA7191_SYNC_COUNT   30
>       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds */
>       > @@ -116,7 +110,7 @@ static int saa7191_read_status(struct
>       v4l2_subdev *sd, u8 *value)
>       >
>       >       ret = i2c_master_recv(client, value, 1);
>       >       if (ret < 0) {
>       > -             printk(KERN_ERR "SAA7191:
>       saa7191_read_status(): read failed\n");
>       > +             dev_dbg("saa7191_read_status(): read
>       failed\n");
>       >               return ret;
>       >       }
>       >
>       > @@ -147,7 +141,7 @@ static int saa7191_write_block(struct
>       v4l2_subdev *sd,
>       >
>       >       ret = i2c_master_send(client, data, length);
>       >       if (ret < 0) {
>       > -             printk(KERN_ERR "SAA7191:
>       saa7191_write_block(): "
>       > +             dev_dbg("saa7191_write_block(): "
>       >                      "write failed\n");
>       >               return ret;
>       >       }
>       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct
>       v4l2_subdev *sd, v4l2_std_id norm)
>       >
>       >       decoder->norm = norm;
>       >
>       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
>       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n",
>       ctl3,
>       >               stdc, chcv);
>       > -     dprintk("norm: %llx\n", norm);
>       > +     dev_dbg("norm: %llx\n", norm);
>       >
>       >       return 0;
>       >  }
>       > @@ -241,21 +235,21 @@ static int
>       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status)
>       >  {
>       >       int i = 0;
>       >
>       > -     dprintk("Checking for signal...\n");
>       > +     dev_dbg("Checking for signal...\n");
>       >
>       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
>       >               if (saa7191_read_status(sd, status))
>       >                       return -EIO;
>       >
>       >               if (((*status) & SAA7191_STATUS_HLCK) == 0) {
>       > -                     dprintk("Signal found\n");
>       > +                     dev_dbg("Signal found\n");
>       >                       return 0;
>       >               }
>       >
>       >               msleep(SAA7191_SYNC_DELAY);
>       >       }
>       >
>       > -     dprintk("No signal\n");
>       > +     dev_dbg("No signal\n");
>       >
>       >       return -EBUSY;
>       >  }
>       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct
>       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       v4l2_std_id old_norm = decoder->norm;
>       >       int err = 0;
>       >
>       > -     dprintk("SAA7191 extended signal auto-detection...\n");
>       > +     dev_dbg("SAA7191 extended signal auto-detection...\n");
>       >
>       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM;
>       >       stdc &= ~SAA7191_STDC_SECS;
>       > @@ -301,13 +295,13 @@ static int saa7191_querystd(struct
>       v4l2_subdev *sd, v4l2_std_id *norm)
>       >
>       >       if (status & SAA7191_STATUS_FIDT) {
>       >               /* 60Hz signal -> NTSC */
>       > -             dprintk("60Hz signal: NTSC\n");
>       > +             dev_dbg("60Hz signal: NTSC\n");
>       >               *norm &= V4L2_STD_NTSC;
>       >               return 0;
>       >       }
>       >
>       >       /* 50Hz signal */
>       > -     dprintk("50Hz signal: Trying PAL...\n");
>       > +     dev_dbg("50Hz signal: Trying PAL...\n");
>       >
>       >       /* try PAL first */
>       >       err = saa7191_s_std(sd, V4L2_STD_PAL);
>       > @@ -322,19 +316,19 @@ static int saa7191_querystd(struct
>       v4l2_subdev *sd, v4l2_std_id *norm)
>       >
>       >       /* not 50Hz ? */
>       >       if (status & SAA7191_STATUS_FIDT) {
>       > -             dprintk("No 50Hz signal\n");
>       > +             dev_dbg("No 50Hz signal\n");
>       >               saa7191_s_std(sd, old_norm);
>       >               *norm = V4L2_STD_UNKNOWN;
>       >               return 0;
>       >       }
>       >
>       >       if (status & SAA7191_STATUS_CODE) {
>       > -             dprintk("PAL\n");
>       > +             dev_dbg("PAL\n");
>       >               *norm &= V4L2_STD_PAL;
>       >               return saa7191_s_std(sd, old_norm);
>       >       }
>       >
>       > -     dprintk("No color detected with PAL - Trying
>       SECAM...\n");
>       > +     dev_dbg("No color detected with PAL - Trying
>       SECAM...\n");
>       >
>       >       /* no color detected ? -> try SECAM */
>       >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
>       > @@ -349,19 +343,19 @@ static int saa7191_querystd(struct
>       v4l2_subdev *sd, v4l2_std_id *norm)
>       >
>       >       /* not 50Hz ? */
>       >       if (status & SAA7191_STATUS_FIDT) {
>       > -             dprintk("No 50Hz signal\n");
>       > +             dev_dbg("No 50Hz signal\n");
>       >               *norm = V4L2_STD_UNKNOWN;
>       >               goto out;
>       >       }
>       >
>       >       if (status & SAA7191_STATUS_CODE) {
>       >               /* Color detected -> SECAM */
>       > -             dprintk("SECAM\n");
>       > +             dev_dbg("SECAM\n");
>       >               *norm &= V4L2_STD_SECAM;
>       >               return saa7191_s_std(sd, old_norm);
>       >       }
>       >
>       > -     dprintk("No color detected with SECAM - Going back to
>       PAL.\n");
>       > +     dev_dbg("No color detected with SECAM - Going back to
>       PAL.\n");
>       >       *norm = V4L2_STD_UNKNOWN;
>       >
>       >  out:
>       > @@ -372,30 +366,30 @@ static int
>       saa7191_autodetect_norm(struct v4l2_subdev *sd)
>       >  {
>       >       u8 status;
>       >
>       > -     dprintk("SAA7191 signal auto-detection...\n");
>       > +     dev_dbg("SAA7191 signal auto-detection...\n");
>       >
>       > -     dprintk("Reading status...\n");
>       > +     dev_dbg("Reading status...\n");
>       >
>       >       if (saa7191_read_status(sd, &status))
>       >               return -EIO;
>       >
>       > -     dprintk("Checking for signal...\n");
>       > +     dev_dbg("Checking for signal...\n");
>       >
>       >       /* no signal ? */
>       >       if (status & SAA7191_STATUS_HLCK) {
>       > -             dprintk("No signal\n");
>       > +             dev_dbg("No signal\n");
>       >               return -EBUSY;
>       >       }
>       >
>       > -     dprintk("Signal found\n");
>       > +     dev_dbg("Signal found\n");
>       >
>       >       if (status & SAA7191_STATUS_FIDT) {
>       >               /* 60hz signal -> NTSC */
>       > -             dprintk("NTSC\n");
>       > +             dev_dbg("NTSC\n");
>       >               return saa7191_s_std(sd, V4L2_STD_NTSC);
>       >       } else {
>       >               /* 50hz signal -> PAL */
>       > -             dprintk("PAL\n");
>       > +             dev_dbg("PAL\n");
>       >               return saa7191_s_std(sd, V4L2_STD_PAL);
>       >       }
>       >  }
>       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct
>       i2c_client *client,
>       >
>       >       err = saa7191_write_block(sd, sizeof(initseq),
>       initseq);
>       >       if (err) {
>       > -             printk(KERN_ERR "SAA7191 initialization
>       failed\n");
>       > +             dev_dbg("SAA7191 initialization failed\n");
>       >               return err;
>       >       }
>       >
>       > -     printk(KERN_INFO "SAA7191 initialized\n");
>       > +     dev_dbg("SAA7191 initialized\n");
>       >
>       >       decoder->input = SAA7191_INPUT_COMPOSITE;
>       >       decoder->norm = V4L2_STD_PAL;
>       >
>       >       err = saa7191_autodetect_norm(sd);
>       >       if (err && (err != -EBUSY))
>       > -             printk(KERN_ERR "SAA7191: Signal auto-detection
>       failed\n");
>       > +             dev_dbg("SAA7191: Signal auto-detection
>       failed\n");
>       >
>       >       return 0;
>       >  }
>       > --
>       > 1.9.1
>       >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to
> outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git-
> send-email-ksenija.stanojevic%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> 
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7uApK
> y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 

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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-17 22:04     ` Julia Lawall
@ 2015-02-18 17:01       ` Ksenija Stanojevic
  2015-02-18 17:36         ` Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojevic @ 2015-02-18 17:01 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: ksenija.stanojevic


[-- Attachment #1.1: Type: text/plain, Size: 12662 bytes --]

I missunderstood how dev_dbg works.
i did compile my code and it haven't shown any errors, but I don't have 
corresponding .ko file

On Tuesday, February 17, 2015 at 11:04:31 PM UTC+1, Julia Lawall wrote:
>
> On Tue, 17 Feb 2015, Ksenija Stanojević wrote: 
>
> > I removed variables KERN_ERR and KERN_INFO 
> >  and added device argument to dev_dbg in line 230, 
>
> When you send a v2 patch, you could describe the change that you have made 
> as compared to the previous patch under the --- 
>
> > I don't know where else to put that argument. 
>
> Every call to dev_dbg needs a pointer to a device structure as the first 
> argument. 
>
> Did you compile your code?  If so, perhaps this file was not selected in 
> your configuration and thus it was not compiled.  You can see if it was 
> compiled by looking to see if it has a corresponding .o file.  If not, you 
> can try selecting the driver in your configuration. 
>
> julia 
>
> > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall <julia....@lip6.fr 
> <javascript:>> 
> > wrote: 
> >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote: 
> > 
> >       > Making variants of existing macros is against kernel coding 
> >       style. This 
> >       > patch removes all definitions made by macro dprinkt() and 
> >       replaces them 
> >       > with dev_dbg(). 
> >       > 
> >       > Signed-off-by: Ksenija Stanojevic 
> >       <ksenija.s...@gmail.com <javascript:>> 
> >       > --- 
> > 
> >       What change is made for v2? 
> > 
> >       julia 
> > 
> >       >  drivers/staging/media/vino/saa7191.c | 58 
> >       ++++++++++++++++-------------------- 
> >       >  1 file changed, 26 insertions(+), 32 deletions(-) 
> >       > 
> >       > diff --git a/drivers/staging/media/vino/saa7191.c 
> >       b/drivers/staging/media/vino/saa7191.c 
> >       > index 087acab..2aa68c6 100644 
> >       > --- a/drivers/staging/media/vino/saa7191.c 
> >       > +++ b/drivers/staging/media/vino/saa7191.c 
> >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen 
> >       <tmno...@cc.hut.fi <javascript:>>"); 
> >       >  MODULE_LICENSE("GPL"); 
> >       > 
> >       > 
> >       > -/* #define SAA7191_DEBUG */ 
> >       > 
> >       > -#ifdef SAA7191_DEBUG 
> >       > -#define dprintk(x...) printk("SAA7191: " x); 
> >       > -#else 
> >       > -#define dprintk(x...) 
> >       > -#endif 
> >       > 
> >       >  #define SAA7191_SYNC_COUNT   30 
> >       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds */ 
> >       > @@ -116,7 +110,7 @@ static int saa7191_read_status(struct 
> >       v4l2_subdev *sd, u8 *value) 
> >       > 
> >       >       ret = i2c_master_recv(client, value, 1); 
> >       >       if (ret < 0) { 
> >       > -             printk(KERN_ERR "SAA7191: 
> >       saa7191_read_status(): read failed\n"); 
> >       > +             dev_dbg("saa7191_read_status(): read 
> >       failed\n"); 
> >       >               return ret; 
> >       >       } 
> >       > 
> >       > @@ -147,7 +141,7 @@ static int saa7191_write_block(struct 
> >       v4l2_subdev *sd, 
> >       > 
> >       >       ret = i2c_master_send(client, data, length); 
> >       >       if (ret < 0) { 
> >       > -             printk(KERN_ERR "SAA7191: 
> >       saa7191_write_block(): " 
> >       > +             dev_dbg("saa7191_write_block(): " 
> >       >                      "write failed\n"); 
> >       >               return ret; 
> >       >       } 
> >       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct 
> >       v4l2_subdev *sd, v4l2_std_id norm) 
> >       > 
> >       >       decoder->norm = norm; 
> >       > 
> >       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3, 
> >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: %02x\n", 
> >       ctl3, 
> >       >               stdc, chcv); 
> >       > -     dprintk("norm: %llx\n", norm); 
> >       > +     dev_dbg("norm: %llx\n", norm); 
> >       > 
> >       >       return 0; 
> >       >  } 
> >       > @@ -241,21 +235,21 @@ static int 
> >       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 *status) 
> >       >  { 
> >       >       int i = 0; 
> >       > 
> >       > -     dprintk("Checking for signal...\n"); 
> >       > +     dev_dbg("Checking for signal...\n"); 
> >       > 
> >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) { 
> >       >               if (saa7191_read_status(sd, status)) 
> >       >                       return -EIO; 
> >       > 
> >       >               if (((*status) & SAA7191_STATUS_HLCK) == 0) { 
> >       > -                     dprintk("Signal found\n"); 
> >       > +                     dev_dbg("Signal found\n"); 
> >       >                       return 0; 
> >       >               } 
> >       > 
> >       >               msleep(SAA7191_SYNC_DELAY); 
> >       >       } 
> >       > 
> >       > -     dprintk("No signal\n"); 
> >       > +     dev_dbg("No signal\n"); 
> >       > 
> >       >       return -EBUSY; 
> >       >  } 
> >       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct 
> >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       >       v4l2_std_id old_norm = decoder->norm; 
> >       >       int err = 0; 
> >       > 
> >       > -     dprintk("SAA7191 extended signal auto-detection...\n"); 
> >       > +     dev_dbg("SAA7191 extended signal auto-detection...\n"); 
> >       > 
> >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM; 
> >       >       stdc &= ~SAA7191_STDC_SECS; 
> >       > @@ -301,13 +295,13 @@ static int saa7191_querystd(struct 
> >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       > 
> >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >               /* 60Hz signal -> NTSC */ 
> >       > -             dprintk("60Hz signal: NTSC\n"); 
> >       > +             dev_dbg("60Hz signal: NTSC\n"); 
> >       >               *norm &= V4L2_STD_NTSC; 
> >       >               return 0; 
> >       >       } 
> >       > 
> >       >       /* 50Hz signal */ 
> >       > -     dprintk("50Hz signal: Trying PAL...\n"); 
> >       > +     dev_dbg("50Hz signal: Trying PAL...\n"); 
> >       > 
> >       >       /* try PAL first */ 
> >       >       err = saa7191_s_std(sd, V4L2_STD_PAL); 
> >       > @@ -322,19 +316,19 @@ static int saa7191_querystd(struct 
> >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       > 
> >       >       /* not 50Hz ? */ 
> >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       > -             dprintk("No 50Hz signal\n"); 
> >       > +             dev_dbg("No 50Hz signal\n"); 
> >       >               saa7191_s_std(sd, old_norm); 
> >       >               *norm = V4L2_STD_UNKNOWN; 
> >       >               return 0; 
> >       >       } 
> >       > 
> >       >       if (status & SAA7191_STATUS_CODE) { 
> >       > -             dprintk("PAL\n"); 
> >       > +             dev_dbg("PAL\n"); 
> >       >               *norm &= V4L2_STD_PAL; 
> >       >               return saa7191_s_std(sd, old_norm); 
> >       >       } 
> >       > 
> >       > -     dprintk("No color detected with PAL - Trying 
> >       SECAM...\n"); 
> >       > +     dev_dbg("No color detected with PAL - Trying 
> >       SECAM...\n"); 
> >       > 
> >       >       /* no color detected ? -> try SECAM */ 
> >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM); 
> >       > @@ -349,19 +343,19 @@ static int saa7191_querystd(struct 
> >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       > 
> >       >       /* not 50Hz ? */ 
> >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       > -             dprintk("No 50Hz signal\n"); 
> >       > +             dev_dbg("No 50Hz signal\n"); 
> >       >               *norm = V4L2_STD_UNKNOWN; 
> >       >               goto out; 
> >       >       } 
> >       > 
> >       >       if (status & SAA7191_STATUS_CODE) { 
> >       >               /* Color detected -> SECAM */ 
> >       > -             dprintk("SECAM\n"); 
> >       > +             dev_dbg("SECAM\n"); 
> >       >               *norm &= V4L2_STD_SECAM; 
> >       >               return saa7191_s_std(sd, old_norm); 
> >       >       } 
> >       > 
> >       > -     dprintk("No color detected with SECAM - Going back to 
> >       PAL.\n"); 
> >       > +     dev_dbg("No color detected with SECAM - Going back to 
> >       PAL.\n"); 
> >       >       *norm = V4L2_STD_UNKNOWN; 
> >       > 
> >       >  out: 
> >       > @@ -372,30 +366,30 @@ static int 
> >       saa7191_autodetect_norm(struct v4l2_subdev *sd) 
> >       >  { 
> >       >       u8 status; 
> >       > 
> >       > -     dprintk("SAA7191 signal auto-detection...\n"); 
> >       > +     dev_dbg("SAA7191 signal auto-detection...\n"); 
> >       > 
> >       > -     dprintk("Reading status...\n"); 
> >       > +     dev_dbg("Reading status...\n"); 
> >       > 
> >       >       if (saa7191_read_status(sd, &status)) 
> >       >               return -EIO; 
> >       > 
> >       > -     dprintk("Checking for signal...\n"); 
> >       > +     dev_dbg("Checking for signal...\n"); 
> >       > 
> >       >       /* no signal ? */ 
> >       >       if (status & SAA7191_STATUS_HLCK) { 
> >       > -             dprintk("No signal\n"); 
> >       > +             dev_dbg("No signal\n"); 
> >       >               return -EBUSY; 
> >       >       } 
> >       > 
> >       > -     dprintk("Signal found\n"); 
> >       > +     dev_dbg("Signal found\n"); 
> >       > 
> >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >               /* 60hz signal -> NTSC */ 
> >       > -             dprintk("NTSC\n"); 
> >       > +             dev_dbg("NTSC\n"); 
> >       >               return saa7191_s_std(sd, V4L2_STD_NTSC); 
> >       >       } else { 
> >       >               /* 50hz signal -> PAL */ 
> >       > -             dprintk("PAL\n"); 
> >       > +             dev_dbg("PAL\n"); 
> >       >               return saa7191_s_std(sd, V4L2_STD_PAL); 
> >       >       } 
> >       >  } 
> >       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct 
> >       i2c_client *client, 
> >       > 
> >       >       err = saa7191_write_block(sd, sizeof(initseq), 
> >       initseq); 
> >       >       if (err) { 
> >       > -             printk(KERN_ERR "SAA7191 initialization 
> >       failed\n"); 
> >       > +             dev_dbg("SAA7191 initialization failed\n"); 
> >       >               return err; 
> >       >       } 
> >       > 
> >       > -     printk(KERN_INFO "SAA7191 initialized\n"); 
> >       > +     dev_dbg("SAA7191 initialized\n"); 
> >       > 
> >       >       decoder->input = SAA7191_INPUT_COMPOSITE; 
> >       >       decoder->norm = V4L2_STD_PAL; 
> >       > 
> >       >       err = saa7191_autodetect_norm(sd); 
> >       >       if (err && (err != -EBUSY)) 
> >       > -             printk(KERN_ERR "SAA7191: Signal auto-detection 
> >       failed\n"); 
> >       > +             dev_dbg("SAA7191: Signal auto-detection 
> >       failed\n"); 
> >       > 
> >       >       return 0; 
> >       >  } 
> >       > -- 
> >       > 1.9.1 
> >       > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > Groups "outreachy-kernel" group. 
> > > To unsubscribe from this group and stop receiving emails from it, 
> > send an email to outreachy-kern...@googlegroups.com <javascript:>. 
> > > To post to this group, send email to 
> > outreach...@googlegroups.com <javascript:>. 
> > > To view this discussion on the web visithttps://
> groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-git- 
> > send-email-ksenija.stanojevic%40gmail.com. 
> > > For more options, visit https://groups.google.com/d/optout. 
> > > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "outreachy-kernel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to outreachy-kern...@googlegroups.com <javascript:>. 
> > To post to this group, send email to outreach...@googlegroups.com 
> <javascript:>. 
> > To view this discussion on the web visithttps://
> groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7uApK 
> > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com. 
> > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 


[-- Attachment #1.2: Type: text/html, Size: 23348 bytes --]

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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-18 17:01       ` Ksenija Stanojevic
@ 2015-02-18 17:36         ` Julia Lawall
  2015-02-18 17:58           ` Ksenija Stanojevic
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2015-02-18 17:36 UTC (permalink / raw)
  To: Ksenija Stanojevic; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 16084 bytes --]

On Wed, 18 Feb 2015, Ksenija Stanojevic wrote:

> I missunderstood how dev_dbg works.
> i did compile my code and it haven't shown any errors, but I don't have
> corresponding .ko file

OK, you can try

make drivers/staging/media/vino/saa7191.o

julia


>
> On Tuesday, February 17, 2015 at 11:04:31 PM UTC+1, Julia Lawall wrote:
>       On Tue, 17 Feb 2015, Ksenija Stanojević wrote:
>
>       > I removed variables KERN_ERR and KERN_INFO
>       >  and added device argument to dev_dbg in line 230,
>
>       When you send a v2 patch, you could describe the change that you
>       have made
>       as compared to the previous patch under the ---
>
>       > I don't know where else to put that argument.
>
>       Every call to dev_dbg needs a pointer to a device structure as
>       the first
>       argument.
>
>       Did you compile your code?  If so, perhaps this file was not
>       selected in
>       your configuration and thus it was not compiled.  You can see if
>       it was
>       compiled by looking to see if it has a corresponding .o file.
>        If not, you
>       can try selecting the driver in your configuration.
>
>       julia
>
>       > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall
>       <julia....@lip6.fr>
>       > wrote:
>       >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
>       >
>       >       > Making variants of existing macros is against kernel
>       coding
>       >       style. This
>       >       > patch removes all definitions made by macro dprinkt()
>       and
>       >       replaces them
>       >       > with dev_dbg().
>       >       >
>       >       > Signed-off-by: Ksenija Stanojevic
>       >       <ksenija.s...@gmail.com>
>       >       > ---
>       >
>       >       What change is made for v2?
>       >
>       >       julia
>       >
>       >       >  drivers/staging/media/vino/saa7191.c | 58
>       >       ++++++++++++++++--------------------
>       >       >  1 file changed, 26 insertions(+), 32 deletions(-)
>       >       >
>       >       > diff --git a/drivers/staging/media/vino/saa7191.c
>       >       b/drivers/staging/media/vino/saa7191.c
>       >       > index 087acab..2aa68c6 100644
>       >       > --- a/drivers/staging/media/vino/saa7191.c
>       >       > +++ b/drivers/staging/media/vino/saa7191.c
>       >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen
>       >       <tmno...@cc.hut.fi>");
>       >       >  MODULE_LICENSE("GPL");
>       >       >
>       >       >
>       >       > -/* #define SAA7191_DEBUG */
>       >       >
>       >       > -#ifdef SAA7191_DEBUG
>       >       > -#define dprintk(x...) printk("SAA7191: " x);
>       >       > -#else
>       >       > -#define dprintk(x...)
>       >       > -#endif
>       >       >
>       >       >  #define SAA7191_SYNC_COUNT   30
>       >       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds
>       */
>       >       > @@ -116,7 +110,7 @@ static int
>       saa7191_read_status(struct
>       >       v4l2_subdev *sd, u8 *value)
>       >       >
>       >       >       ret = i2c_master_recv(client, value, 1);
>       >       >       if (ret < 0) {
>       >       > -             printk(KERN_ERR "SAA7191:
>       >       saa7191_read_status(): read failed\n");
>       >       > +             dev_dbg("saa7191_read_status(): read
>       >       failed\n");
>       >       >               return ret;
>       >       >       }
>       >       >
>       >       > @@ -147,7 +141,7 @@ static int
>       saa7191_write_block(struct
>       >       v4l2_subdev *sd,
>       >       >
>       >       >       ret = i2c_master_send(client, data, length);
>       >       >       if (ret < 0) {
>       >       > -             printk(KERN_ERR "SAA7191:
>       >       saa7191_write_block(): "
>       >       > +             dev_dbg("saa7191_write_block(): "
>       >       >                      "write failed\n");
>       >       >               return ret;
>       >       >       }
>       >       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct
>       >       v4l2_subdev *sd, v4l2_std_id norm)
>       >       >
>       >       >       decoder->norm = norm;
>       >       >
>       >       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n",
>       ctl3,
>       >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv:
>       %02x\n",
>       >       ctl3,
>       >       >               stdc, chcv);
>       >       > -     dprintk("norm: %llx\n", norm);
>       >       > +     dev_dbg("norm: %llx\n", norm);
>       >       >
>       >       >       return 0;
>       >       >  }
>       >       > @@ -241,21 +235,21 @@ static int
>       >       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8
>       *status)
>       >       >  {
>       >       >       int i = 0;
>       >       >
>       >       > -     dprintk("Checking for signal...\n");
>       >       > +     dev_dbg("Checking for signal...\n");
>       >       >
>       >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
>       >       >               if (saa7191_read_status(sd, status))
>       >       >                       return -EIO;
>       >       >
>       >       >               if (((*status) & SAA7191_STATUS_HLCK) ==
>       0) {
>       >       > -                     dprintk("Signal found\n");
>       >       > +                     dev_dbg("Signal found\n");
>       >       >                       return 0;
>       >       >               }
>       >       >
>       >       >               msleep(SAA7191_SYNC_DELAY);
>       >       >       }
>       >       >
>       >       > -     dprintk("No signal\n");
>       >       > +     dev_dbg("No signal\n");
>       >       >
>       >       >       return -EBUSY;
>       >       >  }
>       >       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       v4l2_std_id old_norm = decoder->norm;
>       >       >       int err = 0;
>       >       >
>       >       > -     dprintk("SAA7191 extended signal
>       auto-detection...\n");
>       >       > +     dev_dbg("SAA7191 extended signal
>       auto-detection...\n");
>       >       >
>       >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL |
>       V4L2_STD_SECAM;
>       >       >       stdc &= ~SAA7191_STDC_SECS;
>       >       > @@ -301,13 +295,13 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >               /* 60Hz signal -> NTSC */
>       >       > -             dprintk("60Hz signal: NTSC\n");
>       >       > +             dev_dbg("60Hz signal: NTSC\n");
>       >       >               *norm &= V4L2_STD_NTSC;
>       >       >               return 0;
>       >       >       }
>       >       >
>       >       >       /* 50Hz signal */
>       >       > -     dprintk("50Hz signal: Trying PAL...\n");
>       >       > +     dev_dbg("50Hz signal: Trying PAL...\n");
>       >       >
>       >       >       /* try PAL first */
>       >       >       err = saa7191_s_std(sd, V4L2_STD_PAL);
>       >       > @@ -322,19 +316,19 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       /* not 50Hz ? */
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       > -             dprintk("No 50Hz signal\n");
>       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >               saa7191_s_std(sd, old_norm);
>       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >               return 0;
>       >       >       }
>       >       >
>       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       > -             dprintk("PAL\n");
>       >       > +             dev_dbg("PAL\n");
>       >       >               *norm &= V4L2_STD_PAL;
>       >       >               return saa7191_s_std(sd, old_norm);
>       >       >       }
>       >       >
>       >       > -     dprintk("No color detected with PAL - Trying
>       >       SECAM...\n");
>       >       > +     dev_dbg("No color detected with PAL - Trying
>       >       SECAM...\n");
>       >       >
>       >       >       /* no color detected ? -> try SECAM */
>       >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
>       >       > @@ -349,19 +343,19 @@ static int
>       saa7191_querystd(struct
>       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >
>       >       >       /* not 50Hz ? */
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       > -             dprintk("No 50Hz signal\n");
>       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >               goto out;
>       >       >       }
>       >       >
>       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       >               /* Color detected -> SECAM */
>       >       > -             dprintk("SECAM\n");
>       >       > +             dev_dbg("SECAM\n");
>       >       >               *norm &= V4L2_STD_SECAM;
>       >       >               return saa7191_s_std(sd, old_norm);
>       >       >       }
>       >       >
>       >       > -     dprintk("No color detected with SECAM - Going
>       back to
>       >       PAL.\n");
>       >       > +     dev_dbg("No color detected with SECAM - Going
>       back to
>       >       PAL.\n");
>       >       >       *norm = V4L2_STD_UNKNOWN;
>       >       >
>       >       >  out:
>       >       > @@ -372,30 +366,30 @@ static int
>       >       saa7191_autodetect_norm(struct v4l2_subdev *sd)
>       >       >  {
>       >       >       u8 status;
>       >       >
>       >       > -     dprintk("SAA7191 signal auto-detection...\n");
>       >       > +     dev_dbg("SAA7191 signal auto-detection...\n");
>       >       >
>       >       > -     dprintk("Reading status...\n");
>       >       > +     dev_dbg("Reading status...\n");
>       >       >
>       >       >       if (saa7191_read_status(sd, &status))
>       >       >               return -EIO;
>       >       >
>       >       > -     dprintk("Checking for signal...\n");
>       >       > +     dev_dbg("Checking for signal...\n");
>       >       >
>       >       >       /* no signal ? */
>       >       >       if (status & SAA7191_STATUS_HLCK) {
>       >       > -             dprintk("No signal\n");
>       >       > +             dev_dbg("No signal\n");
>       >       >               return -EBUSY;
>       >       >       }
>       >       >
>       >       > -     dprintk("Signal found\n");
>       >       > +     dev_dbg("Signal found\n");
>       >       >
>       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >               /* 60hz signal -> NTSC */
>       >       > -             dprintk("NTSC\n");
>       >       > +             dev_dbg("NTSC\n");
>       >       >               return saa7191_s_std(sd, V4L2_STD_NTSC);
>       >       >       } else {
>       >       >               /* 50hz signal -> PAL */
>       >       > -             dprintk("PAL\n");
>       >       > +             dev_dbg("PAL\n");
>       >       >               return saa7191_s_std(sd, V4L2_STD_PAL);
>       >       >       }
>       >       >  }
>       >       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct
>       >       i2c_client *client,
>       >       >
>       >       >       err = saa7191_write_block(sd, sizeof(initseq),
>       >       initseq);
>       >       >       if (err) {
>       >       > -             printk(KERN_ERR "SAA7191 initialization
>       >       failed\n");
>       >       > +             dev_dbg("SAA7191 initialization
>       failed\n");
>       >       >               return err;
>       >       >       }
>       >       >
>       >       > -     printk(KERN_INFO "SAA7191 initialized\n");
>       >       > +     dev_dbg("SAA7191 initialized\n");
>       >       >
>       >       >       decoder->input = SAA7191_INPUT_COMPOSITE;
>       >       >       decoder->norm = V4L2_STD_PAL;
>       >       >
>       >       >       err = saa7191_autodetect_norm(sd);
>       >       >       if (err && (err != -EBUSY))
>       >       > -             printk(KERN_ERR "SAA7191: Signal
>       auto-detection
>       >       failed\n");
>       >       > +             dev_dbg("SAA7191: Signal auto-detection
>       >       failed\n");
>       >       >
>       >       >       return 0;
>       >       >  }
>       >       > --
>       >       > 1.9.1
>       >       >
>       > > --
>       > > You received this message because you are subscribed to the
>       Google
>       > Groups "outreachy-kernel" group.
>       > > To unsubscribe from this group and stop receiving emails
>       from it,
>       > send an email to outreachy-kern...@googlegroups.com.
>       > > To post to this group, send email to
>       > outreach...@googlegroups.com.
>       > > To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1-
>       git-
>       > send-email-ksenija.stanojevic%40gmail.com.
>       > > For more options, visit https://groups.google.com/d/optout.
>       > >
>       >
>       >
>       > --
>       > You received this message because you are subscribed to the
>       Google Groups
>       > "outreachy-kernel" group.
>       > To unsubscribe from this group and stop receiving emails from
>       it, send an
>       > email to outreachy-kern...@googlegroups.com.
>       > To post to this group, send email to
>       outreach...@googlegroups.com.
>       > To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7
>       uApK
>       > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
>       >
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c-9da8-
> a898799af64c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-18 17:36         ` Julia Lawall
@ 2015-02-18 17:58           ` Ksenija Stanojevic
  2015-02-18 18:00             ` Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Ksenija Stanojevic @ 2015-02-18 17:58 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: ksenija.stanojevic


[-- Attachment #1.1: Type: text/plain, Size: 16248 bytes --]

make drivers/staging/media/vino/saa7191.o shows me errors.
I fixed them, and hope now is fine.
I'll be sending v3.

On Wednesday, February 18, 2015 at 6:36:22 PM UTC+1, Julia Lawall wrote:
>
> On Wed, 18 Feb 2015, Ksenija Stanojevic wrote: 
>
> > I missunderstood how dev_dbg works. 
> > i did compile my code and it haven't shown any errors, but I don't have 
> > corresponding .ko file 
>
> OK, you can try 
>
> make drivers/staging/media/vino/saa7191.o 
>
> julia 
>
>
> > 
> > On Tuesday, February 17, 2015 at 11:04:31 PM UTC+1, Julia Lawall wrote: 
> >       On Tue, 17 Feb 2015, Ksenija Stanojević wrote: 
> > 
> >       > I removed variables KERN_ERR and KERN_INFO 
> >       >  and added device argument to dev_dbg in line 230, 
> > 
> >       When you send a v2 patch, you could describe the change that you 
> >       have made 
> >       as compared to the previous patch under the --- 
> > 
> >       > I don't know where else to put that argument. 
> > 
> >       Every call to dev_dbg needs a pointer to a device structure as 
> >       the first 
> >       argument. 
> > 
> >       Did you compile your code?  If so, perhaps this file was not 
> >       selected in 
> >       your configuration and thus it was not compiled.  You can see if 
> >       it was 
> >       compiled by looking to see if it has a corresponding .o file. 
> >        If not, you 
> >       can try selecting the driver in your configuration. 
> > 
> >       julia 
> > 
> >       > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall 
> >       <julia....@lip6.fr> 
> >       > wrote: 
> >       >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote: 
> >       > 
> >       >       > Making variants of existing macros is against kernel 
> >       coding 
> >       >       style. This 
> >       >       > patch removes all definitions made by macro dprinkt() 
> >       and 
> >       >       replaces them 
> >       >       > with dev_dbg(). 
> >       >       > 
> >       >       > Signed-off-by: Ksenija Stanojevic 
> >       >       <ksenija.s...@gmail.com> 
> >       >       > --- 
> >       > 
> >       >       What change is made for v2? 
> >       > 
> >       >       julia 
> >       > 
> >       >       >  drivers/staging/media/vino/saa7191.c | 58 
> >       >       ++++++++++++++++-------------------- 
> >       >       >  1 file changed, 26 insertions(+), 32 deletions(-) 
> >       >       > 
> >       >       > diff --git a/drivers/staging/media/vino/saa7191.c 
> >       >       b/drivers/staging/media/vino/saa7191.c 
> >       >       > index 087acab..2aa68c6 100644 
> >       >       > --- a/drivers/staging/media/vino/saa7191.c 
> >       >       > +++ b/drivers/staging/media/vino/saa7191.c 
> >       >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael Nousiainen 
> >       >       <tmno...@cc.hut.fi>"); 
> >       >       >  MODULE_LICENSE("GPL"); 
> >       >       > 
> >       >       > 
> >       >       > -/* #define SAA7191_DEBUG */ 
> >       >       > 
> >       >       > -#ifdef SAA7191_DEBUG 
> >       >       > -#define dprintk(x...) printk("SAA7191: " x); 
> >       >       > -#else 
> >       >       > -#define dprintk(x...) 
> >       >       > -#endif 
> >       >       > 
> >       >       >  #define SAA7191_SYNC_COUNT   30 
> >       >       >  #define SAA7191_SYNC_DELAY   100     /* milliseconds 
> >       */ 
> >       >       > @@ -116,7 +110,7 @@ static int 
> >       saa7191_read_status(struct 
> >       >       v4l2_subdev *sd, u8 *value) 
> >       >       > 
> >       >       >       ret = i2c_master_recv(client, value, 1); 
> >       >       >       if (ret < 0) { 
> >       >       > -             printk(KERN_ERR "SAA7191: 
> >       >       saa7191_read_status(): read failed\n"); 
> >       >       > +             dev_dbg("saa7191_read_status(): read 
> >       >       failed\n"); 
> >       >       >               return ret; 
> >       >       >       } 
> >       >       > 
> >       >       > @@ -147,7 +141,7 @@ static int 
> >       saa7191_write_block(struct 
> >       >       v4l2_subdev *sd, 
> >       >       > 
> >       >       >       ret = i2c_master_send(client, data, length); 
> >       >       >       if (ret < 0) { 
> >       >       > -             printk(KERN_ERR "SAA7191: 
> >       >       saa7191_write_block(): " 
> >       >       > +             dev_dbg("saa7191_write_block(): " 
> >       >       >                      "write failed\n"); 
> >       >       >               return ret; 
> >       >       >       } 
> >       >       > @@ -230,9 +224,9 @@ static int saa7191_s_std(struct 
> >       >       v4l2_subdev *sd, v4l2_std_id norm) 
> >       >       > 
> >       >       >       decoder->norm = norm; 
> >       >       > 
> >       >       > -     dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", 
> >       ctl3, 
> >       >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x chcv: 
> >       %02x\n", 
> >       >       ctl3, 
> >       >       >               stdc, chcv); 
> >       >       > -     dprintk("norm: %llx\n", norm); 
> >       >       > +     dev_dbg("norm: %llx\n", norm); 
> >       >       > 
> >       >       >       return 0; 
> >       >       >  } 
> >       >       > @@ -241,21 +235,21 @@ static int 
> >       >       saa7191_wait_for_signal(struct v4l2_subdev *sd, u8 
> >       *status) 
> >       >       >  { 
> >       >       >       int i = 0; 
> >       >       > 
> >       >       > -     dprintk("Checking for signal...\n"); 
> >       >       > +     dev_dbg("Checking for signal...\n"); 
> >       >       > 
> >       >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++) { 
> >       >       >               if (saa7191_read_status(sd, status)) 
> >       >       >                       return -EIO; 
> >       >       > 
> >       >       >               if (((*status) & SAA7191_STATUS_HLCK) == 
> >       0) { 
> >       >       > -                     dprintk("Signal found\n"); 
> >       >       > +                     dev_dbg("Signal found\n"); 
> >       >       >                       return 0; 
> >       >       >               } 
> >       >       > 
> >       >       >               msleep(SAA7191_SYNC_DELAY); 
> >       >       >       } 
> >       >       > 
> >       >       > -     dprintk("No signal\n"); 
> >       >       > +     dev_dbg("No signal\n"); 
> >       >       > 
> >       >       >       return -EBUSY; 
> >       >       >  } 
> >       >       > @@ -269,7 +263,7 @@ static int saa7191_querystd(struct 
> >       >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       >       >       v4l2_std_id old_norm = decoder->norm; 
> >       >       >       int err = 0; 
> >       >       > 
> >       >       > -     dprintk("SAA7191 extended signal 
> >       auto-detection...\n"); 
> >       >       > +     dev_dbg("SAA7191 extended signal 
> >       auto-detection...\n"); 
> >       >       > 
> >       >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL | 
> >       V4L2_STD_SECAM; 
> >       >       >       stdc &= ~SAA7191_STDC_SECS; 
> >       >       > @@ -301,13 +295,13 @@ static int 
> >       saa7191_querystd(struct 
> >       >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       >       > 
> >       >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >       >               /* 60Hz signal -> NTSC */ 
> >       >       > -             dprintk("60Hz signal: NTSC\n"); 
> >       >       > +             dev_dbg("60Hz signal: NTSC\n"); 
> >       >       >               *norm &= V4L2_STD_NTSC; 
> >       >       >               return 0; 
> >       >       >       } 
> >       >       > 
> >       >       >       /* 50Hz signal */ 
> >       >       > -     dprintk("50Hz signal: Trying PAL...\n"); 
> >       >       > +     dev_dbg("50Hz signal: Trying PAL...\n"); 
> >       >       > 
> >       >       >       /* try PAL first */ 
> >       >       >       err = saa7191_s_std(sd, V4L2_STD_PAL); 
> >       >       > @@ -322,19 +316,19 @@ static int 
> >       saa7191_querystd(struct 
> >       >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       >       > 
> >       >       >       /* not 50Hz ? */ 
> >       >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >       > -             dprintk("No 50Hz signal\n"); 
> >       >       > +             dev_dbg("No 50Hz signal\n"); 
> >       >       >               saa7191_s_std(sd, old_norm); 
> >       >       >               *norm = V4L2_STD_UNKNOWN; 
> >       >       >               return 0; 
> >       >       >       } 
> >       >       > 
> >       >       >       if (status & SAA7191_STATUS_CODE) { 
> >       >       > -             dprintk("PAL\n"); 
> >       >       > +             dev_dbg("PAL\n"); 
> >       >       >               *norm &= V4L2_STD_PAL; 
> >       >       >               return saa7191_s_std(sd, old_norm); 
> >       >       >       } 
> >       >       > 
> >       >       > -     dprintk("No color detected with PAL - Trying 
> >       >       SECAM...\n"); 
> >       >       > +     dev_dbg("No color detected with PAL - Trying 
> >       >       SECAM...\n"); 
> >       >       > 
> >       >       >       /* no color detected ? -> try SECAM */ 
> >       >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM); 
> >       >       > @@ -349,19 +343,19 @@ static int 
> >       saa7191_querystd(struct 
> >       >       v4l2_subdev *sd, v4l2_std_id *norm) 
> >       >       > 
> >       >       >       /* not 50Hz ? */ 
> >       >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >       > -             dprintk("No 50Hz signal\n"); 
> >       >       > +             dev_dbg("No 50Hz signal\n"); 
> >       >       >               *norm = V4L2_STD_UNKNOWN; 
> >       >       >               goto out; 
> >       >       >       } 
> >       >       > 
> >       >       >       if (status & SAA7191_STATUS_CODE) { 
> >       >       >               /* Color detected -> SECAM */ 
> >       >       > -             dprintk("SECAM\n"); 
> >       >       > +             dev_dbg("SECAM\n"); 
> >       >       >               *norm &= V4L2_STD_SECAM; 
> >       >       >               return saa7191_s_std(sd, old_norm); 
> >       >       >       } 
> >       >       > 
> >       >       > -     dprintk("No color detected with SECAM - Going 
> >       back to 
> >       >       PAL.\n"); 
> >       >       > +     dev_dbg("No color detected with SECAM - Going 
> >       back to 
> >       >       PAL.\n"); 
> >       >       >       *norm = V4L2_STD_UNKNOWN; 
> >       >       > 
> >       >       >  out: 
> >       >       > @@ -372,30 +366,30 @@ static int 
> >       >       saa7191_autodetect_norm(struct v4l2_subdev *sd) 
> >       >       >  { 
> >       >       >       u8 status; 
> >       >       > 
> >       >       > -     dprintk("SAA7191 signal auto-detection...\n"); 
> >       >       > +     dev_dbg("SAA7191 signal auto-detection...\n"); 
> >       >       > 
> >       >       > -     dprintk("Reading status...\n"); 
> >       >       > +     dev_dbg("Reading status...\n"); 
> >       >       > 
> >       >       >       if (saa7191_read_status(sd, &status)) 
> >       >       >               return -EIO; 
> >       >       > 
> >       >       > -     dprintk("Checking for signal...\n"); 
> >       >       > +     dev_dbg("Checking for signal...\n"); 
> >       >       > 
> >       >       >       /* no signal ? */ 
> >       >       >       if (status & SAA7191_STATUS_HLCK) { 
> >       >       > -             dprintk("No signal\n"); 
> >       >       > +             dev_dbg("No signal\n"); 
> >       >       >               return -EBUSY; 
> >       >       >       } 
> >       >       > 
> >       >       > -     dprintk("Signal found\n"); 
> >       >       > +     dev_dbg("Signal found\n"); 
> >       >       > 
> >       >       >       if (status & SAA7191_STATUS_FIDT) { 
> >       >       >               /* 60hz signal -> NTSC */ 
> >       >       > -             dprintk("NTSC\n"); 
> >       >       > +             dev_dbg("NTSC\n"); 
> >       >       >               return saa7191_s_std(sd, V4L2_STD_NTSC); 
> >       >       >       } else { 
> >       >       >               /* 50hz signal -> PAL */ 
> >       >       > -             dprintk("PAL\n"); 
> >       >       > +             dev_dbg("PAL\n"); 
> >       >       >               return saa7191_s_std(sd, V4L2_STD_PAL); 
> >       >       >       } 
> >       >       >  } 
> >       >       > @@ -606,18 +600,18 @@ static int saa7191_probe(struct 
> >       >       i2c_client *client, 
> >       >       > 
> >       >       >       err = saa7191_write_block(sd, sizeof(initseq), 
> >       >       initseq); 
> >       >       >       if (err) { 
> >       >       > -             printk(KERN_ERR "SAA7191 initialization 
> >       >       failed\n"); 
> >       >       > +             dev_dbg("SAA7191 initialization 
> >       failed\n"); 
> >       >       >               return err; 
> >       >       >       } 
> >       >       > 
> >       >       > -     printk(KERN_INFO "SAA7191 initialized\n"); 
> >       >       > +     dev_dbg("SAA7191 initialized\n"); 
> >       >       > 
> >       >       >       decoder->input = SAA7191_INPUT_COMPOSITE; 
> >       >       >       decoder->norm = V4L2_STD_PAL; 
> >       >       > 
> >       >       >       err = saa7191_autodetect_norm(sd); 
> >       >       >       if (err && (err != -EBUSY)) 
> >       >       > -             printk(KERN_ERR "SAA7191: Signal 
> >       auto-detection 
> >       >       failed\n"); 
> >       >       > +             dev_dbg("SAA7191: Signal auto-detection 
> >       >       failed\n"); 
> >       >       > 
> >       >       >       return 0; 
> >       >       >  } 
> >       >       > -- 
> >       >       > 1.9.1 
> >       >       > 
> >       > > -- 
> >       > > You received this message because you are subscribed to the 
> >       Google 
> >       > Groups "outreachy-kernel" group. 
> >       > > To unsubscribe from this group and stop receiving emails 
> >       from it, 
> >       > send an email to outreachy-kern...@googlegroups.com. 
> >       > > To post to this group, send email to 
> >       > outreach...@googlegroups.com. 
> >       > > To view this discussion on the webvisithttps://
> groups.google.com/d/msgid/outreachy-kernel/1424204282-31960-1- 
> >       git- 
> >       > send-email-ksenija.stanojevic%40gmail.com. 
> >       > > For more options, visit https://groups.google.com/d/optout. 
> >       > > 
> >       > 
> >       > 
> >       > -- 
> >       > You received this message because you are subscribed to the 
> >       Google Groups 
> >       > "outreachy-kernel" group. 
> >       > To unsubscribe from this group and stop receiving emails from 
> >       it, send an 
> >       > email to outreachy-kern...@googlegroups.com. 
> >       > To post to this group, send email to 
> >       outreach...@googlegroups.com. 
> >       > To view this discussion on the webvisithttps://
> groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTrJE7 
> >       uApK 
> >       > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com. 
> >       > For more options, visit https://groups.google.com/d/optout. 
> >       > 
> >       > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "outreachy-kernel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to outreachy-kern...@googlegroups.com <javascript:>. 
> > To post to this group, send email to outreach...@googlegroups.com 
> <javascript:>. 
> > To view this discussion on the web visithttps://
> groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c-9da8- 
> > a898799af64c%40googlegroups.com. 
> > For more options, visit https://groups.google.com/d/optout. 
> > 
> >


[-- Attachment #1.2: Type: text/html, Size: 32788 bytes --]

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

* Re: [Outreachy kernel] [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg().
  2015-02-18 17:58           ` Ksenija Stanojevic
@ 2015-02-18 18:00             ` Julia Lawall
  0 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2015-02-18 18:00 UTC (permalink / raw)
  To: Ksenija Stanojevic; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 21078 bytes --]

On Wed, 18 Feb 2015, Ksenija Stanojevic wrote:

> make drivers/staging/media/vino/saa7191.o shows me errors.
> I fixed them, and hope now is fine.
> I'll be sending v3.

Sounds good :)

julia

> On Wednesday, February 18, 2015 at 6:36:22 PM UTC+1, Julia Lawall wrote:
>       On Wed, 18 Feb 2015, Ksenija Stanojevic wrote:
>
>       > I missunderstood how dev_dbg works.
>       > i did compile my code and it haven't shown any errors, but I
>       don't have
>       > corresponding .ko file
>
>       OK, you can try
>
>       make drivers/staging/media/vino/saa7191.o
>
>       julia
>
>
>       >
>       > On Tuesday, February 17, 2015 at 11:04:31 PM UTC+1, Julia
>       Lawall wrote:
>       >       On Tue, 17 Feb 2015, Ksenija Stanojević wrote:
>       >
>       >       > I removed variables KERN_ERR and KERN_INFO
>       >       >  and added device argument to dev_dbg in line 230,
>       >
>       >       When you send a v2 patch, you could describe the change
>       that you
>       >       have made
>       >       as compared to the previous patch under the ---
>       >
>       >       > I don't know where else to put that argument.
>       >
>       >       Every call to dev_dbg needs a pointer to a device
>       structure as
>       >       the first
>       >       argument.
>       >
>       >       Did you compile your code?  If so, perhaps this file was
>       not
>       >       selected in
>       >       your configuration and thus it was not compiled.  You
>       can see if
>       >       it was
>       >       compiled by looking to see if it has a corresponding .o
>       file.
>       >        If not, you
>       >       can try selecting the driver in your configuration.
>       >
>       >       julia
>       >
>       >       > On Tue, Feb 17, 2015 at 10:27 PM, Julia Lawall
>       >       <julia....@lip6.fr>
>       >       > wrote:
>       >       >       On Tue, 17 Feb 2015, Ksenija Stanojevic wrote:
>       >       >
>       >       >       > Making variants of existing macros is against
>       kernel
>       >       coding
>       >       >       style. This
>       >       >       > patch removes all definitions made by macro
>       dprinkt()
>       >       and
>       >       >       replaces them
>       >       >       > with dev_dbg().
>       >       >       >
>       >       >       > Signed-off-by: Ksenija Stanojevic
>       >       >       <ksenija.s...@gmail.com>
>       >       >       > ---
>       >       >
>       >       >       What change is made for v2?
>       >       >
>       >       >       julia
>       >       >
>       >       >       >  drivers/staging/media/vino/saa7191.c | 58
>       >       >       ++++++++++++++++--------------------
>       >       >       >  1 file changed, 26 insertions(+), 32
>       deletions(-)
>       >       >       >
>       >       >       > diff --git
>       a/drivers/staging/media/vino/saa7191.c
>       >       >       b/drivers/staging/media/vino/saa7191.c
>       >       >       > index 087acab..2aa68c6 100644
>       >       >       > --- a/drivers/staging/media/vino/saa7191.c
>       >       >       > +++ b/drivers/staging/media/vino/saa7191.c
>       >       >       > @@ -33,13 +33,7 @@ MODULE_AUTHOR("Mikael
>       Nousiainen
>       >       >       <tmno...@cc.hut.fi>");
>       >       >       >  MODULE_LICENSE("GPL");
>       >       >       >
>       >       >       >
>       >       >       > -/* #define SAA7191_DEBUG */
>       >       >       >
>       >       >       > -#ifdef SAA7191_DEBUG
>       >       >       > -#define dprintk(x...) printk("SAA7191: " x);
>       >       >       > -#else
>       >       >       > -#define dprintk(x...)
>       >       >       > -#endif
>       >       >       >
>       >       >       >  #define SAA7191_SYNC_COUNT   30
>       >       >       >  #define SAA7191_SYNC_DELAY   100     /*
>       milliseconds
>       >       */
>       >       >       > @@ -116,7 +110,7 @@ static int
>       >       saa7191_read_status(struct
>       >       >       v4l2_subdev *sd, u8 *value)
>       >       >       >
>       >       >       >       ret = i2c_master_recv(client, value, 1);
>       >       >       >       if (ret < 0) {
>       >       >       > -             printk(KERN_ERR "SAA7191:
>       >       >       saa7191_read_status(): read failed\n");
>       >       >       > +             dev_dbg("saa7191_read_status():
>       read
>       >       >       failed\n");
>       >       >       >               return ret;
>       >       >       >       }
>       >       >       >
>       >       >       > @@ -147,7 +141,7 @@ static int
>       >       saa7191_write_block(struct
>       >       >       v4l2_subdev *sd,
>       >       >       >
>       >       >       >       ret = i2c_master_send(client, data,
>       length);
>       >       >       >       if (ret < 0) {
>       >       >       > -             printk(KERN_ERR "SAA7191:
>       >       >       saa7191_write_block(): "
>       >       >       > +             dev_dbg("saa7191_write_block():
>       "
>       >       >       >                      "write failed\n");
>       >       >       >               return ret;
>       >       >       >       }
>       >       >       > @@ -230,9 +224,9 @@ static int
>       saa7191_s_std(struct
>       >       >       v4l2_subdev *sd, v4l2_std_id norm)
>       >       >       >
>       >       >       >       decoder->norm = norm;
>       >       >       >
>       >       >       > -     dprintk("ctl3: %02x stdc: %02x chcv:
>       %02x\n",
>       >       ctl3,
>       >       >       > +     dev_dbg(&sd->dev, "ctl3: %02x stdc: %02x
>       chcv:
>       >       %02x\n",
>       >       >       ctl3,
>       >       >       >               stdc, chcv);
>       >       >       > -     dprintk("norm: %llx\n", norm);
>       >       >       > +     dev_dbg("norm: %llx\n", norm);
>       >       >       >
>       >       >       >       return 0;
>       >       >       >  }
>       >       >       > @@ -241,21 +235,21 @@ static int
>       >       >       saa7191_wait_for_signal(struct v4l2_subdev *sd,
>       u8
>       >       *status)
>       >       >       >  {
>       >       >       >       int i = 0;
>       >       >       >
>       >       >       > -     dprintk("Checking for signal...\n");
>       >       >       > +     dev_dbg("Checking for signal...\n");
>       >       >       >
>       >       >       >       for (i = 0; i < SAA7191_SYNC_COUNT; i++)
>       {
>       >       >       >               if (saa7191_read_status(sd,
>       status))
>       >       >       >                       return -EIO;
>       >       >       >
>       >       >       >               if (((*status) &
>       SAA7191_STATUS_HLCK) ==
>       >       0) {
>       >       >       > -                     dprintk("Signal
>       found\n");
>       >       >       > +                     dev_dbg("Signal
>       found\n");
>       >       >       >                       return 0;
>       >       >       >               }
>       >       >       >
>       >       >       >               msleep(SAA7191_SYNC_DELAY);
>       >       >       >       }
>       >       >       >
>       >       >       > -     dprintk("No signal\n");
>       >       >       > +     dev_dbg("No signal\n");
>       >       >       >
>       >       >       >       return -EBUSY;
>       >       >       >  }
>       >       >       > @@ -269,7 +263,7 @@ static int
>       saa7191_querystd(struct
>       >       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       >       v4l2_std_id old_norm = decoder->norm;
>       >       >       >       int err = 0;
>       >       >       >
>       >       >       > -     dprintk("SAA7191 extended signal
>       >       auto-detection...\n");
>       >       >       > +     dev_dbg("SAA7191 extended signal
>       >       auto-detection...\n");
>       >       >       >
>       >       >       >       *norm &= V4L2_STD_NTSC | V4L2_STD_PAL |
>       >       V4L2_STD_SECAM;
>       >       >       >       stdc &= ~SAA7191_STDC_SECS;
>       >       >       > @@ -301,13 +295,13 @@ static int
>       >       saa7191_querystd(struct
>       >       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       >
>       >       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >       >               /* 60Hz signal -> NTSC */
>       >       >       > -             dprintk("60Hz signal: NTSC\n");
>       >       >       > +             dev_dbg("60Hz signal: NTSC\n");
>       >       >       >               *norm &= V4L2_STD_NTSC;
>       >       >       >               return 0;
>       >       >       >       }
>       >       >       >
>       >       >       >       /* 50Hz signal */
>       >       >       > -     dprintk("50Hz signal: Trying PAL...\n");
>       >       >       > +     dev_dbg("50Hz signal: Trying PAL...\n");
>       >       >       >
>       >       >       >       /* try PAL first */
>       >       >       >       err = saa7191_s_std(sd, V4L2_STD_PAL);
>       >       >       > @@ -322,19 +316,19 @@ static int
>       >       saa7191_querystd(struct
>       >       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       >
>       >       >       >       /* not 50Hz ? */
>       >       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >       > -             dprintk("No 50Hz signal\n");
>       >       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >       >               saa7191_s_std(sd, old_norm);
>       >       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >       >               return 0;
>       >       >       >       }
>       >       >       >
>       >       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       >       > -             dprintk("PAL\n");
>       >       >       > +             dev_dbg("PAL\n");
>       >       >       >               *norm &= V4L2_STD_PAL;
>       >       >       >               return saa7191_s_std(sd,
>       old_norm);
>       >       >       >       }
>       >       >       >
>       >       >       > -     dprintk("No color detected with PAL -
>       Trying
>       >       >       SECAM...\n");
>       >       >       > +     dev_dbg("No color detected with PAL -
>       Trying
>       >       >       SECAM...\n");
>       >       >       >
>       >       >       >       /* no color detected ? -> try SECAM */
>       >       >       >       err = saa7191_s_std(sd, V4L2_STD_SECAM);
>       >       >       > @@ -349,19 +343,19 @@ static int
>       >       saa7191_querystd(struct
>       >       >       v4l2_subdev *sd, v4l2_std_id *norm)
>       >       >       >
>       >       >       >       /* not 50Hz ? */
>       >       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >       > -             dprintk("No 50Hz signal\n");
>       >       >       > +             dev_dbg("No 50Hz signal\n");
>       >       >       >               *norm = V4L2_STD_UNKNOWN;
>       >       >       >               goto out;
>       >       >       >       }
>       >       >       >
>       >       >       >       if (status & SAA7191_STATUS_CODE) {
>       >       >       >               /* Color detected -> SECAM */
>       >       >       > -             dprintk("SECAM\n");
>       >       >       > +             dev_dbg("SECAM\n");
>       >       >       >               *norm &= V4L2_STD_SECAM;
>       >       >       >               return saa7191_s_std(sd,
>       old_norm);
>       >       >       >       }
>       >       >       >
>       >       >       > -     dprintk("No color detected with SECAM -
>       Going
>       >       back to
>       >       >       PAL.\n");
>       >       >       > +     dev_dbg("No color detected with SECAM -
>       Going
>       >       back to
>       >       >       PAL.\n");
>       >       >       >       *norm = V4L2_STD_UNKNOWN;
>       >       >       >
>       >       >       >  out:
>       >       >       > @@ -372,30 +366,30 @@ static int
>       >       >       saa7191_autodetect_norm(struct v4l2_subdev *sd)
>       >       >       >  {
>       >       >       >       u8 status;
>       >       >       >
>       >       >       > -     dprintk("SAA7191 signal
>       auto-detection...\n");
>       >       >       > +     dev_dbg("SAA7191 signal
>       auto-detection...\n");
>       >       >       >
>       >       >       > -     dprintk("Reading status...\n");
>       >       >       > +     dev_dbg("Reading status...\n");
>       >       >       >
>       >       >       >       if (saa7191_read_status(sd, &status))
>       >       >       >               return -EIO;
>       >       >       >
>       >       >       > -     dprintk("Checking for signal...\n");
>       >       >       > +     dev_dbg("Checking for signal...\n");
>       >       >       >
>       >       >       >       /* no signal ? */
>       >       >       >       if (status & SAA7191_STATUS_HLCK) {
>       >       >       > -             dprintk("No signal\n");
>       >       >       > +             dev_dbg("No signal\n");
>       >       >       >               return -EBUSY;
>       >       >       >       }
>       >       >       >
>       >       >       > -     dprintk("Signal found\n");
>       >       >       > +     dev_dbg("Signal found\n");
>       >       >       >
>       >       >       >       if (status & SAA7191_STATUS_FIDT) {
>       >       >       >               /* 60hz signal -> NTSC */
>       >       >       > -             dprintk("NTSC\n");
>       >       >       > +             dev_dbg("NTSC\n");
>       >       >       >               return saa7191_s_std(sd,
>       V4L2_STD_NTSC);
>       >       >       >       } else {
>       >       >       >               /* 50hz signal -> PAL */
>       >       >       > -             dprintk("PAL\n");
>       >       >       > +             dev_dbg("PAL\n");
>       >       >       >               return saa7191_s_std(sd,
>       V4L2_STD_PAL);
>       >       >       >       }
>       >       >       >  }
>       >       >       > @@ -606,18 +600,18 @@ static int
>       saa7191_probe(struct
>       >       >       i2c_client *client,
>       >       >       >
>       >       >       >       err = saa7191_write_block(sd,
>       sizeof(initseq),
>       >       >       initseq);
>       >       >       >       if (err) {
>       >       >       > -             printk(KERN_ERR "SAA7191
>       initialization
>       >       >       failed\n");
>       >       >       > +             dev_dbg("SAA7191 initialization
>       >       failed\n");
>       >       >       >               return err;
>       >       >       >       }
>       >       >       >
>       >       >       > -     printk(KERN_INFO "SAA7191
>       initialized\n");
>       >       >       > +     dev_dbg("SAA7191 initialized\n");
>       >       >       >
>       >       >       >       decoder->input =
>       SAA7191_INPUT_COMPOSITE;
>       >       >       >       decoder->norm = V4L2_STD_PAL;
>       >       >       >
>       >       >       >       err = saa7191_autodetect_norm(sd);
>       >       >       >       if (err && (err != -EBUSY))
>       >       >       > -             printk(KERN_ERR "SAA7191: Signal
>       >       auto-detection
>       >       >       failed\n");
>       >       >       > +             dev_dbg("SAA7191: Signal
>       auto-detection
>       >       >       failed\n");
>       >       >       >
>       >       >       >       return 0;
>       >       >       >  }
>       >       >       > --
>       >       >       > 1.9.1
>       >       >       >
>       >       > > --
>       >       > > You received this message because you are subscribed
>       to the
>       >       Google
>       >       > Groups "outreachy-kernel" group.
>       >       > > To unsubscribe from this group and stop receiving
>       emails
>       >       from it,
>       >       > send an email to outreachy-kern...@googlegroups.com.
>       >       > > To post to this group, send email to
>       >       > outreach...@googlegroups.com.
>       >       > > To view this discussion on thewebvisithttps://groups.google.com/d/msgid/outreachy-kernel/1424204282-31960
>       -1-
>       >       git-
>       >       > send-email-ksenija.stanojevic%40gmail.com.
>       >       > > For more options, visit
>       https://groups.google.com/d/optout.
>       >       > >
>       >       >
>       >       >
>       >       > --
>       >       > You received this message because you are subscribed
>       to the
>       >       Google Groups
>       >       > "outreachy-kernel" group.
>       >       > To unsubscribe from this group and stop receiving
>       emails from
>       >       it, send an
>       >       > email to outreachy-kern...@googlegroups.com.
>       >       > To post to this group, send email to
>       >       outreach...@googlegroups.com.
>       >       > To view this discussion on thewebvisithttps://groups.google.com/d/msgid/outreachy-kernel/CAL7P5jKiTvGSxTr
>       JE7
>       >       uApK
>       >       > y7Z%2BEnVZH2x-VRRcPqWYDquqViwg%40mail.gmail.com.
>       >       > For more options, visit
>       https://groups.google.com/d/optout.
>       >       >
>       >       >
>       >
>       > --
>       > You received this message because you are subscribed to the
>       Google Groups
>       > "outreachy-kernel" group.
>       > To unsubscribe from this group and stop receiving emails from
>       it, send an
>       > email to outreachy-kern...@googlegroups.com.
>       > To post to this group, send email to
>       outreach...@googlegroups.com.
>       > To view this discussion on the webvisithttps://groups.google.com/d/msgid/outreachy-kernel/55c23bda-fe3e-414c-
>       9da8-
>       > a898799af64c%40googlegroups.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
>       >
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/11edf72c-1a1c-4af8-838a-
> b9600d9fc1a2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

end of thread, other threads:[~2015-02-18 18:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 20:18 [PATCH v2] Staging: media: vino: Replace printk() and dprintk() with dev_dbg() Ksenija Stanojevic
2015-02-17 21:27 ` [Outreachy kernel] " Julia Lawall
2015-02-17 21:52   ` Ksenija Stanojević
2015-02-17 22:04     ` Julia Lawall
2015-02-18 17:01       ` Ksenija Stanojevic
2015-02-18 17:36         ` Julia Lawall
2015-02-18 17:58           ` Ksenija Stanojevic
2015-02-18 18:00             ` Julia Lawall

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.