* [Outreachy Kernel][PATCH 3/5] Staging: sm750fb: fix switch-case
@ 2015-03-22 4:10 Amitoj Kaur Chawla
2015-03-22 6:21 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2015-03-22 4:10 UTC (permalink / raw)
To: outreachy-kernel
Fixes checkpatch.pl error by properly indenting code using tabs.
ERROR: switch and case should be at the same indent
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/sm750fb/ddk750_chip.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 5020280..0b6baae 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -154,21 +154,21 @@ void setMemoryClock(unsigned int frequency)
/* Set the corresponding divisor in the register. */
ulReg = PEEK32(CURRENT_GATE);
- switch(divisor) {
- default:
- case 1:
- ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_1);
- break;
- case 2:
- ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_2);
- break;
- case 3:
- ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_3);
- break;
- case 4:
- ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_4);
- break;
- }
+ switch (divisor) {
+ default:
+ case 1:
+ ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_1);
+ break;
+ case 2:
+ ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_2);
+ break;
+ case 3:
+ ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_3);
+ break;
+ case 4:
+ ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_4);
+ break;
+ }
setCurrentGate(ulReg);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [Outreachy Kernel][PATCH 3/5] Staging: sm750fb: fix switch-case
2015-03-22 4:10 [Outreachy Kernel][PATCH 3/5] Staging: sm750fb: fix switch-case Amitoj Kaur Chawla
@ 2015-03-22 6:21 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2015-03-22 6:21 UTC (permalink / raw)
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Sun, 22 Mar 2015, Amitoj Kaur Chawla wrote:
> Fixes checkpatch.pl error by properly indenting code using tabs.
> ERROR: switch and case should be at the same indent
There is an extra "Outreachy kernel" in the subject line.
The commit message could also be better as
"Remove indentation in switch code. Problem found using checkpatch:"
And then put the checkpatch message as you have done above. That gives
more information about the change that was made.
julia
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_chip.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> index 5020280..0b6baae 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.c
> +++ b/drivers/staging/sm750fb/ddk750_chip.c
> @@ -154,21 +154,21 @@ void setMemoryClock(unsigned int frequency)
>
> /* Set the corresponding divisor in the register. */
> ulReg = PEEK32(CURRENT_GATE);
> - switch(divisor) {
> - default:
> - case 1:
> - ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_1);
> - break;
> - case 2:
> - ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_2);
> - break;
> - case 3:
> - ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_3);
> - break;
> - case 4:
> - ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_4);
> - break;
> - }
> + switch (divisor) {
> + default:
> + case 1:
> + ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_1);
> + break;
> + case 2:
> + ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_2);
> + break;
> + case 3:
> + ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_3);
> + break;
> + case 4:
> + ulReg = FIELD_SET(ulReg, CURRENT_GATE, M2XCLK, DIV_4);
> + break;
> + }
>
> setCurrentGate(ulReg);
> }
> --
> 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/20150322041008.GA30118%40amitoj-Inspiron-3542.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-22 6:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-22 4:10 [Outreachy Kernel][PATCH 3/5] Staging: sm750fb: fix switch-case Amitoj Kaur Chawla
2015-03-22 6:21 ` [Outreachy kernel] " Julia Lawall
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.