From patchwork Tue Aug 27 20:40:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 172298 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp6308495ily; Tue, 27 Aug 2019 13:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+l/ToT0YJlrWDybtN/A/If2zAKQy4eD7iYi6optZuvNW7dzU09w33WNODRi9Er6olYkeD X-Received: by 2002:a63:7a06:: with SMTP id v6mr278741pgc.115.1566938450920; Tue, 27 Aug 2019 13:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566938450; cv=none; d=google.com; s=arc-20160816; b=UlpfofQ2JhO3wNH9xSbHJW+lxzDJYVytyCPV3C7zRjO7ck6FJoeuv8+UcS3Gt+Cdxk JxzLSNqXapCeVwCTGfWFHd2I3GNBU6crVM3LLvmSqgSTQnGNXiN12DeAMP6z/PxE6ko/ BL0WxpdHNp1BEdDvdjgRYeXX80NTn/JAML8pFdR27kZ3P4qF24istfRhqPUjOJT8p/c8 lnjX+q1hEG4Rjiy/PhwxkxdNq+UAoRroLFQQ7clcUKcM+OYgx34tcApGZ0Lin3zEIYNb 5pTF9sWchGUOtUp6KkKDygqXjr/pwGUwSq7fpgSUVYpIrADR6yb7IbRSOGugHi/e9yy0 gG+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=69o5Grxjv62QvQRHvmQYsH04Y/pWfPSVibkBDTUpZck=; b=YvaMOxKPRlN9GreeV2b/VTBmYhIw0JSgGgH1EY3akFLP11NZXBIMpD4Ms5TwNwWqrx aeWvfBA1xivhkDi5shLxl05nymR5ANPODDSWxY+PDuyvfwlh/qeImit6skWjZ3UQTHCQ ejwYS4oRSC620kR0FzV5RKu4ly5OSJT24h5tCzS1PLNX2Rh02n7ygLHCw8rlC7SuY/a1 bogGV6fg1Q8+jv19t/VTil5XjhL2kqXf1WUIxPscH3oVh/wniT5yT8oqAs+bYDUK1laC lTtn7qU/6G/gCorlIxc+KKbGA511V94HX+Y6K/vrQ3zmLuZUyQB/ohpaz/4LqfQu334r Y/pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hReFQ8hC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si289756pfh.289.2019.08.27.13.40.50; Tue, 27 Aug 2019 13:40:50 -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=@google.com header.s=20161025 header.b=hReFQ8hC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730724AbfH0Ukt (ORCPT + 28 others); Tue, 27 Aug 2019 16:40:49 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:45200 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730221AbfH0Uks (ORCPT ); Tue, 27 Aug 2019 16:40:48 -0400 Received: by mail-pg1-f202.google.com with SMTP id 141so219275pgh.12 for ; Tue, 27 Aug 2019 13:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=69o5Grxjv62QvQRHvmQYsH04Y/pWfPSVibkBDTUpZck=; b=hReFQ8hCxEL6bw2JDh/MqNIvy644a7nuoCq3WHEhQzVrMCKSuBPRsE4ojzK+e76jk7 fd9z0VUbRz9rzsaUz2pd3Vbk3Dzi/MWW4TGuqY6YaNj1mzqQUWaq4ezq60DCs171Trz+ K+0bAGR/QBc0P3/grOBtOJGrYkkZ086qqtpr/0V25KNgNAdtBQg+pWzBFaFQXWgAk4iW f6I3hwFjbGDqgIRAjEcUC5q1OptG59hoHMCn9N01FAqTt4BAC5gBjgq88iLnl5AnsPD7 oup+hkyJLNlgHcOTwGVtmRybWt0hVzlFa+oCNucvdqwBJy7PREzmiSOIFNfgNT1ArD+I /7jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=69o5Grxjv62QvQRHvmQYsH04Y/pWfPSVibkBDTUpZck=; b=YXplXWSAubCYeI4dpw7cMwOFjD/quayUbediKydm0osEyfxZzS2iVtf0MTwtHYnf5i L3lhP+id5YzFA1tBzyCrlglnC+RYY4fMtYfGvyeutUTZX2e1ItS4qCJ+xca3RrZmaDNB yXyBzyb0M/niu2HmVQNxTPiHMOWF9Ijh9AROfYHAo1PJlNQt9rl02mLioDrr0JGGtNzu HgQdxzWl7RfCuF6ABlkWDb4Xr6dvCFGf3izeEz9oAJGASjjMkOPplescpBWfSkAedF47 NCjqvbswCFsj8cEyYAZ//JOQzRy3MpqW0C7NGHRlXTMqwmB8ZALqGo8AfEdj7tXPjS08 gpJw== X-Gm-Message-State: APjAAAXME9VralA9vo/5yq/J9ZZuF6DkJa58+Qtray/gVpy77ezKVo/O M4hMrM0rp/JHwmxF+9gKp9T8nL13bwKIBzzfL3I= X-Received: by 2002:a63:24a:: with SMTP id 71mr260306pgc.273.1566938447325; Tue, 27 Aug 2019 13:40:47 -0700 (PDT) Date: Tue, 27 Aug 2019 13:40:00 -0700 In-Reply-To: <20190827204007.201890-1-ndesaulniers@google.com> Message-Id: <20190827204007.201890-8-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190827204007.201890-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog Subject: [PATCH v2 07/14] mips: prefer __section from compiler_attributes.h From: Nick Desaulniers To: miguel.ojeda.sandonis@gmail.com Cc: sedat.dilek@gmail.com, will@kernel.org, jpoimboe@redhat.com, naveen.n.rao@linux.vnet.ibm.com, davem@davemloft.net, paul.burton@mips.com, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, Nick Desaulniers Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GCC unescapes escaped string section names while Clang does not. Because __section uses the `#` stringification operator for the section name, it doesn't need to be escaped. Instead, we should: 1. Prefer __section(.section_name_no_quotes). 2. Only use __attribute__((__section(".section"))) when creating the section name via C preprocessor (see the definition of __define_initcall in arch/um/include/shared/init.h). This antipattern was found with: $ grep -e __section\(\" -e __section__\(\" -r See the discussions in: Link: https://bugs.llvm.org/show_bug.cgi?id=42950 Link: https://marc.info/?l=linux-netdev&m=156412960619946&w=2 Acked-by: Paul Burton Reported-by: Sedat Dilek Suggested-by: Josh Poimboeuf Signed-off-by: Nick Desaulniers --- arch/mips/include/asm/cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.23.0.187.g17f5b7556c-goog diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h index 8b14c2706aa5..af2d943580ee 100644 --- a/arch/mips/include/asm/cache.h +++ b/arch/mips/include/asm/cache.h @@ -14,6 +14,6 @@ #define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -#define __read_mostly __attribute__((__section__(".data..read_mostly"))) +#define __read_mostly __section(.data..read_mostly) #endif /* _ASM_CACHE_H */