platform/x86: intel_pmc_core: Fix "unsigned 'ret' is never less than zero" smatch warning
PATCH 1/1 platform/x86: intel_pmc_core: Fix "unsigned 'ret' is never less than zero" smatch warning
Change the type of ret form a size_t to a ssize_t, matching the prototype of simple_write_to_buffer(), fixing this warning reported by smatch:
drivers/platform/x86/intel_pmc_core.c:1369 pmc_core_lpm_latch_mode_write() warn: unsigned 'ret' is never less than zero.
Fixes 8074a79fad2e ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")
Cc David E. Box <[email protected]>
Reported-by kernel test robot <[email protected]>
Signed-off-by Hans de Goede <[email protected]>
--- drivers/platform/x86/intel_pmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_pmc_core.c +1 -1
@@ -1360,7 +1360,7 @@ static ssize_t pmc_core_lpm_latch_mode_write(struct file *file,struct pmc_dev *pmcdev = s->private;bool clear = false, c10 = false;unsigned char buf[8 ]; -size_t ret; +ssize_t ret;int idx, m, mode;u32 reg;
Signature · 1 line
2.31.1
Hans de Goede
AppliedHi,
Quoted 9 lines · Hans de Goede
Change the type of ret form a
size_tto assize_t, matching the prototype ofsimple_write_to_buffer(), fixing this warning reported by smatch:
drivers/platform/x86/intel_pmc_core.c:1369pmc_core_lpm_latch_mode_write()warn: unsigned 'ret' is never less than zero.Fixes 8074a79fad2e ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")Cc David E. Box <[email protected]>Reported-by kernel test robot <[email protected]>Signed-off-by Hans de Goede <[email protected]>
I've applied this to my review-hans branch now.
Regards,
Hans
Quoted 18 lines
--- drivers/platform/x86/intel_pmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/intel_pmc_core.c +1
-1@@ -1360,7 +1360,7 @@ static ssize_t pmc_core_lpm_latch_mode_write(struct file *file,struct pmc_dev *pmcdev = s->private;bool clear = false, c10 = false;unsigned char buf[8 ]; -size_t ret; +ssize_t ret;int idx, m, mode;u32 reg;