Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3937002imm; Thu, 17 May 2018 18:19:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoM3F79d84kmMIFHF58UBwpzsVBZtc5vStfNVkJ71Fep3fb9Xe6A3btjdC5YkdiklKtPBEp X-Received: by 2002:a17:902:581:: with SMTP id f1-v6mr7508692plf.48.1526606394145; Thu, 17 May 2018 18:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526606394; cv=none; d=google.com; s=arc-20160816; b=GWXORfgRJjBdAWMEopZI112uCGpWrcExW//dSRB9AfKZQFa6B5t9Dh4dLjKXlRYK0m thDbuEij6GVlZ6pabke+S5ZmawLJ+WIyGW3ICMhHY4GzaM6JTwQNZUEfhQzwOcEaJIc5 CkWNm8AAQIQBYJg1DAzB851ZjCN7C9Tg8or9R6Zrt91mCIv3opquCryWML9QTV2niYvG HXm62UINqj+jSw+v+CLgMTd9mvx9hYeAgwVpAZUEhozIqEmtZNGiPxcrw0OQfnzW8N3Z FZopgKtaiJRdazWlArDedNoklNi/KmDlt4b/9i1CgUTXrI3dRqDQ9d/5TAZ8LzXXyXmT cd0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:from:message-id:cc:to:date :arc-authentication-results; bh=YubaqJiAEJuJQhZlhOYiWqsJaI69k/VV7lqvZ3tjmNY=; b=YvyF6EFL/4qkwRe+t8S8/N5m4TPEQWr2LQaqYm4ggQ+NQv6Oa59wZ9llaigCT9n8C5 9B0UrmoM3UQunRnoUdUTpyl8aFHo6h1goIJFds1MyMxyP7rkqkFfq6tLKKsbTEQJ6Sg0 I16D4/uodyIolr83DDO3O5a3V/l1X5d+L1gBzoOLg3mcCHWG5YliPPsoRAJXQVVwftOR K3HmR/+Juo3Y5djsBhIEetbMt0d77MExT9pXWZ9XDXaDifh24zzKBrVkOjbzNvLsJ1dB 1w7eFLdCImlFtLEoYgolF0HgV5Q25RC8EHxuh/cwzvZxULlrMvL4kTpqa1lHRA3Oar7l ACwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2-v6si6593383pls.579.2018.05.17.18.19.39; Thu, 17 May 2018 18:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897AbeERBS2 (ORCPT + 99 others); Thu, 17 May 2018 21:18:28 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:39290 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbeERBS1 (ORCPT ); Thu, 17 May 2018 21:18:27 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id A9D8622A94; Thu, 17 May 2018 21:18:22 -0400 (EDT) Date: Fri, 18 May 2018 11:18:33 +1000 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [PATCH RESEND] powerpc/lib: Fix "integer constant is too large" build failure Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org My powerpc-linux-gnu-gcc v4.4.5 compiler can't build a 32-bit kernel any more: arch/powerpc/lib/sstep.c: In function 'do_popcnt': arch/powerpc/lib/sstep.c:1068: error: integer constant is too large for 'long' type arch/powerpc/lib/sstep.c:1069: error: integer constant is too large for 'long' type arch/powerpc/lib/sstep.c:1069: error: integer constant is too large for 'long' type arch/powerpc/lib/sstep.c:1070: error: integer constant is too large for 'long' type arch/powerpc/lib/sstep.c:1079: error: integer constant is too large for 'long' type arch/powerpc/lib/sstep.c: In function 'do_prty': arch/powerpc/lib/sstep.c:1117: error: integer constant is too large for 'long' type This file gets compiled with -std=gnu89 which means a constant can be given the type 'long' even if it won't fit. Fix the errors with a 'ULL' suffix on the relevant constants. Fixes: 2c979c489fee ("powerpc/lib/sstep: Add prty instruction emulation") Fixes: dcbd19b48d31 ("powerpc/lib/sstep: Add popcnt instruction emulation") Signed-off-by: Finn Thain --- This change was compile tested but not regression tested. --- I'm re-sending this because the first submission didn't show up on patchwork.ozlabs.org, apparently because I sent it without any message-id header. Sorry about that. --- arch/powerpc/lib/sstep.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 34d68f1b1b40..49427a3ee104 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1065,9 +1065,10 @@ static nokprobe_inline void do_popcnt(const struct pt_regs *regs, { unsigned long long out = v1; - out -= (out >> 1) & 0x5555555555555555; - out = (0x3333333333333333 & out) + (0x3333333333333333 & (out >> 2)); - out = (out + (out >> 4)) & 0x0f0f0f0f0f0f0f0f; + out -= (out >> 1) & 0x5555555555555555ULL; + out = (0x3333333333333333ULL & out) + + (0x3333333333333333ULL & (out >> 2)); + out = (out + (out >> 4)) & 0x0f0f0f0f0f0f0f0fULL; if (size == 8) { /* popcntb */ op->val = out; @@ -1076,7 +1077,7 @@ static nokprobe_inline void do_popcnt(const struct pt_regs *regs, out += out >> 8; out += out >> 16; if (size == 32) { /* popcntw */ - op->val = out & 0x0000003f0000003f; + op->val = out & 0x0000003f0000003fULL; return; } @@ -1114,7 +1115,7 @@ static nokprobe_inline void do_prty(const struct pt_regs *regs, res ^= res >> 16; if (size == 32) { /* prtyw */ - op->val = res & 0x0000000100000001; + op->val = res & 0x0000000100000001ULL; return; } -- 2.16.1