diff mbox series

[v2,08/15] usb: renesas_usbhs: move flags macros

Message ID 20190509201142.10543-9-chris.brandt@renesas.com (mailing list archive)
State Superseded
Headers show
Series usb: Add host and device support for RZ/A2 | expand

Commit Message

Chris Brandt May 9, 2019, 8:11 p.m. UTC
Move flags macros to header file so they can be used by other files.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/usb/renesas_usbhs/common.c |  7 -------
 drivers/usb/renesas_usbhs/common.h | 10 ++++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

Comments

Chunfeng Yun (云春峰) May 10, 2019, 1:59 a.m. UTC | #1
On Thu, 2019-05-09 at 15:11 -0500, Chris Brandt wrote:
> Move flags macros to header file so they can be used by other files.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  drivers/usb/renesas_usbhs/common.c |  7 -------
>  drivers/usb/renesas_usbhs/common.h | 10 ++++++++++
>  2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index 249fbee97f3f..efb26ffd9809 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -44,13 +44,6 @@
>   */
>  
> 
> -#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
> -
> -/* status */
> -#define usbhsc_flags_init(p)   do {(p)->flags = 0; } while (0)
> -#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
> -#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
> -#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
>  
>  /*
>   * platform call back
> diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
> index 3777af848a35..1ca94b8f5508 100644
> --- a/drivers/usb/renesas_usbhs/common.h
> +++ b/drivers/usb/renesas_usbhs/common.h
> @@ -339,4 +339,14 @@ struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev);
>  #define usbhs_priv_to_dev(priv)		(&priv->pdev->dev)
>  #define usbhs_priv_to_lock(priv)	(&priv->lock)
>  
> +/*
> + * flags
> + */
> +#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
BIT(0)?
> +
> +#define usbhsc_flags_init(p)   ((p)->flags = 0)
> +#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
> +#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
> +#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
> +
>  #endif /* RENESAS_USB_DRIVER_H */
Sergei Shtylyov May 10, 2019, 8:41 a.m. UTC | #2
On 09.05.2019 23:11, Chris Brandt wrote:

> Move flags macros to header file so they can be used by other files.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>   drivers/usb/renesas_usbhs/common.c |  7 -------
>   drivers/usb/renesas_usbhs/common.h | 10 ++++++++++
>   2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index 249fbee97f3f..efb26ffd9809 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -44,13 +44,6 @@
>    */
>   
>   
> -#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
> -
> -/* status */
> -#define usbhsc_flags_init(p)   do {(p)->flags = 0; } while (0)
> -#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
> -#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
> -#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
>   

    Why leave 3 empty lines?

>   /*
>    * platform call back
[...]

MBR, Sergei
Chris Brandt May 10, 2019, 2 p.m. UTC | #3
On Fri, May 10, 2019, Sergei Shtylyov wrote:
> > -#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
> > -
> > -/* status */
> > -#define usbhsc_flags_init(p)   do {(p)->flags = 0; } while (0)
> > -#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
> > -#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
> > -#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
> >
> 
>     Why leave 3 empty lines?

OK, I'll get rid of 2 of them.

Chris
diff mbox series

Patch

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 249fbee97f3f..efb26ffd9809 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -44,13 +44,6 @@ 
  */
 
 
-#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
-
-/* status */
-#define usbhsc_flags_init(p)   do {(p)->flags = 0; } while (0)
-#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
-#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
-#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
 
 /*
  * platform call back
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index 3777af848a35..1ca94b8f5508 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -339,4 +339,14 @@  struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev);
 #define usbhs_priv_to_dev(priv)		(&priv->pdev->dev)
 #define usbhs_priv_to_lock(priv)	(&priv->lock)
 
+/*
+ * flags
+ */
+#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
+
+#define usbhsc_flags_init(p)   ((p)->flags = 0)
+#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
+#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
+#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
+
 #endif /* RENESAS_USB_DRIVER_H */