From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bhagyashri Dighole <digholebhagyashri@gmail.com>
Cc: Outreachy <outreachy-kernel@googlegroups.com>
Subject: Re: [PATCH] staging: fbtft: Avoid CamelCase.
Date: Tue, 5 Mar 2019 08:48:15 +0100 [thread overview]
Message-ID: <20190305074815.GD6158@kroah.com> (raw)
In-Reply-To: <20190305060005.GA7726@bhagyashri-Lenovo-G570>
On Tue, Mar 05, 2019 at 11:30:05AM +0530, Bhagyashri Dighole wrote:
> Fix coding style issues detected by checkpatch.pl `CHECK: Avoid
> CamelCase`.
>
> Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com>
> ---
> drivers/staging/fbtft/fb_watterott.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
> index 0a5206d..7e9c57b 100644
> --- a/drivers/staging/fbtft/fb_watterott.c
> +++ b/drivers/staging/fbtft/fb_watterott.c
> @@ -90,13 +90,13 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
> return 0;
> }
>
> -#define RGB565toRGB323(c) ((((c) & 0xE000) >> 8) |\
> +#define rgb565torgb323(c) ((((c) & 0xE000) >> 8) |\
> (((c) & 000600) >> 6) |\
> (((c) & 0x001C) >> 2))
> -#define RGB565toRGB332(c) ((((c) & 0xE000) >> 8) |\
> +#define rgb565torgb332(c) ((((c) & 0xE000) >> 8) |\
> (((c) & 000700) >> 6) |\
> (((c) & 0x0018) >> 3))
> -#define RGB565toRGB233(c) ((((c) & 0xC000) >> 8) |\
> +#define rgb565torgb233(c) ((((c) & 0xC000) >> 8) |\
> (((c) & 000700) >> 5) |\
> (((c) & 0x001C) >> 2))
>
> @@ -122,7 +122,7 @@ static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len)
> for (i = start_line; i <= end_line; i++) {
> pos[1] = cpu_to_be16(i);
> for (j = 0; j < par->info->var.xres; j++) {
> - buf8[j] = RGB565toRGB332(*vmem16);
> + buf8[j] = rgb565torgb332(*vmem16);
It looks like 2 of those #defines are not even used. Please make this a
patch series of two patches, the first one removing the unused #defines,
and the second changing the name.
But, this is a define, so all CAPS is normal for that.
How about changing this to an inline function instead? That would allow
you to name it rgb565_to_rgb332() which is much more understandable and
provide good typechecking.
thanks,
greg k-h
next prev parent reply other threads:[~2019-03-05 7:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 6:00 [PATCH] staging: fbtft: Avoid CamelCase Bhagyashri Dighole
2019-03-05 7:42 ` [Outreachy kernel] " Julia Lawall
2019-03-05 7:48 ` Greg Kroah-Hartman [this message]
2019-03-05 9:42 ` Bhagyashri Dighole
2019-03-05 9:48 ` Greg Kroah-Hartman
2019-03-05 10:17 ` [Outreachy kernel] " Julia Lawall
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=20190305074815.GD6158@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.