media: imx: imx-media-fim: Replace macro icap_enabled() with function

Message ID 20230123191714.22430-1-bpappas@pappasbrent.com
State New
Headers
Series media: imx: imx-media-fim: Replace macro icap_enabled() with function |

Commit Message

Brent Pappas Jan. 23, 2023, 7:17 p.m. UTC
  Replace the macro icap_enabled() with a static function to comply
with Linux coding style standards.

Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
---
 drivers/staging/media/imx/imx-media-fim.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Marco Felsch Jan. 23, 2023, 9:51 p.m. UTC | #1
Hi,

thank you for the patch.

On 23-01-23, Brent Pappas wrote:
> Replace the macro icap_enabled() with a static function to comply
> with Linux coding style standards.
> 
> Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
> ---
>  drivers/staging/media/imx/imx-media-fim.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c
> index fb6590dcfc36..ccb35d098a19 100644
> --- a/drivers/staging/media/imx/imx-media-fim.c
> +++ b/drivers/staging/media/imx/imx-media-fim.c
> @@ -68,7 +68,10 @@ struct imx_media_fim {
>  	bool              stream_on;
>  };
>  
> -#define icap_enabled(fim) ((fim)->icap_flags != IRQ_TYPE_NONE)
> +static bool icap_enabled(struct imx_media_fim *fim)
> +{
> +	return fim->icap_flags != IRQ_TYPE_NONE;
> +}

Nit: I would make it inline but recent compiler may do the job for us.

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

Regards,
  Marco

>  static void update_fim_nominal(struct imx_media_fim *fim,
>  			       const struct v4l2_fract *fi)
> -- 
> 2.34.1
> 
> 
>
  
Dan Carpenter Jan. 24, 2023, 4:18 a.m. UTC | #2
On Mon, Jan 23, 2023 at 10:51:05PM +0100, Marco Felsch wrote:
> > -#define icap_enabled(fim) ((fim)->icap_flags != IRQ_TYPE_NONE)
> > +static bool icap_enabled(struct imx_media_fim *fim)
> > +{
> > +	return fim->icap_flags != IRQ_TYPE_NONE;
> > +}
> 
> Nit: I would make it inline but recent compiler may do the job for us.
> 

Yeah.  These days we tend to not make things inline.

regards,
dan carpenter

> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
> 
> Regards,
>   Marco
  

Patch

diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c
index fb6590dcfc36..ccb35d098a19 100644
--- a/drivers/staging/media/imx/imx-media-fim.c
+++ b/drivers/staging/media/imx/imx-media-fim.c
@@ -68,7 +68,10 @@  struct imx_media_fim {
 	bool              stream_on;
 };
 
-#define icap_enabled(fim) ((fim)->icap_flags != IRQ_TYPE_NONE)
+static bool icap_enabled(struct imx_media_fim *fim)
+{
+	return fim->icap_flags != IRQ_TYPE_NONE;
+}
 
 static void update_fim_nominal(struct imx_media_fim *fim,
 			       const struct v4l2_fract *fi)