All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bhagyashri Dighole <digholebhagyashri@gmail.com>
Cc: Outreachy <outreachy-kernel@googlegroups.com>
Subject: Re: [PATCH v5] staging: fbtft: convert a macro to a function.
Date: Fri, 8 Mar 2019 07:58:54 +0100	[thread overview]
Message-ID: <20190308065854.GA6875@kroah.com> (raw)
In-Reply-To: <20190308065424.GA7942@bhagyashri-Lenovo-G570>

On Fri, Mar 08, 2019 at 12:24:24PM +0530, Bhagyashri Dighole wrote:
> Convert a macro to an inline function to improve type safety and make
> the code simpler.
> 
> Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com>
> ---
> Changes in v5:
>   -- Add space on both the side of operator.
> 
> Changes in v4:
>   -- Modify log messages.
> 
> Changes in v3:
>   -- Change the subject line according to log messages.
>   -- Remove extra spaces.
>   
> Changes in v2:
>   -- Make the converion from macro to inline function
> 
>  drivers/staging/fbtft/fb_watterott.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
> index 0a5206d..7ee8a83 100644
> --- a/drivers/staging/fbtft/fb_watterott.c
> +++ b/drivers/staging/fbtft/fb_watterott.c
> @@ -90,15 +90,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
>  	return 0;
>  }
>  
> -#define RGB565toRGB323(c) ((((c) & 0xE000) >> 8) |\
> -			   (((c) & 000600) >> 6) |\
> -			   (((c) & 0x001C) >> 2))
> -#define RGB565toRGB332(c) ((((c) & 0xE000) >> 8) |\
> -			   (((c) & 000700) >> 6) |\
> -			   (((c) & 0x0018) >> 3))
> -#define RGB565toRGB233(c) ((((c) & 0xC000) >> 8) |\
> -			   (((c) & 000700) >> 5) |\
> -			   (((c) & 0x001C) >> 2))
> +inline int rgb565_to_rgb332(u16 c)
> +{
> +	return ((c & 0xE000) >> 8) | ((c & 000700) >> 6) | ((c & 0x0018) >> 3);
> +}

You also deleted 2 unused macros here, making this patch do multiple
things, and you didn't describe it in the changelog text :(

This should be 2 separate patches, one to remove the unused macros, and
one to turn the macro that is used, into an inline function.

Oh, I also just noticed it needs to be static :)

thanks,

greg k-h


  reply	other threads:[~2019-03-08  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08  6:54 [PATCH v5] staging: fbtft: convert a macro to a function Bhagyashri Dighole
2019-03-08  6:58 ` Greg Kroah-Hartman [this message]
2019-03-08  7:28   ` Bhagyashri Dighole
2019-03-08  7:30     ` [Outreachy kernel] " Julia Lawall
2019-03-08  7:35       ` Bhagyashri Dighole
2019-03-08  7:41     ` Greg Kroah-Hartman
2019-03-08  7:54       ` Bhagyashri Dighole

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=20190308065854.GA6875@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=digholebhagyashri@gmail.com \
    --cc=outreachy-kernel@googlegroups.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 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.