From: Riyan Dhiman <riyandhiman14@gmail.com>
To: gregkh@linuxfoundation.org
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Riyan Dhiman <riyandhiman14@gmail.com>
Subject: [PATCH] staging: fbtft: remove unnecessary braces in if statements and space before close parenthesis in function call
Date: Tue, 23 Jul 2024 11:33:11 +0530 [thread overview]
Message-ID: <20240723060311.32043-1-riyandhiman14@gmail.com> (raw)
Adhere to Linux kernel coding style.
Reported by checkpatch:
CHECK: Unnecessary parentheses around 'devcode != 0x0000'
CHECK: Unnecessary parentheses around 'devcode != 0x9320'
CHECK: Unnecessary parentheses around 'par->info->var.xres == 320'
CHECK: Unnecessary parentheses around 'par->info->var.yres == 240'
CHECK: Unnecessary parentheses around 'par->spi->bits_per_word == 8'
CHECK: Unnecessary parentheses around '!txbuflen'
CHECK: Unnecessary parentheses around 'bpp > 8'
ERROR: space prohibited before that close parenthesis ')'
Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
drivers/staging/fbtft/fb_ili9320.c | 2 +-
drivers/staging/fbtft/fb_ra8875.c | 2 +-
drivers/staging/fbtft/fbtft-bus.c | 6 +++---
drivers/staging/fbtft/fbtft-core.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/fbtft/fb_ili9320.c b/drivers/staging/fbtft/fb_ili9320.c
index 0be7c2d51548..409b54cc562e 100644
--- a/drivers/staging/fbtft/fb_ili9320.c
+++ b/drivers/staging/fbtft/fb_ili9320.c
@@ -37,7 +37,7 @@ static int init_display(struct fbtft_par *par)
devcode = read_devicecode(par);
fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "Device code: 0x%04X\n",
devcode);
- if ((devcode != 0x0000) && (devcode != 0x9320))
+ if (devcode != 0x0000 && devcode != 0x9320)
dev_warn(par->info->device,
"Unrecognized Device code: 0x%04X (expected 0x9320)\n",
devcode);
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 398bdbf53c9a..ce305a0bea48 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -50,7 +50,7 @@ static int init_display(struct fbtft_par *par)
par->fbtftops.reset(par);
- if ((par->info->var.xres == 320) && (par->info->var.yres == 240)) {
+ if (par->info->var.xres == 320 && par->info->var.yres == 240) {
/* PLL clock frequency */
write_reg(par, 0x88, 0x0A);
write_reg(par, 0x89, 0x02);
diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 3d422bc11641..02d7dbd38678 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -62,9 +62,9 @@ out: \
} \
EXPORT_SYMBOL(func);
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8,)
define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16,)
void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
{
@@ -85,7 +85,7 @@ void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
if (len <= 0)
return;
- if (par->spi && (par->spi->bits_per_word == 8)) {
+ if (par->spi && par->spi->bits_per_word == 8) {
/* we're emulating 9-bit, pad start of buffer with no-ops
* (assuming here that zero is a no-op)
*/
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 8e2fd0c0fee2..53b104559502 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -666,7 +666,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
txbuflen = 0;
#ifdef __LITTLE_ENDIAN
- if ((!txbuflen) && (bpp > 8))
+ if (!txbuflen && bpp > 8)
txbuflen = PAGE_SIZE; /* need buffer for byteswapping */
#endif
--
2.39.2
next reply other threads:[~2024-07-23 6:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 6:03 Riyan Dhiman [this message]
2024-07-23 7:43 ` [PATCH] staging: fbtft: remove unnecessary braces in if statements and space before close parenthesis in function call Greg KH
2024-07-23 12:58 ` Riyan Dhiman
2024-07-23 13:06 ` Greg KH
2024-07-24 12:52 ` Riyan Dhiman
2024-07-24 13:55 ` Greg KH
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=20240723060311.32043-1-riyandhiman14@gmail.com \
--to=riyandhiman14@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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.