From: "Leonardo Brás" <leobras.c@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 3/3] staging: fbtft: Corrects long index line - Style
Date: Thu, 9 Aug 2018 19:34:24 -0300 [thread overview]
Message-ID: <7cd8c34234ae8603c71f172381cb613dda6797c5.1533853354.git.leobras.c@gmail.com> (raw)
In-Reply-To: <cover.1533853354.git.leobras.c@gmail.com>
Reduces the index size to keep the code more readable.
Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
---
drivers/staging/fbtft/fbtft-sysfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 2a5c630dab87..404046d3999a 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -25,6 +25,7 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves,
unsigned long val = 0;
int ret = 0;
int curve_counter, value_counter;
+ unsigned long idx;
fbtft_par_dbg(DEBUG_SYSFS, par, "%s() str=\n", __func__);
@@ -68,7 +69,9 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves,
ret = get_next_ulong(&curve_p, &val, " ", 16);
if (ret)
goto out;
- curves[curve_counter * par->gamma.num_values + value_counter] = val;
+ idx = curve_counter * par->gamma.num_values +
+ value_counter;
+ curves[idx] = val;
value_counter++;
}
if (value_counter != par->gamma.num_values) {
--
2.18.0
prev parent reply other threads:[~2018-08-09 22:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 22:33 [PATCH v3 0/3] Style changes Leonardo Brás
2018-08-09 22:33 ` [PATCH v3 1/3] staging: fbtft: Includes description to mutex and spinlock - Style Leonardo Brás
2018-08-09 22:34 ` [PATCH v3 2/3] staging: fbtft: Replaces (1 << n) for macro BIT(n) " Leonardo Brás
2018-08-09 22:34 ` Leonardo Brás [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=7cd8c34234ae8603c71f172381cb613dda6797c5.1533853354.git.leobras.c@gmail.com \
--to=leobras.c@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®