* [PATCH] Staging: fbtbt: Fix code style issues
@ 2015-03-12 14:32 Vatika Harlalka
2015-03-12 20:14 ` [Outreachy kernel] " Julia Lawall
2015-03-15 10:47 ` Greg KH
0 siblings, 2 replies; 5+ messages in thread
From: Vatika Harlalka @ 2015-03-12 14:32 UTC (permalink / raw)
To: outreachy-kernel
Reduce line size to increase readability and
remove unnecessary brackets.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/fbtft/fb_ra8875.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index e21af6c..14e8cf0 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -72,12 +72,13 @@ static int init_display(struct fbtft_par *par)
fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
"%s()\n", __func__);
- fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
- "display size %dx%d\n", par->info->var.xres, par->info->var.yres);
+ fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "display size %dx%d\n",
+ par->info->var.xres, par->info->var.yres);
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);
@@ -101,7 +102,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x0E);
write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x02);
- } else if ((par->info->var.xres == 480) && (par->info->var.yres == 272)) {
+ } else if (par->info->var.xres == 480 &&
+ par->info->var.yres == 272) {
/* PLL clock frequency */
write_reg(par, 0x88, 0x0A);
write_reg(par, 0x89, 0x02);
@@ -125,7 +127,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x07);
write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x09);
- } else if ((par->info->var.xres == 640) && (par->info->var.yres == 480)) {
+ } else if (par->info->var.xres == 640 &&
+ par->info->var.yres == 480) {
/* PLL clock frequency */
write_reg(par, 0x88, 0x0B);
write_reg(par, 0x89, 0x02);
@@ -149,7 +152,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1D, 0x0E);
write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x01);
- } else if ((par->info->var.xres == 800) && (par->info->var.yres == 480)) {
+ } else if (par->info->var.xres == 800 &&
+ par->info->var.yres == 480) {
/* PLL clock frequency */
write_reg(par, 0x88, 0x0B);
write_reg(par, 0x89, 0x02);
@@ -174,7 +178,8 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x1E, 0x00);
write_reg(par, 0x1F, 0x01);
} else {
- dev_err(par->info->device, "display size is not supported!!");
+ dev_err(par->info->device,
+ "display size is not supported!!");
return -1;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH] Staging: fbtbt: Fix code style issues
2015-03-12 14:32 [PATCH] Staging: fbtbt: Fix code style issues Vatika Harlalka
@ 2015-03-12 20:14 ` Julia Lawall
2015-03-12 21:51 ` Vatika Harlalka
2015-03-15 10:47 ` Greg KH
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2015-03-12 20:14 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Thu, 12 Mar 2015, Vatika Harlalka wrote:
> Reduce line size to increase readability and
> remove unnecessary brackets.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> drivers/staging/fbtft/fb_ra8875.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
> index e21af6c..14e8cf0 100644
> --- a/drivers/staging/fbtft/fb_ra8875.c
> +++ b/drivers/staging/fbtft/fb_ra8875.c
> @@ -72,12 +72,13 @@ static int init_display(struct fbtft_par *par)
>
> fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
> "%s()\n", __func__);
> - fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
> - "display size %dx%d\n", par->info->var.xres, par->info->var.yres);
> + fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "display size %dx%d\n",
> + par->info->var.xres, par->info->var.yres);
Is there a more standard printing function that you can use here (in
another patch)?
julia
>
> 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);
> @@ -101,7 +102,8 @@ static int init_display(struct fbtft_par *par)
> write_reg(par, 0x1D, 0x0E);
> write_reg(par, 0x1E, 0x00);
> write_reg(par, 0x1F, 0x02);
> - } else if ((par->info->var.xres == 480) && (par->info->var.yres == 272)) {
> + } else if (par->info->var.xres == 480 &&
> + par->info->var.yres == 272) {
> /* PLL clock frequency */
> write_reg(par, 0x88, 0x0A);
> write_reg(par, 0x89, 0x02);
> @@ -125,7 +127,8 @@ static int init_display(struct fbtft_par *par)
> write_reg(par, 0x1D, 0x07);
> write_reg(par, 0x1E, 0x00);
> write_reg(par, 0x1F, 0x09);
> - } else if ((par->info->var.xres == 640) && (par->info->var.yres == 480)) {
> + } else if (par->info->var.xres == 640 &&
> + par->info->var.yres == 480) {
> /* PLL clock frequency */
> write_reg(par, 0x88, 0x0B);
> write_reg(par, 0x89, 0x02);
> @@ -149,7 +152,8 @@ static int init_display(struct fbtft_par *par)
> write_reg(par, 0x1D, 0x0E);
> write_reg(par, 0x1E, 0x00);
> write_reg(par, 0x1F, 0x01);
> - } else if ((par->info->var.xres == 800) && (par->info->var.yres == 480)) {
> + } else if (par->info->var.xres == 800 &&
> + par->info->var.yres == 480) {
> /* PLL clock frequency */
> write_reg(par, 0x88, 0x0B);
> write_reg(par, 0x89, 0x02);
> @@ -174,7 +178,8 @@ static int init_display(struct fbtft_par *par)
> write_reg(par, 0x1E, 0x00);
> write_reg(par, 0x1F, 0x01);
> } else {
> - dev_err(par->info->device, "display size is not supported!!");
> + dev_err(par->info->device,
> + "display size is not supported!!");
> return -1;
> }
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150312143226.GA26267%40akanksha.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH] Staging: fbtbt: Fix code style issues
2015-03-12 20:14 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-12 21:51 ` Vatika Harlalka
2015-03-12 22:00 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Vatika Harlalka @ 2015-03-12 21:51 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
The definition of fbtft_par_dbg uses a call to dev_info after
rearranging the parameters appropriately. This is done after
checking:
if (unlikely(par->debug & level))
ie the expected value of par->debug &level is 0.
Could you please provide some guidance on what other function
I should use?
Thanks!
[-- Attachment #2: Type: text/html, Size: 433 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: fbtbt: Fix code style issues
2015-03-12 21:51 ` Vatika Harlalka
@ 2015-03-12 22:00 ` Julia Lawall
0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2015-03-12 22:00 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Fri, 13 Mar 2015, Vatika Harlalka wrote:
> The definition of fbtft_par_dbg uses a call to dev_info after
> rearranging the parameters appropriately. This is done after
> checking:
> if (unlikely(par->debug & level))
> ie the expected value of par->debug &level is 0.
> Could you please provide some guidance on what other function
> I should use?
I'm not sure any more what file your patch was in, but I looked at some
other files in this directory, and it seems that many uses of this
function are at the beginning of a function. That is, they just indicate
what the driver is doing, but not any abnormal condition. Perhaps they
could just be dropped. For the ones that seem very useful, you could
use dev_info.
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: fbtbt: Fix code style issues
2015-03-12 14:32 [PATCH] Staging: fbtbt: Fix code style issues Vatika Harlalka
2015-03-12 20:14 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-15 10:47 ` Greg KH
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2015-03-15 10:47 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Thu, Mar 12, 2015 at 08:02:26PM +0530, Vatika Harlalka wrote:
> Reduce line size to increase readability and
> remove unnecessary brackets.
Again, your subject: needs work...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-15 10:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 14:32 [PATCH] Staging: fbtbt: Fix code style issues Vatika Harlalka
2015-03-12 20:14 ` [Outreachy kernel] " Julia Lawall
2015-03-12 21:51 ` Vatika Harlalka
2015-03-12 22:00 ` Julia Lawall
2015-03-15 10:47 ` Greg KH
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.