Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1301239ybg; Fri, 18 Oct 2019 15:29:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHtc0Y0yxPAPq/2rXPaohM6rkGd6keLSd8oQwRT64532+TLzRmL3dpT1ZtNGSu4Ysy7C2C X-Received: by 2002:a05:6402:13d5:: with SMTP id a21mr12518876edx.242.1571437788169; Fri, 18 Oct 2019 15:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437788; cv=none; d=google.com; s=arc-20160816; b=UB8g6CkzcMHYzplJmB87oi3QMP0aHJkW/3hb2sJAXREruHp8jFxwuTsX7lcutAS8q+ i1asGIhYmgJmbkayWv+pdsLOnbLoa3SUFauELXcQtSh+vDgvSYAO5MuzL2mQgPoi22v0 wZQh0z6L/u8MyLQJPa0Op1pGKRyLvXt30EaM1Tr+lypYq9zQ7oXk0TMNy7kmBq9s2gfL 81rX4b33YcwDzCVg+Nu18XuvJ9IUBEHFT0y9doz3wAc1MxOZYbZwT1YECorYavN7u+xv zxPtzwTg3prCxUt3GDVk7W2VkD3rSC4c1pdolVL+yGi/0i9mZav+dLBMGF/f469yhdH9 qKiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=A/Tf4iJWS8qcGlBMvo/id14sOzyak6H/JZlFaeq1a2M=; b=gUcC2aVk3VbJVmWAF2qha9D/Rhp+W0xrNos3EGmExdpwm9zGwSs6yUZ1LSuOAxlTL5 p+STrMZMPYofZrlQec/TTcLiU96FslxVNQDEg2tJ9g9Oi7k0SOhbKib/76D8wFVIuaAD 8RhZGwRFtZ2ymU8F+UozuoSJv6WAtRsXXN2uvFUz/XW9i6EKUVm9efxGYyHw7KlqVzlr wiTcz8crDYxWskehVDVHFk1CJ4xGlIV8WMpAJ8rgPDjZZDfnsD0SO3Zwolgl/BXcBCHY LJhb3zxEH7x5OL+51tZnqFOkf8bnwORuPAsXWIdVhJ1ph/xzA/g36wvq7LT223OoHNYJ LobA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GJTkrh1f; 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 sa16si4297609ejb.356.2019.10.18.15.29.25; Fri, 18 Oct 2019 15:29:48 -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=GJTkrh1f; 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 S2504231AbfJRFF6 (ORCPT + 99 others); Fri, 18 Oct 2019 01:05:58 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41040 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfJRFF4 (ORCPT ); Fri, 18 Oct 2019 01:05:56 -0400 Received: by mail-wr1-f67.google.com with SMTP id p4so4690161wrm.8 for ; Thu, 17 Oct 2019 22:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=A/Tf4iJWS8qcGlBMvo/id14sOzyak6H/JZlFaeq1a2M=; b=GJTkrh1foXLVx/GfRMgwY/5lZrE6f9Fzp9iyjCdB5NFY+dJeU/d3QExp2xXE18QY5l INr6CRdIP/oYiK2MI54mC66XxUdHkBJ5zJ9iRnMQg4Ip05vhs6wu7zLobhVq7FEcJtH1 Ljw7Rem15V6dQg65HgOc2KxvQdIvAa1422/x7Uyu+dheEEt6NGHDEC4X6Ekhc/JG8BLI Na48sFj8Fwlg6iDcfBxfSYCUkmVkdM0RLpEpPrnFNF1Q2O6n2ylRctHkI0vThzAulNdq 8KOHE98G/wc1uq+arXQrfdACByJaIho595AG6ZxA0vC6qghDEuoRMz282Mfy77ii/kzn GodA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A/Tf4iJWS8qcGlBMvo/id14sOzyak6H/JZlFaeq1a2M=; b=A46/C1uZInzw8FMiLvXU20VVDCIsGNFHEwrtKubtKN6zNXrY0DwriCf37ZD8GXgzrM RvG3li81ExgYtvpIqtQA6daJSrpp/I3lm+ejGmtg2dWqRgRFvnReBaPfZtOW/O8m4K6L wfeee0UqdgWVcqbPrfALPjIhVesxyjI78naIj3tBHmlji1AMJ+k4xWeR86quPlRT8KXU JPGhQuCV31Z8xKj+7bY586lNyai7uOlP8R2Y9G8aq+5NiysLY891hbuTPPYJDJd6LL+Z glyX39NXEOQIK+f4fhjE5bUpBQ2VsH66PdwL5dC5aVjTskV7WTGZg26ymX/U0ES26mxd fc/Q== X-Gm-Message-State: APjAAAWODC77eAuWqzGcQ95nWCNp3BV2rBjYHcVd14yjGnMVyStTF+8Y EjmRM2hntuz2iCNM5vjhhXmqtsUc X-Received: by 2002:adf:a506:: with SMTP id i6mr5692969wrb.159.1571371582365; Thu, 17 Oct 2019 21:06:22 -0700 (PDT) Received: from ltop.local ([2a02:a03f:40ac:ce00:18e1:7d90:ccf5:4489]) by smtp.gmail.com with ESMTPSA id w18sm3970796wmc.9.2019.10.17.21.06.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 21:06:21 -0700 (PDT) Date: Fri, 18 Oct 2019 06:06:20 +0200 From: Luc Van Oostenryck To: Paul Walmsley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers Message-ID: <20191018040619.o3qb5fyj4qdevwoe@ltop.local> References: <20191018004929.3445-1-paul.walmsley@sifive.com> <20191018004929.3445-5-paul.walmsley@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018004929.3445-5-paul.walmsley@sifive.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > Static analysis tools such as sparse don't set the RISC-V C model > preprocessor directives such as "__riscv_cmodel_medany", set by the C > compilers. This causes the static analyzers to evaluate different > preprocessor paths than C compilers would. Fix this by defining the > appropriate C model macros in the static analyzer command lines. > > Signed-off-by: Paul Walmsley > --- > arch/riscv/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > index f5e914210245..0247a90bd4d8 100644 > --- a/arch/riscv/Makefile > +++ b/arch/riscv/Makefile > @@ -47,9 +47,11 @@ KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG_PAGE_OFFSET) > > ifeq ($(CONFIG_CMODEL_MEDLOW),y) > KBUILD_CFLAGS += -mcmodel=medlow > + CHECKFLAGS += -D__riscv_cmodel_medlow > endif > ifeq ($(CONFIG_CMODEL_MEDANY),y) > KBUILD_CFLAGS += -mcmodel=medany > + CHECKFLAGS += -D__riscv_cmodel_medany I can teach sparse about this in the following days. -- Luc Van Oostenryck