Skip to contentSkip to conversation

Staging: fbtft: line over 80 characters

PATCH Superseded Bhagyashri Dighole 2 participants 3 messages Mar 13, 2019 – Mar 17, 2019

Subsystems (2)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/2 Staging: fbtft: line over 80 characters

Fix the checkpatch.pl warning
WARNING: line over 80 characters

---
Changes in v6:
- Drop some invalid changes.

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_ssd1331.c | 3 ++-
 drivers/staging/fbtft/flexfb.c     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fb_ssd1331.c +2 -1
index 9f54fe2..4cfe9f8 100644
@@ -74,7 +74,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 		for (i = 0; i < len; i++)
 			buf[i] = (u8)va_arg(args, unsigned int);
 		va_end(args);
-		fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, u8, buf, len, "%s: ", __func__);
+		fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device,
+				  u8, buf, len, "%s: ", __func__);
 	}
 
 	va_start(args, len);
drivers/staging/fbtft/flexfb.c +2 -1
index b91b459..3747321 100644
@@ -671,7 +671,8 @@ static int flexfb_probe_common(struct spi_device *sdev,
 			break;
 		case 9:
 			if (regwidth == 16) {
-				dev_err(dev, "argument 'regwidth': %d is not supported with buswidth=%d and SPI.\n", regwidth, buswidth);
+				dev_err(dev, "argument 'regwidth': %d is not supported with buswidth=%d and SPI.\n",
+					regwidth, buswidth);
 				return -EINVAL;
 			}
 			par->fbtftops.write_register = fbtft_write_reg8_bus9;
Signature · 1 line
2.7.4
#1 lore raw

PATCH v6 2/2 staging: fbtft: ternary statement to if statement.

Convert a ternary statement into a if statement which is detected while resolving "WARNING: line over 80 characters".

---
Changes in v6:
- Drop some invalid changes.

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fbtft/fb_ssd1306.c +2 -1
index d7c5e2e..1fb0098 100644
@@ -184,7 +184,8 @@ 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;
 			buf++;
 		}
 	}
Signature · 1 line
2.7.4
#2 lore raw

Re: [Outreachy kernel] [PATCH v6 2/2] staging: fbtft: ternary statement to if statement.

Quoted 30 lines · Bhagyashri Dighole

Convert a ternary statement into a if statement which is detected while resolving "WARNING: line over 80 characters".

---
Changes in v6:
- Drop some invalid changes.

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fbtft/fb_ssd1306.c +0 -0
index d7c5e2e..1fb0098 100644

drivers/staging/fbtft/fb_ssd1306.c static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) · line 188

Quoted 6 lines
drivers/staging/fbtft/fb_ssd1306.c +2 -1
@@ -184,7 +184,8 @@ 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;

You are geting much closer.

What about using the BIT() macro here instead?

thanks,

greg k-h