From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bhagyashri Dighole <digholebhagyashri@gmail.com>
Cc: Outreachy <outreachy-kernel@googlegroups.com>
Subject: Re: [PATCH v5 2/2] staging: fbtft: ternary statement to if statement.
Date: Mon, 11 Mar 2019 16:08:13 -0700 [thread overview]
Message-ID: <20190311230813.GA23015@kroah.com> (raw)
In-Reply-To: <20190309154144.GA16379@bhagyashri-Lenovo-G570>
On Sat, Mar 09, 2019 at 09:11:45PM +0530, Bhagyashri Dighole wrote:
> Convert a ternary statement into a if statement which is detected while
> resolving "WARNING: line over 80 characters".
>
> Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com>
> ---
> Changes in v5:
> - Make patch series.
>
> Changes in v4:
> - Convert a ternary statement into a if statement.
>
> Changes in v3:
> - Make the code in original form.
> - Use tab to line up the code.
>
> Changes in v2:
> - Improve code order.
> - Make the code more readable.
>
> drivers/staging/fbtft/fb_ssd1306.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c
> index d7c5e2e..3e1426c 100644
> --- a/drivers/staging/fbtft/fb_ssd1306.c
> +++ b/drivers/staging/fbtft/fb_ssd1306.c
> @@ -184,7 +184,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
> for (y = 0; y < yres / 8; y++) {
> *buf = 0x00;
> for (i = 0; i < 8; i++)
> - *buf |= (vmem16[(y * 8 + i) * xres + x] ? 1 : 0) << i;
> + if (vmem16[(y * 8 + i) * xres + x])
> + *buf |= 1 << i;
> + else
> + *buf |= 0 << i;
Think about what this last line does. Is it really needed? :)
thanks,
greg k-h
prev parent reply other threads:[~2019-03-11 23:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 15:41 [PATCH v5 2/2] staging: fbtft: ternary statement to if statement Bhagyashri Dighole
2019-03-11 23:08 ` Greg Kroah-Hartman [this message]
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=20190311230813.GA23015@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.