From patchwork Fri May 12 02:00:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9723441 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84D62600CB for ; Fri, 12 May 2017 02:02:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C46328692 for ; Fri, 12 May 2017 02:02:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71164286E2; Fri, 12 May 2017 02:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 172F328692 for ; Fri, 12 May 2017 02:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbdELCC0 (ORCPT ); Thu, 11 May 2017 22:02:26 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:36321 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757588AbdELCA7 (ORCPT ); Thu, 11 May 2017 22:00:59 -0400 Received: by mail-qt0-f195.google.com with SMTP id j13so5175301qta.3; Thu, 11 May 2017 19:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=T0LL2ZwRgy5S7fntCCg0ZR1AGuoANJnYGLtfqGUZQIY=; b=rARTlXDk1htJgvzfQ88JBXiJlk6STcopDCj3da5CEJCUmGMgD24psyxjgpBfJdUDyF adT2fNR69INXp0i/tb6aQsTWVqFjGpiVhnMuZdxqQHJ93qEX6VViF+cMeTnjuNfzG1Ep GePs1TRJgoHhnUI7bgK7hfhVHQ5bSOze1AmK8GFzWos+KouEa8cARqrcA825Z+NJqkjq BRLNOPB2obllSGarBfPjp2vcUvUlfnDuRWBdFqT5RS4oHZvuIoupQU6VSJB/ziu7rjw3 gSs7yFC2TdMlp733oYqgvoM2HqDHtnAVJKSAgvLMs1cNlmzFS/ZZJdUnP8R7UCmrhIuA E8AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=T0LL2ZwRgy5S7fntCCg0ZR1AGuoANJnYGLtfqGUZQIY=; b=Pg7mH1YmJ+J1BUaatkkaZ5wKAlzJ5ynwQDdPvpMXVHEirx2JPJ0CEFWtQdd/5ATeSw LoQ1+b1IhllXDjgi2U3dWmC3iteI42QqizjjBIZoil/4eVhkLEea0xWgBxOYv93l2DYq 7pUby2L9LEiO1Svm1123vWamw+XnJpBRoYOc30yUX4hn2tFLFX/ph31Kdbibgb0LLO0Y NYUfgSUZVXEQsOGBvww6ZkqMvcWArLGeb/J3ihIe2suU9Nxz9FLEF5Q6ICAu8BZ7iWIl QxTrWclxxck/ZTtecw8MjBkhIzoMhZ6HZEnI/egPpWGdpuJhsLySSLxkyQQ4n9Wy/BmI tyOA== X-Gm-Message-State: AODbwcA2ixzJFuLYY74ZZ2yngi6h5BnnlxdbYyW/ZDlm52nuSSGIADmd 0EeSTGbJt/84+Q== X-Received: by 10.200.55.29 with SMTP id o29mr1568201qtb.120.1494554458969; Thu, 11 May 2017 19:00:58 -0700 (PDT) Received: from z87.localdomain (h96-61-81-193.cntcnh.dsl.dynamic.tds.net. [96.61.81.193]) by smtp.gmail.com with ESMTPSA id s7sm1375104qtb.35.2017.05.11.19.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 19:00:58 -0700 (PDT) From: Len Brown To: rjw@rjwysocki.net, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 3/5] x86: msr-index.h: fix shifts to ULL results in HWP macros. Date: Thu, 11 May 2017 22:00:21 -0400 Message-Id: <2fc49cb0b508947bf048ecb0f5710169e62ce68e.1494552477.git.len.brown@intel.com> X-Mailer: git-send-email 2.11.0.161.g6610af872 In-Reply-To: <20170512020023.23204-1-lenb@kernel.org> References: <20170512020023.23204-1-lenb@kernel.org> In-Reply-To: References: Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown x = 1 ulong_long = x << 32; results in: warning: left shift count >= width of type x = 8 ulong_long = x << 24; results in a sign extended ulong_long Cast x to unsigned long long in these macros to prevent these errors. Signed-off-by: Len Brown --- arch/x86/include/asm/msr-index.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 50c0c3204a92..6da2b30781ff 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -238,13 +238,13 @@ #define HWP_MIN_PERF(x) (x & 0xff) #define HWP_MAX_PERF(x) ((x & 0xff) << 8) #define HWP_DESIRED_PERF(x) ((x & 0xff) << 16) -#define HWP_ENERGY_PERF_PREFERENCE(x) ((x & 0xff) << 24) +#define HWP_ENERGY_PERF_PREFERENCE(x) (((unsigned long long) x & 0xff) << 24) #define HWP_EPP_PERFORMANCE 0x00 #define HWP_EPP_BALANCE_PERFORMANCE 0x80 #define HWP_EPP_BALANCE_POWERSAVE 0xC0 #define HWP_EPP_POWERSAVE 0xFF -#define HWP_ACTIVITY_WINDOW(x) ((x & 0xff3) << 32) -#define HWP_PACKAGE_CONTROL(x) ((x & 0x1) << 42) +#define HWP_ACTIVITY_WINDOW(x) ((unsigned long long)(x & 0xff3) << 32) +#define HWP_PACKAGE_CONTROL(x) ((unsigned long long)(x & 0x1) << 42) /* IA32_HWP_STATUS */ #define HWP_GUARANTEED_CHANGE(x) (x & 0x1)