mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thermal: Fix implicit type conversion
@ 2021-10-28  3:21 Jiasheng Jiang
  2021-10-28 12:32 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiasheng Jiang @ 2021-10-28  3:21 UTC (permalink / raw)
  To: rui.zhang, daniel.lezcano, amitk; +Cc: linux-pm, linux-kernel, Jiasheng Jiang

The parameter 'cpu' is defined as unsigned int.
However in the cpumask_next() it is implicitly type conversed
to int.
It is universally accepted that the implicit type conversion is
terrible.
Also, having the good programming custom will set an example for
others.
Thus, it might be better to change the type of 'cpu' from
unsigned int to int.

Fixes: 3e8c4d3 ("drivers: thermal: Move various drivers for intel platforms into a subdir")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/thermal/intel/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index b0eb5ec..ed46b5e 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -578,7 +578,7 @@ static int powerclamp_cpu_online(unsigned int cpu)
 	return 0;
 }
 
-static int powerclamp_cpu_predown(unsigned int cpu)
+static int powerclamp_cpu_predown(int cpu)
 {
 	if (clamping == false)
 		return 0;
-- 
2.7.4


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

end of thread, other threads:[~2021-10-29 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28  3:21 [PATCH] thermal: Fix implicit type conversion Jiasheng Jiang
2021-10-28 12:32 ` kernel test robot
2021-10-29  2:02 ` kernel test robot
2021-10-29 16:08 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®