Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2518539imm; Mon, 28 May 2018 09:36:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKenj83XRWDKpa1UjlpBfH77lJRsYwqEP7HfSgFyhpcoKnNf9OtCMEwvzfTEBrFNLvqa06 X-Received: by 2002:a63:a344:: with SMTP id v4-v6mr11248530pgn.442.1527525360182; Mon, 28 May 2018 09:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527525360; cv=none; d=google.com; s=arc-20160816; b=0pkuCER9cgpmTMT3VY71K9dvuQDB0Q/r61KNWLenkSx3GZ/ZWhNJQGZhfwbXc7pF3t Kwd1bNmoDqG3+rSgqxQZDMDftbwRlDeu6yuFROnDkBx9ICFaO9oByPb3oGEnMReXvR9e jSjbwqfnQFfsOyBePttbhGcdd8TcNLJJyWnXG/8tSt1tJkj0k1uZCDQB+zSn+qe5z3Go V7IWW/BXKUh7BlD1kC0SI6r7YQmebki6TZyV7Qv08aG3AEdNFurjK9Ghd73ELa3NlFFV Kv0l5BPIq1676aiZWYVS0do9ZYy+tZKgZytJZ2qhrkTCGrSc/aCLrl6n7iTytmWhOlxb x0Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ryYE1u+sKmeC5d28fX6b5FtkTPrsiFdYydAFiwtDnN4=; b=KCHgkDhju7azj2gi0+za0zAF7CdcGg6A3HnyscqZdp1qAbdUO7SbTddhB8aWyLTXvn YRLPTo+IQrp4iMxz3MGRN5AHezyc4SsbbBfTRPqZmzIueD+sEgo3HW8tznep4bgx0AcE v7BYmJO5Zwx3hC7+Cu70lXdniMiB0f+TdGR3BtdHMnB+U7Zeo4vhkxi/CqQTSJl9tdtg 1VtNfrGVlrRmbl2rE3GoAE1qSL4mSj4rxpQSu/UXOERFzMRk6E3Ij5Stpg7AiegKJcuk nQ1XL5X+1vcnl9JIysEhPgSOzrGnFr9ANsXIey09dwfMOZPDAco2Tei1c6o18I+RU5H/ kwPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l3dyMNyj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13-v6si29442348plq.464.2018.05.28.09.35.45; Mon, 28 May 2018 09:36:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l3dyMNyj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940208AbeE1QfN (ORCPT + 99 others); Mon, 28 May 2018 12:35:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37880 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934820AbeE1QfL (ORCPT ); Mon, 28 May 2018 12:35:11 -0400 Received: by mail-wm0-f66.google.com with SMTP id l1-v6so33580307wmb.2 for ; Mon, 28 May 2018 09:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ryYE1u+sKmeC5d28fX6b5FtkTPrsiFdYydAFiwtDnN4=; b=l3dyMNyj9kjteqs8BhmCYcG8or3PTxax4BBPzE/BSPTBEqTfZxg1Y7aKnOfUMlyXMD Bw14VnyFmPTdwFvgZqWmor2VKg9aKnQ5tro627lGyhqkkIhYOeETSzwH5zJsa74tKRCC 3aCxJ4/Sf1AzQozwFgSPiu7oPZ9IbjUk6QNPQhaXLB+F+TY6DyHxvBI9lb6iDOoLecO+ lHL8rVN5ab58e7EggiCdId9W2yhBY5Hn5qRyEF0XDRd30cxvps1OjC4/OoMO4vJ4IPNy BTdgdhyTkofM3rm/TIHa+f1LrNZuCpfEwix/7Vh6HsjTrPEVX0+3MYknlsRfocJLlYeq 0AIw== 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; bh=ryYE1u+sKmeC5d28fX6b5FtkTPrsiFdYydAFiwtDnN4=; b=JcmMk0hzj2Hdp6e74fpyVoSKaAAHDK9cUkm+rh+8BIRKxWQ9dgesQc1gu/Y+YgmkDU QTMI21j4uyoBojrySM9SBfRVblK5LxINydq3BJCJRdQbU+cguJdpbgprh8R+pTcWElJJ qWydt3JmHGyvhL3BcPTzHKbOIsu2VNn3R09S7ycoeT+7GCIkSzkm0KnAnyX+ke7kAFYm EKyCc50/KmDxyvkx1haZDxKAYc2gb+sQbWDnYofctdIC8WYrbKjMe5hH5EZ5UuA4Zrkc oHSq4tl+UMiriYYGM+Xx3Q/Q/JneReTlw8uEj2UJ3en4fM1DHdgVljODK/zl5hhrf+Qi gO9Q== X-Gm-Message-State: ALKqPweVU2CWidNW27RLopF/EdIPDXQZ2MzRUoDiRUGa2+8QVqXiqyo2 Z4kjoCE6UCeQRd9S5cQI22o= X-Received: by 2002:a50:bf4f:: with SMTP id g15-v6mr15409582edk.283.1527525310290; Mon, 28 May 2018 09:35:10 -0700 (PDT) Received: from localhost.localdomain (252.178-246-81.adsl-dyn.isp.belgacom.be. [81.246.178.252]) by smtp.gmail.com with ESMTPSA id r15-v6sm16379371edq.40.2018.05.28.09.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 09:35:09 -0700 (PDT) From: Luc Van Oostenryck To: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org, Albert Ou , linux-riscv@lists.infradead.org, Luc Van Oostenryck Subject: [PATCH] riscv: pass machine size to sparse Date: Mon, 28 May 2018 18:35:05 +0200 Message-Id: <20180528163505.15698-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By default, sparse assumes a 64bit machine when compiled on x86-64 and 32bit when compiled on anything else. This can of course create all sort of problems when this doesn't correspond to the target's machine size, like issuing false warnings like: 'shift too big (32) for type unsigned long' or is 64bit while sparse was compiled on a 32bit machine, or worse, to not emit legitimate warnings. Fix this by passing the appropriate -m32/-m64 flag to sparse. Signed-off-by: Luc Van Oostenryck --- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 76e958a54..cb2502e4c 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -71,6 +71,8 @@ KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) # architectures. It's faster to have GCC emit only aligned accesses. KBUILD_CFLAGS += $(call cc-option,-mstrict-align) +CHECKFLAGS += -m$(BITS) + head-y := arch/riscv/kernel/head.o core-y += arch/riscv/kernel/ arch/riscv/mm/ -- 2.17.0