Re: [PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-13 Thread Renato Soma
On Fri, Apr 13, 2018 at 03:57:47PM +0300, Dan Carpenter wrote:
> > -   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
> > \
> 
> I feel like the original is basically OK but if we're going to change it
> then align it like this:
> 
>   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 
> \
>0);
> \
> 
> 
> Etc.
> 

Alright, I'll fix this issue then send another email with the fixed patch.

Thanks!
renato


Re: [PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-13 Thread Renato Soma
On Fri, Apr 13, 2018 at 03:57:47PM +0300, Dan Carpenter wrote:
> > -   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
> > \
> 
> I feel like the original is basically OK but if we're going to change it
> then align it like this:
> 
>   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 
> \
>0);
> \
> 
> 
> Etc.
> 

Alright, I'll fix this issue then send another email with the fixed patch.

Thanks!
renato


Re: [PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-13 Thread Dan Carpenter
>   if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {\
>   va_start(args, len);  \
>   for (i = 0; i < len; i++) {   \
> - buf[i] = modifier((data_type)va_arg(args, unsigned 
> int)); \
> + buf[i] = modifier((data_type)va_arg(args, \
> + unsigned int));   \


Normally we'd align the parameters like so:

buf[i] = modifier((data_type)va_arg(args,   
\
unsigned int)); 
\



>   } \
>   va_end(args); \
> - fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, 
> buffer_type, buf, len, "%s: ", __func__); \
> + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,  \
> + par->info->device, buffer_type,   \
> + buf, len, "%s: ", __func__);  \
>   } \

Not properly aligned.


> \
>   va_start(args, len);  \
> @@ -37,7 +40,8 @@ void func(struct fbtft_par *par, int len, ...)  
>   \
>   } \
> \
>   *buf = modifier((data_type)va_arg(args, unsigned int));   \
> - ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
> \

I feel like the original is basically OK but if we're going to change it
then align it like this:

ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 
\
 0);
\


Etc.

regards,
dan carpenter



Re: [PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-13 Thread Dan Carpenter
>   if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {\
>   va_start(args, len);  \
>   for (i = 0; i < len; i++) {   \
> - buf[i] = modifier((data_type)va_arg(args, unsigned 
> int)); \
> + buf[i] = modifier((data_type)va_arg(args, \
> + unsigned int));   \


Normally we'd align the parameters like so:

buf[i] = modifier((data_type)va_arg(args,   
\
unsigned int)); 
\



>   } \
>   va_end(args); \
> - fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, 
> buffer_type, buf, len, "%s: ", __func__); \
> + fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,  \
> + par->info->device, buffer_type,   \
> + buf, len, "%s: ", __func__);  \
>   } \

Not properly aligned.


> \
>   va_start(args, len);  \
> @@ -37,7 +40,8 @@ void func(struct fbtft_par *par, int len, ...)  
>   \
>   } \
> \
>   *buf = modifier((data_type)va_arg(args, unsigned int));   \
> - ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
> \

I feel like the original is basically OK but if we're going to change it
then align it like this:

ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 
\
 0);
\


Etc.

regards,
dan carpenter



[PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-12 Thread Renato Soma
Fix checkpatch.pl warnings of line sizes exceeding 80 columns.
Break lines in order to reduce the instructions lengths to less than 80 columns.

Signed-off-by: Renato Soma 
---
 drivers/staging/fbtft/fbtft-bus.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c 
b/drivers/staging/fbtft/fbtft-bus.c
index a263bce2..57742d7 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -22,10 +22,13 @@ void func(struct fbtft_par *par, int len, ...)  
  \
if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {\
va_start(args, len);  \
for (i = 0; i < len; i++) {   \
-   buf[i] = modifier((data_type)va_arg(args, unsigned 
int)); \
+   buf[i] = modifier((data_type)va_arg(args, \
+   unsigned int));   \
} \
va_end(args); \
-   fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, 
buffer_type, buf, len, "%s: ", __func__); \
+   fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,  \
+   par->info->device, buffer_type,   \
+   buf, len, "%s: ", __func__);  \
} \
  \
va_start(args, len);  \
@@ -37,7 +40,8 @@ void func(struct fbtft_par *par, int len, ...)
\
} \
  \
*buf = modifier((data_type)va_arg(args, unsigned int));   \
-   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
\
+   ret = fbtft_write_buf_dc(par, par->buf,   \
+   sizeof(data_type) + offset, 0);   \
if (ret < 0)  \
goto out; \
len--;\
@@ -48,7 +52,8 @@ void func(struct fbtft_par *par, int len, ...)
\
if (len) {\
i = len;  \
while (i--)   \
-   *buf++ = modifier((data_type)va_arg(args, unsigned 
int)); \
+   *buf++ = modifier((data_type)va_arg(args, \
+   unsigned int));   \
fbtft_write_buf_dc(par, par->buf, \
   len * (sizeof(data_type) + offset), 1);\
} \
-- 
2.7.4



[PATCH] staging fbtft: Fixed lines exceeding columns limit

2018-04-12 Thread Renato Soma
Fix checkpatch.pl warnings of line sizes exceeding 80 columns.
Break lines in order to reduce the instructions lengths to less than 80 columns.

Signed-off-by: Renato Soma 
---
 drivers/staging/fbtft/fbtft-bus.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c 
b/drivers/staging/fbtft/fbtft-bus.c
index a263bce2..57742d7 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -22,10 +22,13 @@ void func(struct fbtft_par *par, int len, ...)  
  \
if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {\
va_start(args, len);  \
for (i = 0; i < len; i++) {   \
-   buf[i] = modifier((data_type)va_arg(args, unsigned 
int)); \
+   buf[i] = modifier((data_type)va_arg(args, \
+   unsigned int));   \
} \
va_end(args); \
-   fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, par->info->device, 
buffer_type, buf, len, "%s: ", __func__); \
+   fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,  \
+   par->info->device, buffer_type,   \
+   buf, len, "%s: ", __func__);  \
} \
  \
va_start(args, len);  \
@@ -37,7 +40,8 @@ void func(struct fbtft_par *par, int len, ...)
\
} \
  \
*buf = modifier((data_type)va_arg(args, unsigned int));   \
-   ret = fbtft_write_buf_dc(par, par->buf, sizeof(data_type) + offset, 0); 
\
+   ret = fbtft_write_buf_dc(par, par->buf,   \
+   sizeof(data_type) + offset, 0);   \
if (ret < 0)  \
goto out; \
len--;\
@@ -48,7 +52,8 @@ void func(struct fbtft_par *par, int len, ...)
\
if (len) {\
i = len;  \
while (i--)   \
-   *buf++ = modifier((data_type)va_arg(args, unsigned 
int)); \
+   *buf++ = modifier((data_type)va_arg(args, \
+   unsigned int));   \
fbtft_write_buf_dc(par, par->buf, \
   len * (sizeof(data_type) + offset), 1);\
} \
-- 
2.7.4