All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros
@ 2022-04-23  5:17 Ian Cowan
  2022-04-24 19:17 ` LABBE Corentin
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Cowan @ 2022-04-23  5:17 UTC (permalink / raw)
  To: clabbe
  Cc: mchehab, gregkh, dan.carpenter, mjpeg-users, linux-media,
	linux-staging, ian

This adds the zrdev_dbg() (pointing to dev_dbg()), zrdev_err() (pointing
to dev_err()), and zrdev_info() (pointing to dev_info()) macros to the
zoran drivers. These are the preferred method for debugging and this
will allow to extract the device from the zoran struct to make the call.

Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
---
 drivers/staging/media/zoran/zoran.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index 654c95fa5aba..42b86356c022 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -19,6 +19,7 @@
 #define _BUZ_H_
 
 #include <linux/debugfs.h>
+#include <linux/dev_printk.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ctrls.h>
 #include <media/videobuf2-core.h>
@@ -301,6 +302,18 @@ static inline struct zoran *to_zoran(struct v4l2_device *v4l2_dev)
 
 #endif
 
+/**
+ * Debugging macros
+ */
+#define zrdev_dbg(zr, format, args...) \
+	dev_dbg(&zr->video_dev->dev, format, ##args) \
+
+#define zrdev_err(zr, format, args...) \
+	dev_err(&zr->video_dev->dev, format, ##args) \
+
+#define zrdev_info(zr, format, args...) \
+	dev_info(&zr->video_dev->dev, format, ##args) \
+
 int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir);
 void zoran_queue_exit(struct zoran *zr);
 int zr_set_buf(struct zoran *zr);
-- 
2.35.1


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

* Re: [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros
  2022-04-23  5:17 [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros Ian Cowan
@ 2022-04-24 19:17 ` LABBE Corentin
  2022-04-25  1:22   ` Ian Cowan
  0 siblings, 1 reply; 4+ messages in thread
From: LABBE Corentin @ 2022-04-24 19:17 UTC (permalink / raw)
  To: Ian Cowan
  Cc: mchehab, gregkh, dan.carpenter, mjpeg-users, linux-media, linux-staging

Le Sat, Apr 23, 2022 at 01:17:45AM -0400, Ian Cowan a écrit :
> This adds the zrdev_dbg() (pointing to dev_dbg()), zrdev_err() (pointing
> to dev_err()), and zrdev_info() (pointing to dev_info()) macros to the
> zoran drivers. These are the preferred method for debugging and this
> will allow to extract the device from the zoran struct to make the call.
> 
> Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
> ---
>  drivers/staging/media/zoran/zoran.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
> index 654c95fa5aba..42b86356c022 100644
> --- a/drivers/staging/media/zoran/zoran.h
> +++ b/drivers/staging/media/zoran/zoran.h
> @@ -19,6 +19,7 @@
>  #define _BUZ_H_
>  
>  #include <linux/debugfs.h>
> +#include <linux/dev_printk.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-ctrls.h>
>  #include <media/videobuf2-core.h>
> @@ -301,6 +302,18 @@ static inline struct zoran *to_zoran(struct v4l2_device *v4l2_dev)
>  
>  #endif
>  
> +/**
> + * Debugging macros
> + */
> +#define zrdev_dbg(zr, format, args...) \
> +	dev_dbg(&zr->video_dev->dev, format, ##args) \
> +
> +#define zrdev_err(zr, format, args...) \
> +	dev_err(&zr->video_dev->dev, format, ##args) \
> +
> +#define zrdev_info(zr, format, args...) \
> +	dev_info(&zr->video_dev->dev, format, ##args) \
> +
>  int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir);
>  void zoran_queue_exit(struct zoran *zr);
>  int zr_set_buf(struct zoran *zr);
> -- 
> 2.35.1
> 

Hello

Thanks for your patchs, removing dprintk is a good idea.
Please use pci_xxx() instead of dev_xxx() to be consistent with the rest of the driver.
The comment title is misleading, zrdev_err is not about debugging. What about Logging macros ?

Regards

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

* Re: [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros
  2022-04-24 19:17 ` LABBE Corentin
@ 2022-04-25  1:22   ` Ian Cowan
  2022-04-25  4:45     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Cowan @ 2022-04-25  1:22 UTC (permalink / raw)
  To: LABBE Corentin
  Cc: mchehab, gregkh, dan.carpenter, mjpeg-users, linux-media, linux-staging

On Sun, Apr 24, 2022 at 09:17:22PM +0200, LABBE Corentin wrote:
> Hello
> 
> Thanks for your patchs, removing dprintk is a good idea.
> Please use pci_xxx() instead of dev_xxx() to be consistent with the rest of the driver.
> The comment title is misleading, zrdev_err is not about debugging. What about Logging macros ?
> 
> Regards
> 

I have made those modifications, and I will resubmit patches 1 and 2
shortly. Those are the only patches that affected by this change; 3 and
4 will not change.

Thanks,
Ian

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

* Re: [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros
  2022-04-25  1:22   ` Ian Cowan
@ 2022-04-25  4:45     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2022-04-25  4:45 UTC (permalink / raw)
  To: Ian Cowan
  Cc: LABBE Corentin, mchehab, dan.carpenter, mjpeg-users, linux-media,
	linux-staging

On Sun, Apr 24, 2022 at 09:22:30PM -0400, Ian Cowan wrote:
> On Sun, Apr 24, 2022 at 09:17:22PM +0200, LABBE Corentin wrote:
> > Hello
> > 
> > Thanks for your patchs, removing dprintk is a good idea.
> > Please use pci_xxx() instead of dev_xxx() to be consistent with the rest of the driver.
> > The comment title is misleading, zrdev_err is not about debugging. What about Logging macros ?
> > 
> > Regards
> > 
> 
> I have made those modifications, and I will resubmit patches 1 and 2
> shortly. Those are the only patches that affected by this change; 3 and
> 4 will not change.

You should send a whole new series, properly versioned as the
documentation in the kernel asks you to.  Otherwise it is impossible for
reviewers and maintainers to know what is the "latest" version to
accept.

thanks,

greg k-h

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

end of thread, other threads:[~2022-04-25  4:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-23  5:17 [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros Ian Cowan
2022-04-24 19:17 ` LABBE Corentin
2022-04-25  1:22   ` Ian Cowan
2022-04-25  4:45     ` Greg KH

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