* [PATCH] staging: sm750fb: Refactor camelCase macro
@ 2016-09-26 22:01 Elizabeth Ferdman
2016-09-27 5:14 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Elizabeth Ferdman @ 2016-09-26 22:01 UTC (permalink / raw)
To: outreachy-kernel
Cc: amsfield22, daniel.baluta, sudipm.mukherjee, teddy.wang, gregkh
This patch refactors a camelcase macro roundedDiv to rounded_div. Error found by checkpatch.
Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
---
drivers/staging/sm750fb/ddk750_chip.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index f557b6d..81df4c4 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -7,7 +7,7 @@
#include "ddk750_power.h"
/* n / d + 1 / 2 = (2n + d) / 2d */
-#define roundedDiv(num, denom) ((2 * (num) + (denom)) / (2 * (denom)))
+#define rounded_div(num, denom) ((2 * (num) + (denom)) / (2 * (denom)))
#define MHz(x) ((x) * 1000000)
logical_chip_type_t getChipType(void)
@@ -102,7 +102,7 @@ static void setMemoryClock(unsigned int frequency)
frequency = MHz(336);
/* Calculate the divisor */
- divisor = roundedDiv(get_mxclk_freq(), frequency);
+ divisor = rounded_div(get_mxclk_freq(), frequency);
/* Set the corresponding divisor in the register. */
reg = PEEK32(CURRENT_GATE) & ~CURRENT_GATE_M2XCLK_MASK;
@@ -152,7 +152,7 @@ static void setMasterClock(unsigned int frequency)
frequency = MHz(190);
/* Calculate the divisor */
- divisor = roundedDiv(get_mxclk_freq(), frequency);
+ divisor = rounded_div(get_mxclk_freq(), frequency);
/* Set the corresponding divisor in the register. */
reg = PEEK32(CURRENT_GATE) & ~CURRENT_GATE_MCLK_MASK;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: sm750fb: Refactor camelCase macro
2016-09-26 22:01 [PATCH] staging: sm750fb: Refactor camelCase macro Elizabeth Ferdman
@ 2016-09-27 5:14 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-09-27 5:14 UTC (permalink / raw)
To: Elizabeth Ferdman
Cc: outreachy-kernel, amsfield22, daniel.baluta, sudipm.mukherjee,
teddy.wang, gregkh
On Mon, 26 Sep 2016, Elizabeth Ferdman wrote:
> This patch refactors a camelcase macro roundedDiv to rounded_div. Error found by checkpatch.
Refactors seems like kind of a big word for just a renaming. Refactoring
would suggest a larger scale reorganization.
julia
>
> Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_chip.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> index f557b6d..81df4c4 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.c
> +++ b/drivers/staging/sm750fb/ddk750_chip.c
> @@ -7,7 +7,7 @@
> #include "ddk750_power.h"
>
> /* n / d + 1 / 2 = (2n + d) / 2d */
> -#define roundedDiv(num, denom) ((2 * (num) + (denom)) / (2 * (denom)))
> +#define rounded_div(num, denom) ((2 * (num) + (denom)) / (2 * (denom)))
> #define MHz(x) ((x) * 1000000)
>
> logical_chip_type_t getChipType(void)
> @@ -102,7 +102,7 @@ static void setMemoryClock(unsigned int frequency)
> frequency = MHz(336);
>
> /* Calculate the divisor */
> - divisor = roundedDiv(get_mxclk_freq(), frequency);
> + divisor = rounded_div(get_mxclk_freq(), frequency);
>
> /* Set the corresponding divisor in the register. */
> reg = PEEK32(CURRENT_GATE) & ~CURRENT_GATE_M2XCLK_MASK;
> @@ -152,7 +152,7 @@ static void setMasterClock(unsigned int frequency)
> frequency = MHz(190);
>
> /* Calculate the divisor */
> - divisor = roundedDiv(get_mxclk_freq(), frequency);
> + divisor = rounded_div(get_mxclk_freq(), frequency);
>
> /* Set the corresponding divisor in the register. */
> reg = PEEK32(CURRENT_GATE) & ~CURRENT_GATE_MCLK_MASK;
> --
> 2.1.4
>
> --
> 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/20160926220150.GA2273%40localhost.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-27 5:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 22:01 [PATCH] staging: sm750fb: Refactor camelCase macro Elizabeth Ferdman
2016-09-27 5:14 ` [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.