Skip to contentSkip to conversation

pwm: dwc: Use size macro

PATCH In review Raag Jadav 3 participants 6 messages Jan 5 – Jan 12 PWM

lore
Share & tools
lore

Raag Jadav

author
#0 lore raw

PATCH 1/1 pwm: dwc: Use size macro

Use SZ_4K from size.h instead of hardcoding constant.

---
 drivers/pwm/pwm-dwc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pwm/pwm-dwc.c +2 -1
index b6c16139ce4a..86b72db58741 100644
@@ -22,13 +22,14 @@
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/pwm.h>
+#include <linux/sizes.h>
 
 #include "pwm-dwc.h"
 
 /* Elkhart Lake */
 static const struct dwc_pwm_info ehl_pwm_info = {
 	.nr = 2,
-	.size = 0x1000,
+	.size = SZ_4K,
 };
 
 static int dwc_pwm_init_one(struct device *dev, struct dwc_pwm_drvdata *ddata, unsigned int idx)
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Raag Jadav

Use SZ_4K from size.h instead of hardcoding constant.

OTOH, not sure if it's just an unneeded churn. What was the motivation to create this patch?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 4 lines · Raag Jadav
Quoted 3 lines · Andy Shevchenko
Quoted 1 line · Raag Jadav

Use SZ_4K from size.h instead of hardcoding constant.

Quoted 8 lines
Quoted 1 line

Thank you.

Quoted 2 lines

OTOH, not sure if it's just an unneeded churn. What was the motivation to create this patch?

Your hard work[1] continues to motivate me :)

Ha-ha, but that one has a principal difference, i.e. there was _a custom macro_ *already*, which was replaced with a generic one. From the code perspective it's not a churn as it kills the unneeded custom macro. Here the situation is different, i.e. the explicit number 0x1000 is changed to SZ_4K. Just a line to change, the added header inclusion and no other changes, so as a standalone one it sounds to me like a churn.

Quoted 1 line

[1] https://lore.kernel.org/r/[email protected]

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw
Quoted 12 lines · Andy Shevchenko
Quoted 10 lines · Raag Jadav
Quoted 4 lines · Andy Shevchenko
Quoted 1 line · Raag Jadav

Use SZ_4K from size.h instead of hardcoding constant.

Thank you.

Quoted 2 lines

OTOH, not sure if it's just an unneeded churn. What was the motivation to create this patch?

Quoted 8 lines
Quoted 1 line

Your hard work[1] continues to motivate me :)

Ha-ha, but that one has a principal difference, i.e. there was _a custom macro_ *already*, which was replaced with a generic one. From the code perspective it's not a churn as it kills the unneeded custom macro. Here the situation is different, i.e. the explicit number 0x1000 is changed to SZ_4K. Just a line to change, the added header inclusion and no other changes, so as a standalone one it sounds to me like a churn.

Fair, but converting to standard macro is noteworthy IMHO. I'll leave the final call to you all.

Raag

Quoted 1 line
Quoted 1 line

[1] https://lore.kernel.org/r/[email protected]

#5 lore raw
In reply to Raag Jadav

Hello,

Quoted 15 lines · Raag Jadav

Use SZ_4K from size.h instead of hardcoding constant.

---
 drivers/pwm/pwm-dwc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pwm/pwm-dwc.c +0 -0
index b6c16139ce4a..86b72db58741 100644
@@ -22,13 +22,14 @@
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/pwm.h>

drivers/pwm/pwm-dwc.c line 33

Quoted 10 lines
drivers/pwm/pwm-dwc.c +2 -1
+#include <linux/sizes.h>
 
 #include "pwm-dwc.h"
 
 /* Elkhart Lake */
 static const struct dwc_pwm_info ehl_pwm_info = {
 	.nr = 2,
-	.size = 0x1000,
+	.size = SZ_4K,
 };

I don't feel strong if this is an improvement or not. I applied it now with s,size.h,linux/sizes.h, in the commit log.

Best regards
Uwe