platform/x86: intel_ips: fix set but unused warning in read_mgtv
authoryangerkun <yangerkun@huawei.com>
Mon, 7 Jun 2021 01:47:02 +0000 (09:47 +0800)
committerHans de Goede <hdegoede@redhat.com>
Wed, 16 Jun 2021 15:47:55 +0000 (17:47 +0200)
drivers/platform/x86/intel_ips.c:832:6: warning: variable ‘ret’ set but
not used [-Wunused-but-set-variable]
  832 |  u16 ret;
      |      ^~~

Fix it by mark ret as '__maybe_unused'.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: yangerkun <yangerkun@huawei.com>
Link: https://lore.kernel.org/r/20210607014702.2981097-1-yangerkun@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel_ips.c

index bffe548..4dfdbfc 100644 (file)
@@ -829,7 +829,7 @@ static u16 calc_avg_temp(struct ips_driver *ips, u16 *array)
 
 static u16 read_mgtv(struct ips_driver *ips)
 {
-       u16 ret;
+       u16 __maybe_unused ret;
        u64 slope, offset;
        u64 val;