diff mbox

platform/x86: intel_ips: remove redundant variables slope and offset

Message ID 20180711080910.4769-1-colin.king@canonical.com (mailing list archive)
State Accepted, archived
Delegated to: Andy Shevchenko
Headers show

Commit Message

Colin King July 11, 2018, 8:09 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Variables slope and offset are being assigned but are never used hence
they are redundant and can be removed.

Cleans up clang warnings:
warning: variable 'slope' set but not used [-Wunused-but-set-variable]
warning: variable 'offset' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/platform/x86/intel_ips.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Andy Shevchenko July 13, 2018, 2:52 p.m. UTC | #1
On Wed, Jul 11, 2018 at 11:09 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables slope and offset are being assigned but are never used hence
> they are redundant and can be removed.
>

Sounds like some half-baked calculus and perhaps would be fixed
better. Though, no one complained so far and git will keep previous
version in index anyway.

> Cleans up clang warnings:
> warning: variable 'slope' set but not used [-Wunused-but-set-variable]
> warning: variable 'offset' set but not used [-Wunused-but-set-variable]
>

Pushed to my review and testing queue, thanks!

> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/platform/x86/intel_ips.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
> index 014fc1634a3d..c5ece7ef08c6 100644
> --- a/drivers/platform/x86/intel_ips.c
> +++ b/drivers/platform/x86/intel_ips.c
> @@ -858,10 +858,7 @@ static u16 read_mgtv(struct ips_driver *ips)
>
>  static u16 read_ptv(struct ips_driver *ips)
>  {
> -       u16 val, slope, offset;
> -
> -       slope = (ips->pta_val & PTA_SLOPE_MASK) >> PTA_SLOPE_SHIFT;
> -       offset = ips->pta_val & PTA_OFFSET_MASK;
> +       u16 val;
>
>         val = thm_readw(THM_PTV) & PTV_MASK;
>
> --
> 2.17.1
>
diff mbox

Patch

diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 014fc1634a3d..c5ece7ef08c6 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -858,10 +858,7 @@  static u16 read_mgtv(struct ips_driver *ips)
 
 static u16 read_ptv(struct ips_driver *ips)
 {
-	u16 val, slope, offset;
-
-	slope = (ips->pta_val & PTA_SLOPE_MASK) >> PTA_SLOPE_SHIFT;
-	offset = ips->pta_val & PTA_OFFSET_MASK;
+	u16 val;
 
 	val = thm_readw(THM_PTV) & PTV_MASK;