Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544180 > unrolled thread

[PATCH v2] fix code alignment with open parenthesis

Started byScott Matheina <scott@matheina.com>
First post2016-12-18 18:50 +0100
Last post2016-12-20 01:40 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] fix code alignment with open parenthesis Scott Matheina <scott@matheina.com> - 2016-12-18 18:50 +0100
    Re: [PATCH v2] fix code alignment with open parenthesis Greg KH <gregkh@linuxfoundation.org> - 2016-12-19 07:40 +0100
      Re: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-19 18:50 +0100
        Re: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay Greg KH <gregkh@linuxfoundation.org> - 2017-01-03 16:30 +0100
      Re: [PATCH v2] fix code alignment with open parenthesis Scott Matheina <scott@matheina.com> - 2016-12-20 01:40 +0100

#1544180 — [PATCH v2] fix code alignment with open parenthesis

FromScott Matheina <scott@matheina.com>
Date2016-12-18 18:50 +0100
Subject[PATCH v2] fix code alignment with open parenthesis
Message-ID<sPNKV-3TD-5@gated-at.bofh.it>
These changes where identified by checkpatch.pl as needed changes to
align the code with the linux development coding style. The several
lines of text where aligned with the precending parenthesis.

Signed-off-by: Scott Matheina <scott@matheina.com>

 Changes to be committed:
	modified:   drivers/staging/fbtft/fb_agm1264k-fl.c
---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index a6e3af7..4ee76db 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -185,9 +185,9 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 			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);
 
@@ -246,7 +246,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 
 static void
 construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src,
-						int xs, int xe, int y)
+		      int xs, int xe, int y)
 {
 	int x, i;
 
@@ -361,7 +361,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 		/* left half of display */
 		if (addr_win.xs < par->info->var.xres / 2) {
 			construct_line_bitmap(par, buf, convert_buf,
-				addr_win.xs, par->info->var.xres / 2, y);
+					      addr_win.xs,
+					      par->info->var.xres / 2, y);
 
 			len = par->info->var.xres / 2 - addr_win.xs;
 
@@ -382,8 +383,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 		/* right half of display */
 		if (addr_win.xe >= par->info->var.xres / 2) {
 			construct_line_bitmap(par, buf,
-				convert_buf, par->info->var.xres / 2,
-				addr_win.xe + 1, y);
+					      convert_buf,
+					      par->info->var.xres / 2,
+					      addr_win.xe + 1, y);
 
 			len = addr_win.xe + 1 - par->info->var.xres / 2;
 
@@ -413,7 +415,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 static int write(struct fbtft_par *par, void *buf, size_t len)
 {
 	fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
-		"%s(len=%d): ", __func__, len);
+			  "%s(len=%d): ", __func__, len);
 
 	gpio_set_value(par->RW, 0); /* set write mode */
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1544334

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-12-19 07:40 +0100
Message-ID<sPZM5-4cU-15@gated-at.bofh.it>
In reply to#1544180
On Sun, Dec 18, 2016 at 11:47:30AM -0600, Scott Matheina wrote:
> These changes where identified by checkpatch.pl as needed changes to
> align the code with the linux development coding style. The several
> lines of text where aligned with the precending parenthesis.
> 
> Signed-off-by: Scott Matheina <scott@matheina.com>
> 
>  Changes to be committed:
> 	modified:   drivers/staging/fbtft/fb_agm1264k-fl.c

Why are these lines in the changelog text?

[toc] | [prev] | [next] | [standalone]


#1544714 — Re: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay

FromOzgur Karatas <okaratas@member.fsf.org>
Date2016-12-19 18:50 +0100
SubjectRe: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay
Message-ID<sQaet-2xI-5@gated-at.bofh.it>
In reply to#1544334
19.12.2016, 08:35, "Greg KH" <gregkh@linuxfoundation.org>:
> On Sun, Dec 18, 2016 at 11:47:30AM -0600, Scott Matheina wrote:
>>  These changes where identified by checkpatch.pl as needed changes to
>>  align the code with the linux development coding style. The several
>>  lines of text where aligned with the precending parenthesis.
>>
>>  Signed-off-by: Scott Matheina <scott@matheina.com>
>>
>>   Changes to be committed:
>>          modified: drivers/staging/fbtft/fb_agm1264k-fl.c
>
> Why are these lines in the changelog text?

I checked with checkpatch script to code and give a some errors.
So, the code have to "udelay(20)".

udelay(20);

I read to Documentation/timers/timers-howto.txt and
this line incorrect, usleep_range need must be add defined U_DELAY and fixed.

udelay(U_DELAY, U_DELAY + 10);

finally:

$ checkpatch.pl  drivers/staging/fbtft/fb_agm1264k-fl.c  | grep total
total: 0 errors

Signed-off-by: Ozgur Karatas <okaratas@member.fsf.org>

---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index 7561385..2d46d03 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -36,10 +36,11 @@
 #define FPS			20
 
 #define EPIN		gpio.wr
-#define RS			gpio.dc
-#define RW			gpio.aux[2]
-#define CS0			gpio.aux[0]
-#define CS1			gpio.aux[1]
+#define RS		gpio.dc
+#define RW		gpio.aux[2]
+#define CS0		gpio.aux[0]
+#define CS1		gpio.aux[1]
+#define U_DELAY
 
 /* diffusing error (Floyd-Steinberg) */
 #define DIFFUSING_MATRIX_WIDTH	2
@@ -94,7 +95,7 @@ static void reset(struct fbtft_par *par)
 	dev_dbg(par->info->device, "%s()\n", __func__);
 
 	gpio_set_value(par->gpio.reset, 0);
-	udelay(20);
+	udelay(U_DELAY, U_DELAY + 10);
 	gpio_set_value(par->gpio.reset, 1);
 	mdelay(120);
 }
@@ -185,8 +186,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 			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);
@@ -245,8 +245,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 }
 
 static void
-construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src,
-						int xs, int xe, int y)
+construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src, int xs, int xe, int y)
 {
 	int x, i;
 
@@ -326,9 +325,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 					signed char coeff;
 
 					/* skip pixels out of zone */
-					if (x + i < 0 ||
-						x + i >= par->info->var.xres
-						|| y + j >= par->info->var.yres)
+					if (x + i < 0 || x + i >= par->info->var.xres || y + j >= par->info->var.yres)
 						continue;
 					write_pos = &convert_buf[
 						(y + j) * par->info->var.xres +
@@ -354,8 +351,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 	for (y = addr_win.ys_page; y <= addr_win.ye_page; ++y) {
 		/* left half of display */
 		if (addr_win.xs < par->info->var.xres / 2) {
-			construct_line_bitmap(par, buf, convert_buf,
-				addr_win.xs, par->info->var.xres / 2, y);
+			construct_line_bitmap(par, buf, convert_buf, addr_win.xs, par->info->var.xres / 2, y);
 
 			len = par->info->var.xres / 2 - addr_win.xs;
 
@@ -375,9 +371,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 		}
 		/* right half of display */
 		if (addr_win.xe >= par->info->var.xres / 2) {
-			construct_line_bitmap(par, buf,
-				convert_buf, par->info->var.xres / 2,
-				addr_win.xe + 1, y);
+			construct_line_bitmap(par, buf, convert_buf, par->info->var.xres / 2, addr_win.xe + 1, y);
 
 			len = addr_win.xe + 1 - par->info->var.xres / 2;
 
@@ -406,8 +400,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 
 static int write(struct fbtft_par *par, void *buf, size_t len)
 {
-	fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
-		"%s(len=%d): ", __func__, len);
+	fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, "%s(len=%d): ", __func__, len);
 
 	gpio_set_value(par->RW, 0); /* set write mode */
 
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1549880 — Re: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-01-03 16:30 +0100
SubjectRe: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay
Message-ID<sVzce-8gh-1@gated-at.bofh.it>
In reply to#1544714
On Mon, Dec 19, 2016 at 07:44:42PM +0200, Ozgur Karatas wrote:
> 19.12.2016, 08:35, "Greg KH" <gregkh@linuxfoundation.org>:
> > On Sun, Dec 18, 2016 at 11:47:30AM -0600, Scott Matheina wrote:
> >>  These changes where identified by checkpatch.pl as needed changes to
> >>  align the code with the linux development coding style. The several
> >>  lines of text where aligned with the precending parenthesis.
> >>
> >>  Signed-off-by: Scott Matheina <scott@matheina.com>
> >>
> >>   Changes to be committed:
> >>          modified: drivers/staging/fbtft/fb_agm1264k-fl.c
> >
> > Why are these lines in the changelog text?
> 
> I checked with checkpatch script to code and give a some errors.
> So, the code have to "udelay(20)".
> 
> udelay(20);
> 
> I read to Documentation/timers/timers-howto.txt and
> this line incorrect, usleep_range need must be add defined U_DELAY and fixed.
> 
> udelay(U_DELAY, U_DELAY + 10);
> 
> finally:
> 
> $ checkpatch.pl  drivers/staging/fbtft/fb_agm1264k-fl.c  | grep total
> total: 0 errors
> 
> Signed-off-by: Ozgur Karatas <okaratas@member.fsf.org>
> 
> ---
>  drivers/staging/fbtft/fb_agm1264k-fl.c | 31 ++++++++++++-------------------
>  1 file changed, 12 insertions(+), 19 deletions(-)

You do realize there's nothing I can do with this patch as-is, right?
Please fix up the changelog text and resend it properly if you wish to
have it included.

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1544842

FromScott Matheina <scott@matheina.com>
Date2016-12-20 01:40 +0100
Message-ID<sQgDf-6G5-7@gated-at.bofh.it>
In reply to#1544334

On 12/19/2016 12:35 AM, Greg KH wrote:
> On Sun, Dec 18, 2016 at 11:47:30AM -0600, Scott Matheina wrote:
>> These changes where identified by checkpatch.pl as needed changes to
>> align the code with the linux development coding style. The several
>> lines of text where aligned with the precending parenthesis.
>>
>> Signed-off-by: Scott Matheina <scott@matheina.com>
>>
>>   Changes to be committed:
>> 	modified:   drivers/staging/fbtft/fb_agm1264k-fl.c
I'll remove the above text after signed-off-by and resubmit, honestly 
it's been
over a year since I submitted a patch so I have to relearn how you want 
them
formatted. Thanks for working with me.
> Why are these lines in the changelog text?

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web