Skip to contentSkip to conversation

staging: sm750fb: rename camelCase macro

PATCH In review Elizabeth Ferdman 2 participants 2 messages Sep 27, 2016 – Sep 28, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: sm750fb: rename camelCase macro

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

---
Changes in v2:
- Revise commit message and description

 drivers/staging/sm750fb/ddk750_chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +3 -3
index f557b6d..81df4c4 100644
@@ -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;
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 1 line · Elizabeth Ferdman

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

please wrap your changelog comments at 72 columns.

Quoted 14 lines

---
Changes in v2:
- Revise commit message and description

 drivers/staging/sm750fb/ddk750_chip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +0 -0
index f557b6d..81df4c4 100644

drivers/staging/sm750fb/ddk750_chip.c line 10

Quoted 5 lines
drivers/staging/sm750fb/ddk750_chip.c +1 -1
@@ -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