* [PATCH] platform/x86: intel_ips: remove unused val in read_mgtv
@ 2021-06-04 8:14 yangerkun
2021-06-04 19:55 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: yangerkun @ 2021-06-04 8:14 UTC (permalink / raw)
To: hdegoede, mgross; +Cc: platform-driver-x86, yangerkun, yukuai3
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 remove the define.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: yangerkun <yangerkun@huawei.com>
---
drivers/platform/x86/intel_ips.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index bffe548187ee..d40a00ba859a 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -829,19 +829,8 @@ static u16 calc_avg_temp(struct ips_driver *ips, u16 *array)
static u16 read_mgtv(struct ips_driver *ips)
{
- u16 ret;
- u64 slope, offset;
- u64 val;
-
- val = thm_readq(THM_MGTV);
- val = (val & TV_MASK) >> TV_SHIFT;
-
- slope = offset = thm_readw(THM_MGTA);
- slope = (slope & MGTA_SLOPE_MASK) >> MGTA_SLOPE_SHIFT;
- offset = offset & MGTA_OFFSET_MASK;
-
- ret = ((val * slope + 0x40) >> 7) + offset;
-
+ thm_readq(THM_MGTV);
+ thm_readw(THM_MGTA);
return 0; /* MCH temp reporting buggy */
}
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: intel_ips: remove unused val in read_mgtv
2021-06-04 8:14 [PATCH] platform/x86: intel_ips: remove unused val in read_mgtv yangerkun
@ 2021-06-04 19:55 ` Hans de Goede
2021-06-07 1:14 ` yangerkun
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2021-06-04 19:55 UTC (permalink / raw)
To: yangerkun, mgross; +Cc: platform-driver-x86, yukuai3
Hi,
On 6/4/21 10:14 AM, yangerkun wrote:
> 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 remove the define.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: yangerkun <yangerkun@huawei.com>
> ---
> drivers/platform/x86/intel_ips.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
> index bffe548187ee..d40a00ba859a 100644
> --- a/drivers/platform/x86/intel_ips.c
> +++ b/drivers/platform/x86/intel_ips.c
> @@ -829,19 +829,8 @@ static u16 calc_avg_temp(struct ips_driver *ips, u16 *array)
>
> static u16 read_mgtv(struct ips_driver *ips)
> {
> - u16 ret;
> - u64 slope, offset;
> - u64 val;
> -
> - val = thm_readq(THM_MGTV);
> - val = (val & TV_MASK) >> TV_SHIFT;
> -
> - slope = offset = thm_readw(THM_MGTA);
> - slope = (slope & MGTA_SLOPE_MASK) >> MGTA_SLOPE_SHIFT;
> - offset = offset & MGTA_OFFSET_MASK;
> -
> - ret = ((val * slope + 0x40) >> 7) + offset;
> -
> + thm_readq(THM_MGTV);
> + thm_readw(THM_MGTA);
> return 0; /* MCH temp reporting buggy */
> }
>
>
I believe it would be good to keep the code around to document how
the temperature can be calculated.
Please submit a patch marking ret as __maybe_unused instead.
Regards,
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: intel_ips: remove unused val in read_mgtv
2021-06-04 19:55 ` Hans de Goede
@ 2021-06-07 1:14 ` yangerkun
0 siblings, 0 replies; 3+ messages in thread
From: yangerkun @ 2021-06-07 1:14 UTC (permalink / raw)
To: Hans de Goede, mgross; +Cc: platform-driver-x86, yukuai3
在 2021/6/5 3:55, Hans de Goede 写道:
> Hi,
>
> On 6/4/21 10:14 AM, yangerkun wrote:
>> 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 remove the define.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: yangerkun <yangerkun@huawei.com>
>> ---
>> drivers/platform/x86/intel_ips.c | 15 ++-------------
>> 1 file changed, 2 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
>> index bffe548187ee..d40a00ba859a 100644
>> --- a/drivers/platform/x86/intel_ips.c
>> +++ b/drivers/platform/x86/intel_ips.c
>> @@ -829,19 +829,8 @@ static u16 calc_avg_temp(struct ips_driver *ips, u16 *array)
>>
>> static u16 read_mgtv(struct ips_driver *ips)
>> {
>> - u16 ret;
>> - u64 slope, offset;
>> - u64 val;
>> -
>> - val = thm_readq(THM_MGTV);
>> - val = (val & TV_MASK) >> TV_SHIFT;
>> -
>> - slope = offset = thm_readw(THM_MGTA);
>> - slope = (slope & MGTA_SLOPE_MASK) >> MGTA_SLOPE_SHIFT;
>> - offset = offset & MGTA_OFFSET_MASK;
>> -
>> - ret = ((val * slope + 0x40) >> 7) + offset;
>> -
>> + thm_readq(THM_MGTV);
>> + thm_readw(THM_MGTA);
>> return 0; /* MCH temp reporting buggy */
>> }
>>
>>
>
>
> I believe it would be good to keep the code around to document how
> the temperature can be calculated.
>
> Please submit a patch marking ret as __maybe_unused instead.
Thanks for your reply, will send v2.
>
> Regards,
>
> Hans
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-07 1:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 8:14 [PATCH] platform/x86: intel_ips: remove unused val in read_mgtv yangerkun
2021-06-04 19:55 ` Hans de Goede
2021-06-07 1:14 ` yangerkun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.