public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rupesh Gujare <rupesh.gujare@atmel.com>
To: Joe Perches <joe@perches.com>
Cc: <shigekatsu.tateno@atmel.com>,
	Greg KH <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devel@linuxdriverproject.org>
Subject: Re: [PATCH] staging: ozwpan: Use normal Makefile, convert oz_trace to oz_dbg
Date: Wed, 26 Jun 2013 12:53:57 +0100	[thread overview]
Message-ID: <51CAD655.2070208@atmel.com> (raw)
In-Reply-To: <1372208429.1245.94.camel@joe-AO722>

On 26/06/13 02:00, Joe Perches wrote:
> Use a normal Makefile.
> Convert oz_trace and oz_trace2 to a more normal oz_dbg.
> Consolidate oztrace and ozconfig files to ozdbg.h
> Update #include files.
> Reflow modified lines, fit to 80 cols, align arguments.
>
> Add a couple more oz_<foo>_dbg macros to show how more
> verbose device specific debugging could be added when a
> struct device * or struct netdevice * is available.

Isn't this patch doing too many changes in single patch? Can we split 
this patch into smaller patch series ?
In addition to above, it also :-
1. Removes few unwanted logs.
2. Changes macro definition for oz_remember_urb() & oz_forget_urb() to 
static inline function when WANT_URB_PARANOIA is not defined.

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>   drivers/staging/ozwpan/{Kbuild => Makefile} |   6 +-
>   drivers/staging/ozwpan/ozcdev.c             |  52 +++--
>   drivers/staging/ozwpan/ozconfig.h           |  26 ---
>   drivers/staging/ozwpan/ozdbg.h              |  54 +++++
>   drivers/staging/ozwpan/ozeltbuf.c           |  32 ++-
>   drivers/staging/ozwpan/ozhcd.c              | 296 +++++++++++++---------------
>   drivers/staging/ozwpan/ozmain.c             |   7 +-
>   drivers/staging/ozwpan/ozpd.c               |  67 +++----
>   drivers/staging/ozwpan/ozproto.c            |  60 +++---
>   drivers/staging/ozwpan/ozproto.h            |   2 +-
>   drivers/staging/ozwpan/oztrace.c            |  36 ----
>   drivers/staging/ozwpan/oztrace.h            |  35 ----
>   drivers/staging/ozwpan/ozurbparanoia.c      |  14 +-
>   drivers/staging/ozwpan/ozurbparanoia.h      |   4 +-
>   drivers/staging/ozwpan/ozusbsvc.c           |  25 +--
>   drivers/staging/ozwpan/ozusbsvc1.c          |  19 +-
>   16 files changed, 334 insertions(+), 401 deletions(-)
>   rename drivers/staging/ozwpan/{Kbuild => Makefile} (93%)
>   delete mode 100644 drivers/staging/ozwpan/ozconfig.h
>   create mode 100644 drivers/staging/ozwpan/ozdbg.h
>   delete mode 100644 drivers/staging/ozwpan/oztrace.c
>   delete mode 100644 drivers/staging/ozwpan/oztrace.h
<snip>...

> diff --git a/drivers/staging/ozwpan/ozdbg.h b/drivers/staging/ozwpan/ozdbg.h
> new file mode 100644
> index 0000000..976c33b
> --- /dev/null
> +++ b/drivers/staging/ozwpan/ozdbg.h
> @@ -0,0 +1,54 @@
> +/* -----------------------------------------------------------------------------
> + * Copyright (c) 2011 Ozmo Inc
> + * Released under the GNU General Public License Version 2 (GPLv2).
> + * ---------------------------------------------------------------------------*/
> +
> +#ifndef _OZDBG_H
> +#define _OZDBG_H
> +
> +#define OZ_WANT_DBG 0
> +#define OZ_WANT_VERBOSE_DBG 1
> +
> +#define OZ_DBG_ON		0x0
> +#define OZ_DBG_STREAM		0x1
> +#define OZ_DBG_URB		0x2
> +#define OZ_DBG_CTRL_DETAIL	0x4
> +#define OZ_DBG_HUB		0x8
> +#define OZ_DBG_RX_FRAMES	0x10
> +#define OZ_DBG_TX_FRAMES	0x20
> +
> +#define OZ_DEFAULT_DBG_MASK			\
> +	(					\
> +	/* OZ_DBG_STREAM | */			\
> +	/* OZ_DBG_URB | */			\
> +	/* OZ_DBG_CTRL_DETAIL | */		\
> +	OZ_DBG_HUB |				\
> +	/* OZ_DBG_RX_FRAMES | */		\
> +	/* OZ_DBG_TX_FRAMES | */		\
> +	0)
> +
> +extern unsigned int oz_dbg_mask;
> +
> +#define oz_want_dbg(mask)						\
> +	((OZ_WANT_DBG && (OZ_DBG_##mask == OZ_DBG_ON)) ||		\
> +	 (OZ_WANT_VERBOSE_DBG && (OZ_DBG_##mask & oz_dbg_mask)))
> +
> +#define oz_dbg(mask, fmt, ...)						\
> +do {									\
> +	if (oz_want_dbg(mask))						\
> +		pr_debug(fmt, ##__VA_ARGS__);				\
> +} while (0)
> +
> +#define oz_cdev_dbg(cdev, mask, fmt, ...)				\
> +do {									\
> +	if (oz_want_dbg(mask))						\
> +		netdev_dbg((cdev)->dev, fmt, ##__VA_ARGS__);		\
> +} while (0)
> +
> +#define oz_pd_dbg(pd, mask, fmt, ...)					\
> +do {									\
> +	if (oz_want_dbg(mask))						\
> +		pr_debug(fmt, ##__VA_ARGS__);				\
> +} while (0)
> +

Above macros look good, however Greg have objection to define new macros 
& he had suggested to use dev_dbg() & pr_debug().
I will leave it to him, if he is all right to accept new macros for 
debug logs.

Greg,
Your comments please.

<snip>...
> +#endif /* _OZCONFIG_H */

Need to change to -
#endif  /* _OZDBG_H */



-- 
Regards,
Rupesh Gujare


  reply	other threads:[~2013-06-26 11:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 16:30 [PATCH] staging: ozwpan: Convert printk to dev_dbg() Rupesh Gujare
2013-06-25 16:40 ` Joe Perches
2013-06-25 17:02 ` Greg KH
2013-06-25 17:29   ` Joe Perches
2013-06-25 17:38     ` Greg KH
2013-06-25 17:56       ` Joe Perches
2013-06-25 18:03         ` Joe Perches
2013-06-26 17:51           ` Jason Baron
2013-06-26  1:00       ` [PATCH] staging: ozwpan: Use normal Makefile, convert oz_trace to oz_dbg Joe Perches
2013-06-26 11:53         ` Rupesh Gujare [this message]
2013-06-26 13:56           ` Joe Perches
2013-06-26 14:19             ` Joe Perches
2013-07-04 12:35             ` [PATCH v2 0/5] Replace debug macro Rupesh Gujare
2013-07-04 14:31               ` Joe Perches
2013-07-04 12:35             ` [PATCH v2 1/5] staging: ozwpan: Remove extra debug logs Rupesh Gujare
2013-07-04 12:35             ` [PATCH v2 2/5] staging: ozwpan: Replace oz_trace with oz_dbg Rupesh Gujare
2013-07-04 12:35             ` [PATCH v2 3/5] staging: ozwpan: Remove old debug macro Rupesh Gujare
2013-07-04 12:35             ` [PATCH v2 4/5] staging: ozwpan: Convert macro to function Rupesh Gujare
2013-07-04 12:35             ` [PATCH v2 5/5] staging: ozwpan: Rename Kbuild to Makefile Rupesh Gujare
2013-07-04 12:45               ` Rupesh Gujare
2013-07-22 17:43                 ` Rupesh Gujare
2013-07-22 17:55                   ` Greg Kroah-Hartman
2013-07-22 22:08                     ` Gujare, Rupesh
2013-07-23 12:44                     ` [PATCH v3 0/5] staging: ozwpan: Replace debug macro Rupesh Gujare
2013-07-23 12:44                     ` [PATCH v3 1/5] staging: ozwpan: Remove extra debug logs Rupesh Gujare
2013-07-23 12:45                     ` [PATCH v3 2/5] staging: ozwpan: Replace oz_trace with oz_dbg Rupesh Gujare
2013-07-23 12:45                     ` [PATCH v3 3/5] staging: ozwpan: Remove old debug macro Rupesh Gujare
2013-07-23 12:45                     ` [PATCH v3 4/5] staging: ozwpan: Convert macro to function Rupesh Gujare
2013-07-23 12:45                     ` [PATCH v3 5/5] staging: ozwpan: Rename Kbuild to Makefile Rupesh Gujare
2013-06-26 17:46     ` [PATCH] staging: ozwpan: Convert printk to dev_dbg() Jason Baron
2013-06-27  0:26       ` Joe Perches
2013-06-25 17:49   ` Rupesh Gujare
2013-06-25 17:55     ` Alan Stern
2013-06-25 17:57     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CAD655.2070208@atmel.com \
    --to=rupesh.gujare@atmel.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shigekatsu.tateno@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox