All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: sm750fb: rename camelCase macro
@ 2016-09-27 18:46 Elizabeth Ferdman
  2016-09-28  6:00 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Elizabeth Ferdman @ 2016-09-27 18:46 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: amsfield22, daniel.baluta, sudipm.mukherjee, teddy.wang, gregkh

This patch renames a camelcase macro roundedDiv to rounded_div. Error found by checkpatch.

Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
---
Changes in v2:
	- Revise commit message and description

 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: [PATCH v2] staging: sm750fb: rename camelCase macro
  2016-09-27 18:46 [PATCH v2] staging: sm750fb: rename camelCase macro Elizabeth Ferdman
@ 2016-09-28  6:00 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-09-28  6:00 UTC (permalink / raw)
  To: Elizabeth Ferdman
  Cc: outreachy-kernel, amsfield22, daniel.baluta, sudipm.mukherjee,
	teddy.wang

On Tue, Sep 27, 2016 at 11:46:34AM -0700, Elizabeth Ferdman wrote:
> This patch renames a camelcase macro roundedDiv to rounded_div. Error found by checkpatch.

please wrap your changelog comments at 72 columns.

> 
> Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
> ---
> Changes in v2:
> 	- Revise commit message and description
> 
>  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)))

Ick, now it looks like a function, which it isn't :(

I think the kernel already has this function somewhere, can you just use
a built-in one instead?  Dig around in the include/linux/ directory.

And if not, can you change this to an inline function, that way you
don't accidentally evaluate denom twice, potentially causing bad problems.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-28  6:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27 18:46 [PATCH v2] staging: sm750fb: rename camelCase macro Elizabeth Ferdman
2016-09-28  6:00 ` 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.