From patchwork Tue Aug 27 20:40:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 172299 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp6308562ily; Tue, 27 Aug 2019 13:40:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7LNLpR8n1VRZkoIfH5yGR2TSdcDcplEzBRTXHuQ1RJzBcJk3hTOGwKOIwR+kAvcjylxS6 X-Received: by 2002:a05:6a00:8e:: with SMTP id c14mr367895pfj.241.1566938454478; Tue, 27 Aug 2019 13:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566938454; cv=none; d=google.com; s=arc-20160816; b=AOJ4pcYkn09+pVxx14vspqCjZh/GmrJ0xveZ8mMO0PzfGfnCVnXWxDM3LmKY/tb869 xPDOo66C5E03HZkl2/CSVUnRSXt77+jfF3KZwREFc3ztEi8JHlA26H2S4tG8JmcVF80z dwglyws6dL3LoA49pJzFsNr3iPTwpkwsETcwdb2y54SE2SGKwBq5NSPo9BR77u8xlDjb eXrhB0uAfcZjBC3JqerpfIFb8t0tGyU71LklpF62S2EwzpijUA2jU7fEkq1N3JYeueDW dh637Z3egpxkkoSGCESj1/UMnx6PMjBYDflZd92gXnOLhpjbzkexo/NN12W7B5Vm3YPr UXsw== 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=jdT1qqSDs2qFZzLVnvA8tbfOhFVP3FSFASOlvOrlNi4=; b=HkJkgaVNtagCBPrGvA1oTWOhCVZOHgr4/Tm0G4F7sG4kAx3tXd5GYvHy/RcYByKWwp h6+4rk9ksP1vh5KuTQT5Qy45alaquRHmjWf4+n4MdUvPQXCa2s1FAj6jmavsTdD+vywH QfwCf7G6v7D84CKxcQVWeRYm/Hfo2jb2lfEg6QVYXKjPG98ztITzhVxn59FGKTfgz0go 2s+trNUfpoic7wShnqEVn3QdFmyKkjVq06nP5ClttAQJcyvqHa8i/HqEZEZEl6pVHsfw 7GghmzGPcOn8PQ9fgYyDykFop+sTwD8zIaz3Fyl169X6G2d71LqKT9SHxW2eAhcktXTq zvzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iD5Ox0Uj; 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 j6si337482pgb.206.2019.08.27.13.40.54; Tue, 27 Aug 2019 13:40: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; dkim=pass header.i=@google.com header.s=20161025 header.b=iD5Ox0Uj; 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 S1730742AbfH0Ukw (ORCPT + 28 others); Tue, 27 Aug 2019 16:40:52 -0400 Received: from mail-qt1-f202.google.com ([209.85.160.202]:33424 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730221AbfH0Ukv (ORCPT ); Tue, 27 Aug 2019 16:40:51 -0400 Received: by mail-qt1-f202.google.com with SMTP id z4so182509qts.0 for ; Tue, 27 Aug 2019 13:40:50 -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=jdT1qqSDs2qFZzLVnvA8tbfOhFVP3FSFASOlvOrlNi4=; b=iD5Ox0Ujybxm5MGH5+JvS/NIUjFsEsRINEO9WSqSIOq1NsnfaUXMY0/4OYvLKkiqTk Nb8OT8rye6gaiP6NP9McvKngKEIno81ydeKx+3m8cIz/fNSWmOqCI5gSVfpyEyjD4wCF Ui19boz/LAoZa8N8aOmOS1mPINSGPMpmAAR5Y0R+q/wJheuPgTL+n39PWUyYs+qMKfgL 4I7moS1Gv3VY/5nHHdVrNuSi6TMfzaRe5buc7XrKtmVhJVqnKrRJMWJXVtnLBfSOS8pE 3HabM+dyLOhE5J8trjwPQaGAqDqs7DbToGaNFAtsWAa13c1sz6IQG7gPOWe3Ub8mGHfm kGNg== 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=jdT1qqSDs2qFZzLVnvA8tbfOhFVP3FSFASOlvOrlNi4=; b=AzzAN3u51sQDPSMx0hhys0Iyh1C8AtUCQ/a2Ei5qcLCnesETqH+anF0Y3DuaJnJnwu BgYRQJKM6KtYro9UzAhaINHM8FpBTHCNu5zaBZIFDqIQZP1dvc7X9kgV0n3UsRL96t+1 n5CfCT4CKxWUFyLAvosFWlIRB1pJDmEvAbxiUbDy+dBYb2jZ8+BYTa3eG+kqQtK8zOvA SWvFewGno51J8atyPxDtWOThOWcv4L+yJ8sqZD/1UAM7aA5Mq7gHhEupY2fYBR1LGszT vZ9suISxhj48oydo/nyPCy9Xcqzwyt83ZLjErVq0fwPIQj1pIJaSyytjQ3d4daCz3TxG LpRQ== X-Gm-Message-State: APjAAAW6uNB9r2h/ZTnW13w6bsJBq3LBo7+Qdvhz8kffbrH6rplK2avO wlzjZ1jaULimEzVFxpAv9Pr2S0wSjJcWf9XQ/FU= X-Received: by 2002:a05:6214:18a:: with SMTP id q10mr410277qvr.157.1566938449923; Tue, 27 Aug 2019 13:40:49 -0700 (PDT) Date: Tue, 27 Aug 2019 13:40:01 -0700 In-Reply-To: <20190827204007.201890-1-ndesaulniers@google.com> Message-Id: <20190827204007.201890-9-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 08/14] sparc: 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: David S. Miller Reported-by: Sedat Dilek Suggested-by: Josh Poimboeuf Signed-off-by: Nick Desaulniers --- arch/sparc/include/asm/cache.h | 2 +- arch/sparc/kernel/btext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.23.0.187.g17f5b7556c-goog diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index dcfd58118c11..9a9effdd01e2 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h @@ -21,6 +21,6 @@ #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) -#define __read_mostly __attribute__((__section__(".data..read_mostly"))) +#define __read_mostly __section(.data..read_mostly) #endif /* !(_SPARC_CACHE_H) */ diff --git a/arch/sparc/kernel/btext.c b/arch/sparc/kernel/btext.c index 5869773f3dc4..b2eff8f8f27b 100644 --- a/arch/sparc/kernel/btext.c +++ b/arch/sparc/kernel/btext.c @@ -24,7 +24,7 @@ static void draw_byte_32(unsigned char *bits, unsigned int *base, int rb); static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb); static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb); -#define __force_data __attribute__((__section__(".data"))) +#define __force_data __section(.data) static int g_loc_X __force_data; static int g_loc_Y __force_data;