From patchwork Wed Aug 28 22:55:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 172493 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1395801ily; Wed, 28 Aug 2019 15:56:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqOu/zkI+ACKiB38tJfRSm4ZaGIB1evi0myBOeuWo8+QBzLDtbw+FNftGTs0zjbLoDHB26 X-Received: by 2002:a17:902:6b06:: with SMTP id o6mr6671880plk.33.1567032974097; Wed, 28 Aug 2019 15:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567032974; cv=none; d=google.com; s=arc-20160816; b=fQlOp0JzXNUAgmDQrbfXJb9sAjPMFqGRXnjL/8vcYHj8SKCWQTNyT5dBdTXc7ps49Y CJB92mc34X1P+/kb0fhN92FgbvnIXujz/xPI2kvuSSBcVlfydBC6OqXFFG03GgH5MRer qM8RdxcCSvXLn5cX9SHnuEJ8MPwmJDJGxhznHRzdgv1dMao5cKBqx+3CpR+wzGEV3okW jTo5O4zc7HZ/FJ8LXF2IMYaFuNvQu9T+r71jnfkQzWcxkbHoAFseaR4Ji06Ti71TKnro gDPw2ypPF9LmtqGEFwP+xiQQ8Jbrq7BJiZnpGVwt2ikFy0O7IPXAwg5AStF6Wj4pyBWX m0ew== 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=uqPQg6B/bO6e2oO0RWU/9KfcrqEBl402Sr4PpXrmZmI=; b=aTUIJkt3mgZfOx/3ZZ8PD8+YgXEDzhl9ul05yojNT7XLUjbXBoYT6VEqAHbtme0mkE 64JKOsLCxiFoSDiAF5qMUnrpI59LMxihLUmWe06g+vw1gTzQcw4qXKhuEDM06MIbSg19 JRzL/8qFtki5TinQKtv2V346VwqaCKH70qCYspXOF9zVE0Rq0gFVU7UdkDAryA45HWtY qmu7wmD8qmOe8HRPyrQIm5Eei3FDJHlXhd95q76f2dQWJ0CFJWLIVwtYymWjYLhfId0w EF2EyECryFB4cYJY5ZKnZgw7wU7wonsoq7OxsIB/YzRtzyv0ZxjkuHVdniotBh1Hw74I 9AKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wMbU2OyP; 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 g13si363254pgk.369.2019.08.28.15.56.13; Wed, 28 Aug 2019 15:56:14 -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=wMbU2OyP; 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 S1727257AbfH1W4M (ORCPT + 28 others); Wed, 28 Aug 2019 18:56:12 -0400 Received: from mail-qk1-f201.google.com ([209.85.222.201]:50111 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbfH1W4J (ORCPT ); Wed, 28 Aug 2019 18:56:09 -0400 Received: by mail-qk1-f201.google.com with SMTP id l14so1609847qke.16 for ; Wed, 28 Aug 2019 15:56:08 -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=uqPQg6B/bO6e2oO0RWU/9KfcrqEBl402Sr4PpXrmZmI=; b=wMbU2OyPf3rFonkJbQ0wnImMKCEnwBI6Fdc7hS1qKKi2qEZxBn80d7aA/5N5SpNbS6 kDYDXogL/j90hxIc0Nhh+DzSJ+yDX6GGzU396lafxavIFWPx2tCNAMrn75SidlcDcnhF PmrYj+yT3bXJHTxMey43cZL4vxPAeEMlt61ylLqPRtHKxEtP6EUOMGmh73hSyh+twaAt iOxHLhwoLPNYSw1kUsXwfR9BBlIe+UlbM/RgLS6kP6pOl5EVmssWclAvoiZQ486eyShj FtqUYKsQyBSNaE5HpfHNEGAT2k3TK8uAmRtFvMLQqVe3ZcFKOrzFGJBj8R8mZPrEfG8y kANQ== 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=uqPQg6B/bO6e2oO0RWU/9KfcrqEBl402Sr4PpXrmZmI=; b=W8uOdRGfNzWqaAjkZd4vtj+HPh/+11In2/9BiH4EOAGbvhpPL2gyYGSZvHKi/wDTyy yole5SGq3kJZx44Fr0C4iHAsVniotKRG+tbCMI2s52tBnhGaJiYokF7Uzuzw3ntmOmaW fYObc9mLmqKW3JK2xQVjXTazSqEHkXUO5jaI0zt1m/KL42yHN7NwVJOv43F1bTVGx4RE iDomRqInx9y80xIPNu8vzEiI+Pn9HkEYMTAWPPRAgNTYyjfRN+qOmpK1IZkCl5c31TdN oqstZxWWTsT2wFCUShlUp8RsZjhVYHYbHWUE51lerLBPJTyjMTjgTyLp1syv/2XBU2dT GgKg== X-Gm-Message-State: APjAAAWABKgLG4VkOVHjMp/M6iSPsiE12xial0/Yt7N+yGUjsefpRtSt zMFPGMsBvETAhFsALVYuXa7SsOb4dJqBob23KM0= X-Received: by 2002:ad4:4533:: with SMTP id l19mr4645199qvu.23.1567032968146; Wed, 28 Aug 2019 15:56:08 -0700 (PDT) Date: Wed, 28 Aug 2019 15:55:25 -0700 In-Reply-To: <20190828225535.49592-1-ndesaulniers@google.com> Message-Id: <20190828225535.49592-5-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190828225535.49592-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog Subject: [PATCH v3 04/14] um: 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 Link: https://github.com/ClangBuiltLinux/linux/issues/619 Reported-by: Sedat Dilek Suggested-by: Josh Poimboeuf Signed-off-by: Nick Desaulniers --- arch/um/kernel/um_arch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.23.0.187.g17f5b7556c-goog diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index a818ccef30ca..18e0287dd97e 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -52,9 +52,9 @@ struct cpuinfo_um boot_cpu_data = { .ipi_pipe = { -1, -1 } }; -union thread_union cpu0_irqstack - __attribute__((__section__(".data..init_irqstack"))) = - { .thread_info = INIT_THREAD_INFO(init_task) }; +union thread_union cpu0_irqstack __section(.data..init_irqstack) = { + .thread_info = INIT_THREAD_INFO(init_task) +}; /* Changed in setup_arch, which is called in early boot */ static char host_info[(__NEW_UTS_LEN + 1) * 5];