From patchwork Tue Jul 14 14:50:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235534 Delivered-To: patch@linaro.org Received: by 2002:a54:2c11:0:0:0:0:0 with SMTP id g17csp201339ecp; Tue, 14 Jul 2020 07:51:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/5fHqlUPQFnWEDWhe6U1B5R4k/i91W0gCzkkGbQsvvA4iEAPU+fL5DV9apGscqwgoDYcO X-Received: by 2002:a05:6402:1d35:: with SMTP id dh21mr5036698edb.186.1594738285842; Tue, 14 Jul 2020 07:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594738285; cv=none; d=google.com; s=arc-20160816; b=qHT2XIagu4QQ8nCjYaygw8ZU4KsUCtDQcIApufMnVwSKHcHpBYSb2++c8DGrc1FtBc GjkESwnLYudQ4u/GsPndhBe2Yb0TzJLemnK8l3ZKMGMFj3EssVuHQExFmUfwWK/hdf/Q 2ld2GOeZveqYHJhLKKQ/TmvmeKc3ksy9BEu6fXOFfWB4KLNVJkiZDoHCtH5B1mqzghrG n0I7Xc/aViuIwMzsDspx3Z1yrEy2nbO7oPd4W0oySGNbBYWqIlImJJe6+o5Ah87Rd3CA HOAqFrq54J7jx/n9eFQoTv090X/oUFfhhu5DUNQm1Twndkxe77N2MZlJttsnPx8XP9ZT SA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xAmlwZf9FF5B+fNw3FLwoudWl6EScDCCxEL7TtadPBI=; b=G0d5K5f91ldPOQWpJuJXPsapGQj7ppqecEiSxwgY+7MiFuU+QDSUGkuo1xVE9qwtKV PYUnNrpH6zugaDY450VTcJVa+YK4ANRJp9H0WB3NmdysONZD6nFAVOGXlr1TUODIRSDW +Olh/g/0cE9cRboBkATrk2MRXDZtG6eKkdjCIc2emYWxLwfTaWxYH8hZ2Nvf9I4oBqpV dyZvWYXCqxBCvYpr0s8I4wP7TnQYAFovje3iDS837rs7RlUOGE81K6Z8btvs+wdd3lw5 Vb3pcezHd5VUwlCcTjywYlwsSQ550bWnGajQvgdwTS+Y4wxJp9ZH3EXpMz8LklvS1hCO yoQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MHULfHb/"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr3si11682721ejb.484.2020.07.14.07.51.25; Tue, 14 Jul 2020 07:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MHULfHb/"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbgGNOvY (ORCPT + 10 others); Tue, 14 Jul 2020 10:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728768AbgGNOvF (ORCPT ); Tue, 14 Jul 2020 10:51:05 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC09EC08C5DD for ; Tue, 14 Jul 2020 07:51:04 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z15so22181509wrl.8 for ; Tue, 14 Jul 2020 07:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xAmlwZf9FF5B+fNw3FLwoudWl6EScDCCxEL7TtadPBI=; b=MHULfHb/qq2DdPxVtZdND+73JTuMCaIpc5HvzUeGk6dbIqMsJzHFttAq159KGZhl+E uc32b1iIIALtw+ydZp8fFCVf22oX/ZdWCauKax3caYhdVkySmLHWnfqsCdIC72Zkwchc 0HSG5fFKVugqRl0OpEK9Pw86gfD9D3MreYxK7XhNMk+0Inko/tj6sj1308edItjH6uo6 E5+EcxAVfNcEsuIU/t2HPJ2VjGAKGSOfJyddVycUripolPiZXCNSEbtHOJSdnPoQdyBC z5kKNMEq5B9YxP3pmvcBN6urA6s4KBar6ixz9U4qx3EMF/Ca6qnZHRoNaYFvLzVkUo89 chLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xAmlwZf9FF5B+fNw3FLwoudWl6EScDCCxEL7TtadPBI=; b=eGwPhW/+LbJshXva3266r2xW3rmDf8cYZAwSRbhynQoufgm4fKpj8rOtep4cmy+GQf Zst4cKJQ2U/+EbdWingwDLvgirDhkaNlGFQ3GkTtTHqmQxkMcKscSrAtZ+4uH2y1o7Oj dOQfPpJ8+mGrMoU+nEIpNpg8M3Mr2F4DMICeorPwnvo9P+vsgObBo/keWThISGixSpbM yFrKJmUDgIMF34dc5LbxLRJK2Vz1T0mgJ53AA+xziEY7MtqZ2paQ0X9FdYXCf9L1iqV7 VDMEli4Izwue3Nh58NvCne+mChZHiVrTPZAo0nT59eHgx507/sa2qktvjru3HF4iWkG7 g3TA== X-Gm-Message-State: AOAM530zbU024p8bXphA0HFtfy+fLugDD0CaATHpSsSiPepI92h+pIdm DK8PyVlur9A8ggXPbzr+xCRo7Q== X-Received: by 2002:adf:82f5:: with SMTP id 108mr6085256wrc.218.1594738263620; Tue, 14 Jul 2020 07:51:03 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.61]) by smtp.gmail.com with ESMTPSA id a84sm4653305wmh.47.2020.07.14.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 07:51:03 -0700 (PDT) From: Lee Jones To: rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Lee Jones , Andreas Herrmann , Dominik Brodowski , Pavel Machek , Paul Devriendt , Mark Langsdorf Subject: [PATCH 10/13] cpufreq: powernow-k8: Make use of known set but not used variables Date: Tue, 14 Jul 2020 15:50:46 +0100 Message-Id: <20200714145049.2496163-11-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200714145049.2496163-1-lee.jones@linaro.org> References: <20200714145049.2496163-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org If we fail to use a variable, even a 'dummy' one, then the compiler complains that it is set but not used. We know this is fine, so we set it to its own value here. Fixes the following W=1 kernel build warning(s): drivers/cpufreq/powernow-k8.c: In function ‘pending_bit_stuck’: drivers/cpufreq/powernow-k8.c:89:10: warning: variable ‘hi’ set but not used [-Wunused-but-set-variable] 89 | u32 lo, hi; | ^~ drivers/cpufreq/powernow-k8.c: In function ‘core_voltage_pre_transition’: drivers/cpufreq/powernow-k8.c:285:14: warning: variable ‘lo’ set but not used [-Wunused-but-set-variable] 285 | u32 maxvid, lo, rvomult = 1; | ^~ Cc: Andreas Herrmann Cc: Dominik Brodowski Cc: Pavel Machek Cc: Paul Devriendt Cc: Mark Langsdorf Signed-off-by: Lee Jones --- drivers/cpufreq/powernow-k8.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 3984959eed1d5..b76df81044c4f 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -89,6 +89,7 @@ static int pending_bit_stuck(void) u32 lo, hi; rdmsr(MSR_FIDVID_STATUS, lo, hi); + hi &= hi; /* Silence set but not used warning */ return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0; } @@ -292,6 +293,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, rvomult = 2; rvosteps *= rvomult; rdmsr(MSR_FIDVID_STATUS, lo, maxvid); + lo &= lo; /* Silence set but not used warning */ maxvid = 0x1f & (maxvid >> 16); pr_debug("ph1 maxvid=0x%x\n", maxvid); if (reqvid < maxvid) /* lower numbers are higher voltages */