linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device
@ 2024-04-30 19:35 Christophe JAILLET
  2024-04-30 19:35 ` [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another " Christophe JAILLET
  2024-05-01 14:46 ` [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an " Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-04-30 19:35 UTC (permalink / raw)
  To: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jean Delvare, Guenter Roeck
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, openbmc, linux-hwmon

In "struct npcm7xx_cooling_device", the 'fan_clk_freq' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.

This field was added in the initial commit f1fd4a4db777 ("hwmon: Add
NPCM7xx PWM and Fan driver") but was never used.
---
 drivers/hwmon/npcm750-pwm-fan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
index 904816abb7c4..6d92a3b89198 100644
--- a/drivers/hwmon/npcm750-pwm-fan.c
+++ b/drivers/hwmon/npcm750-pwm-fan.c
@@ -197,7 +197,6 @@ struct npcm7xx_pwm_fan_data {
 	void __iomem *fan_base;
 	int pwm_modules;
 	unsigned long pwm_clk_freq;
-	unsigned long fan_clk_freq;
 	struct clk *pwm_clk;
 	struct clk *fan_clk;
 	struct mutex pwm_lock[NPCM7XX_PWM_MAX_MODULES];
-- 
2.44.0


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

* [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another unused field in struct npcm7xx_cooling_device
  2024-04-30 19:35 [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device Christophe JAILLET
@ 2024-04-30 19:35 ` Christophe JAILLET
  2024-05-01 14:47   ` Guenter Roeck
  2024-05-01 14:46 ` [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an " Guenter Roeck
  1 sibling, 1 reply; 4+ messages in thread
From: Christophe JAILLET @ 2024-04-30 19:35 UTC (permalink / raw)
  To: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jean Delvare, Guenter Roeck
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, openbmc, linux-hwmon

In "struct npcm7xx_cooling_device", the 'pwm_clk_freq' field is only
written and never used.

Remove it and update npcm7xx_pwm_init() accordingly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.
---
 drivers/hwmon/npcm750-pwm-fan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
index 6d92a3b89198..bc8db1dc595d 100644
--- a/drivers/hwmon/npcm750-pwm-fan.c
+++ b/drivers/hwmon/npcm750-pwm-fan.c
@@ -196,7 +196,6 @@ struct npcm7xx_pwm_fan_data {
 	void __iomem *pwm_base;
 	void __iomem *fan_base;
 	int pwm_modules;
-	unsigned long pwm_clk_freq;
 	struct clk *pwm_clk;
 	struct clk *fan_clk;
 	struct mutex pwm_lock[NPCM7XX_PWM_MAX_MODULES];
@@ -691,11 +690,12 @@ static u32 npcm7xx_pwm_init(struct npcm7xx_pwm_fan_data *data)
 {
 	int m, ch;
 	u32 prescale_val, output_freq;
+	unsigned long pwm_clk_freq;
 
-	data->pwm_clk_freq = clk_get_rate(data->pwm_clk);
+	pwm_clk_freq = clk_get_rate(data->pwm_clk);
 
 	/* Adjust NPCM7xx PWMs output frequency to ~25Khz */
-	output_freq = data->pwm_clk_freq / PWN_CNT_DEFAULT;
+	output_freq = pwm_clk_freq / PWN_CNT_DEFAULT;
 	prescale_val = DIV_ROUND_CLOSEST(output_freq, PWM_OUTPUT_FREQ_25KHZ);
 
 	/* If prescale_val = 0, then the prescale output clock is stopped */
-- 
2.44.0


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

* Re: [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device
  2024-04-30 19:35 [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device Christophe JAILLET
  2024-04-30 19:35 ` [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another " Christophe JAILLET
@ 2024-05-01 14:46 ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-05-01 14:46 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jean Delvare, linux-kernel,
	kernel-janitors, openbmc, linux-hwmon

On Tue, Apr 30, 2024 at 09:35:37PM +0200, Christophe JAILLET wrote:
> In "struct npcm7xx_cooling_device", the 'fan_clk_freq' field is unused.
> Remove it.
> 
> Found with cppcheck, unusedStructMember.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied.

Thanks,
Guenter

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

* Re: [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another unused field in struct npcm7xx_cooling_device
  2024-04-30 19:35 ` [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another " Christophe JAILLET
@ 2024-05-01 14:47   ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-05-01 14:47 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jean Delvare, linux-kernel,
	kernel-janitors, openbmc, linux-hwmon

On Tue, Apr 30, 2024 at 09:35:38PM +0200, Christophe JAILLET wrote:
> In "struct npcm7xx_cooling_device", the 'pwm_clk_freq' field is only
> written and never used.
> 
> Remove it and update npcm7xx_pwm_init() accordingly.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied.

Thanks,
Guenter

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

end of thread, other threads:[~2024-05-01 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 19:35 [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device Christophe JAILLET
2024-04-30 19:35 ` [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another " Christophe JAILLET
2024-05-01 14:47   ` Guenter Roeck
2024-05-01 14:46 ` [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an " Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).