Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp273447imm; Sat, 1 Sep 2018 02:19:08 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdal3IhZVbGY9Um18zb+4Mtt90mYTJ9+wy/eRRES/PQFuujgLYiQ/g023DbNrCtlVYZZTFPV X-Received: by 2002:a17:902:3a3:: with SMTP id d32-v6mr19233545pld.294.1535793547940; Sat, 01 Sep 2018 02:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535793547; cv=none; d=google.com; s=arc-20160816; b=T4JT9KpErpLAYUP4kQQzGnmRtujn9yIwChNE5uDNKb/qTKLwZiGu0ENjcNetFMwylL TZKkC+pZm3teheAbMMT09UNuVV99O5nOKBAoTa5y6vi0zNKv5wCblIphjRHhglIaBx+u f2r5J5vl0Ar8H2Nu0Nc4FjmzaEYrK8UiCpmauW+60PKgniv/WKSgzFQ65ilBgy50JMOo tKCcdqiYq0dObV2ZGFXiqzkXqC6BK2esjB5vwCMVc3yYnZTiHXOVHywn1KkUIp28zmbR IOVWl/OxHMeT7VUbGE5e/jz5pKa3sYVfWqn03w69lPqXJgDEG1n7eMiVq+9P6HC+OD3W cI6w== 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:arc-authentication-results; bh=/jPN7w7lJWiNLZQYHn6myG46ZhnQZvdsh/TSY0wsTPQ=; b=XK/wMx3Vz6sbFfnqZXOyiD6dgdGXJrGGPy5pMWv0zQ5Yk879H5WQIh9eokbRlILS1Y DGy/tfCZn8PnW2ZAVdUgunlnjNOPXsnsc56rtVAw4vjLIzAPd/jgJM/PPudzoV4l22/O jK0RD4HY2/VBT2pyM8YtgbDXQMWMWQgoWSoeUH+rLCQ1hcIQlr2Sw3zCOT6X+26WgG5z R7iNP7didBv60kIFjpdqlLPLAJqo6qQR2b+0p4dHxv5OIx/qFildsaRP4Ce0XUDBE21o lNf7SY/2SGzyx6QYvYliiVBbpuuh+83a0SNC/U7NguAPHr2FCLKIwBIcPnYHIHJca6GJ TI3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cDeScB9t; 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 w126-v6si12573750pfb.232.2018.09.01.02.18.51; Sat, 01 Sep 2018 02:19:07 -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=cDeScB9t; 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 S1727320AbeIAN3D (ORCPT + 99 others); Sat, 1 Sep 2018 09:29:03 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46097 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbeIAN3D (ORCPT ); Sat, 1 Sep 2018 09:29:03 -0400 Received: by mail-wr1-f68.google.com with SMTP id a108-v6so13214718wrc.13 for ; Sat, 01 Sep 2018 02:17:42 -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=/jPN7w7lJWiNLZQYHn6myG46ZhnQZvdsh/TSY0wsTPQ=; b=cDeScB9tq+auktyw6Jr/usgzdWuczaXMWu//PCsDIZ59jyYorNQ1tEyD9tLLQjXSO/ c68EnFnNjvcDVjISH7LCTydeHSbBtKyQ6KxKmhfFjluazwgg8cB11SafB9cJjX9bQDVL Ew/uQ7hsvsGcPdbPwE0wOpZOc6Sk/oQRz7pIGTHBTtl2WfrIs+OXLV++ICdtwAvJWcHT 38epPHFGuofLjQv6kqO17CzzT4a8sfkjgXyaVAFuiFHl+MASxyRy16YvjBK8CLz6srP1 2H642dyOyPqBUSvATSn1YLNW2jBt32v6/3LVapgV5dgl7I7/6YRSlrz4BZxLidLZaRTm qlDA== 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=/jPN7w7lJWiNLZQYHn6myG46ZhnQZvdsh/TSY0wsTPQ=; b=nvlaV0Rvm0xbmXnzwm56m2VFilU+fji6mB8FR4eNJUdEiNY/fiQVfw/XseICPfnTOR QfXQohkL45CiLt7lYSmjiolygzuWiCWUfURsRY470YZrnc6Yr3DeXqYIhlyqN4Ap4Q2m 7hbKvt0WtSrxCX2cXzma+/DBkO8ZQ3zOzVCio6Kb+pd0Xg0IUNHDz+UItAYggEyRz+AQ UiMiaIvlqOkTtLzk7nMzaXvcv5Jeo8HBKK75zNZrbV12t+eCoI0bukwlwu8RErdJN5AY t+qoYdNwXPXBpt0I6CuY5+Q6GYetJU1Y/f0ZsG7yheyA1TLuIb6KU0loH189SSizLsy1 ijtA== X-Gm-Message-State: APzg51DUil2W2RZoaQUE4/Ead4cKAsX3AUwgMWiHVanIfGSRxefUatZL Tgk0B6YMfTC8qbF28fyc7sE= X-Received: by 2002:adf:8567:: with SMTP id 94-v6mr3346161wrh.223.1535793461808; Sat, 01 Sep 2018 02:17:41 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4006:df00:8852:4a4c:95e8:7a2]) by smtp.gmail.com with ESMTPSA id t9-v6sm4090558wmf.1.2018.09.01.02.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Sep 2018 02:17:41 -0700 (PDT) Date: Sat, 1 Sep 2018 11:17:40 +0200 From: Luc Van Oostenryck To: Miguel Ojeda Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers Subject: Re: [PATCH 4/7] Compiler Attributes: homogenize __must_be_array Message-ID: <20180901091738.73dzegdenvla5crf@ltop.local> References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> <20180831170514.24665-4-miguel.ojeda.sandonis@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831170514.24665-4-miguel.ojeda.sandonis@gmail.com> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 07:05:11PM +0200, Miguel Ojeda wrote: > Different definitions of __must_be_array: > > * gcc: disabled for __CHECKER__ > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index e0e55eb3f242..e4a702f99e50 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -357,4 +357,11 @@ static inline void *offset_to_ptr(const int *off) > compiletime_assert(__native_word(t), \ > "Need native word sized stores/loads for atomicity.") > > +#ifdef __CHECKER__ > +#define __must_be_array(a) 0 > +#else > +/* &a[0] degrades to a pointer: a different type from an array */ > +#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) > +#endif > + > #endif /* __LINUX_COMPILER_H */ You can also remove the #ifdef __CHECKER__ because: 1) even ancient version of sparse don't have a problem 2) BUILD_BUG_ON_ZERO() is currently disabled for __CHECKER__ -- Luc Van Oostenryck