* [PATCH] staging: sm750fb: Removed unnecessary parentheses.
@ 2017-03-03 10:49 Varsha Rao
2017-03-03 10:59 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Varsha Rao @ 2017-03-03 10:49 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman; +Cc: outreachy-kernel
Removed parentheses on the right hand side of assignment, as they are
not required. The following coccinelle script was used to fix this
issue:
@@
local idexpression id;
expression e;
@@
id =
-(
e
-)
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
drivers/staging/sm750fb/ddk750_chip.c | 2 +-
drivers/staging/sm750fb/ddk750_hwi2c.c | 2 +-
drivers/staging/sm750fb/sm750_accel.c | 2 +-
drivers/staging/sm750fb/sm750_cursor.c | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 9e49298..5e4bfb6 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -352,7 +352,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig, struct pll_value *p
RN = N * request;
quo = RN / input;
rem = RN % input;/* rem always small than 14318181 */
- fl_quo = (rem * 10000 / input);
+ fl_quo = rem * 10000 / input;
for (d = max_d; d >= 0; d--) {
X = BIT(d);
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 68716ef..fe814e4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -217,7 +217,7 @@ unsigned char sm750_hw_i2c_read_reg(
unsigned char reg
)
{
- unsigned char value = (0xFF);
+ unsigned char value = 0xFF;
if (hw_i2c_write_data(addr, 1, ®) == 1)
hw_i2c_read_data(addr, 1, &value);
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index 9548863..6db9b90 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -212,7 +212,7 @@ unsigned int rop2) /* ROP value */
sy += height - 1;
dx += width - 1;
dy += height - 1;
- opSign = (-1);
+ opSign = -1;
}
/*
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index aa232c3..401b916 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -70,8 +70,8 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
{
u32 reg;
- reg = (((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) |
- (x & HWC_LOCATION_X_MASK));
+ reg = ((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) |
+ (x & HWC_LOCATION_X_MASK);
poke32(HWC_LOCATION, reg);
}
void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: sm750fb: Removed unnecessary parentheses.
2017-03-03 10:49 [PATCH] staging: sm750fb: Removed unnecessary parentheses Varsha Rao
@ 2017-03-03 10:59 ` Julia Lawall
2017-03-03 19:41 ` Varsha Rao
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2017-03-03 10:59 UTC (permalink / raw)
To: Varsha Rao
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, outreachy-kernel
On Fri, 3 Mar 2017, Varsha Rao wrote:
> Removed parentheses on the right hand side of assignment, as they are
> not required. The following coccinelle script was used to fix this
> issue:
>
> @@
> local idexpression id;
> expression e;
> @@
>
> id =
> -(
> e
> -)
>
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_chip.c | 2 +-
> drivers/staging/sm750fb/ddk750_hwi2c.c | 2 +-
> drivers/staging/sm750fb/sm750_accel.c | 2 +-
> drivers/staging/sm750fb/sm750_cursor.c | 4 ++--
> 4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> index 9e49298..5e4bfb6 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.c
> +++ b/drivers/staging/sm750fb/ddk750_chip.c
> @@ -352,7 +352,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig, struct pll_value *p
> RN = N * request;
> quo = RN / input;
> rem = RN % input;/* rem always small than 14318181 */
> - fl_quo = (rem * 10000 / input);
> + fl_quo = rem * 10000 / input;
>
> for (d = max_d; d >= 0; d--) {
> X = BIT(d);
> diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c
> index 68716ef..fe814e4 100644
> --- a/drivers/staging/sm750fb/ddk750_hwi2c.c
> +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
> @@ -217,7 +217,7 @@ unsigned char sm750_hw_i2c_read_reg(
> unsigned char reg
> )
> {
> - unsigned char value = (0xFF);
> + unsigned char value = 0xFF;
>
> if (hw_i2c_write_data(addr, 1, ®) == 1)
> hw_i2c_read_data(addr, 1, &value);
> diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
> index 9548863..6db9b90 100644
> --- a/drivers/staging/sm750fb/sm750_accel.c
> +++ b/drivers/staging/sm750fb/sm750_accel.c
> @@ -212,7 +212,7 @@ unsigned int rop2) /* ROP value */
> sy += height - 1;
> dx += width - 1;
> dy += height - 1;
> - opSign = (-1);
> + opSign = -1;
> }
>
> /*
> diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
> index aa232c3..401b916 100644
> --- a/drivers/staging/sm750fb/sm750_cursor.c
> +++ b/drivers/staging/sm750fb/sm750_cursor.c
> @@ -70,8 +70,8 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
> {
> u32 reg;
>
> - reg = (((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) |
> - (x & HWC_LOCATION_X_MASK));
> + reg = ((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) |
> + (x & HWC_LOCATION_X_MASK);
There should be one less space in front of the last line, to line the
parnthesis to the left of x with the parenthesis immediately to the left
of y. Otherwise,
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> poke32(HWC_LOCATION, reg);
> }
> void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,
> --
> 2.9.3
>
> --
> 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/58b94a22.0910620a.79513.e66a%40mx.google.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: sm750fb: Removed unnecessary parentheses.
2017-03-03 10:59 ` [Outreachy kernel] " Julia Lawall
@ 2017-03-03 19:41 ` Varsha Rao
0 siblings, 0 replies; 3+ messages in thread
From: Varsha Rao @ 2017-03-03 19:41 UTC (permalink / raw)
To: outreachy-kernel; +Cc: rvarsha016, sudipm.mukherjee, teddy.wang, gregkh
[-- Attachment #1.1: Type: text/plain, Size: 429 bytes --]
> > - (x & HWC_LOCATION_X_MASK));
> > + reg = ((y << HWC_LOCATION_Y_SHIFT) & HWC_LOCATION_Y_MASK) |
> > + (x & HWC_LOCATION_X_MASK);
>
> There should be one less space in front of the last line, to line the
> parnthesis to the left of x with the parenthesis immediately to the left
> of y. Otherwise,
>
Yes, the alignment is not proper. I will send a new patch for this
issue.
[-- Attachment #1.2: Type: text/html, Size: 681 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-03 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 10:49 [PATCH] staging: sm750fb: Removed unnecessary parentheses Varsha Rao
2017-03-03 10:59 ` [Outreachy kernel] " Julia Lawall
2017-03-03 19:41 ` Varsha Rao
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.