From patchwork Mon Sep 9 11:34:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 173373 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4229795ilq; Mon, 9 Sep 2019 04:34:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPKYp8yY1zIA7DH/4KSLm9jk1R9Jk4K7gM46k9lAxHeJzHR4YDl43CBC466MgwK5y7AVf2 X-Received: by 2002:a50:9734:: with SMTP id c49mr24027112edb.93.1568028882430; Mon, 09 Sep 2019 04:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568028882; cv=none; d=google.com; s=arc-20160816; b=htjjvjH8BCMDu/rFogLjeKSBlvFQE9pj9PWSAnA58uXCZzGW+d8a81VYMn8HrnEJus XG/akKIhmcFWmCXgxDUH2vuRJxwBYPG2j8RIIPHWuTX/HSf7c44XA/6RcVenmOBT7cAp SuIu8WIf95eSqEzADb7Ixnu5+lcCUqUUx+WZk7p/tIwW2ExQ4Iy6vyizl67Hxm6YuWaY qIo9XXdD5vDUT0vVIhPPszCa0viPDDohQTDx4UFsFHAr5PFi/EVYTu98ZDpZl/0/sT9w xZ+7fP7PgAaFrEUXNo9suWvgU4ws8U1ome6HQ7wuFjPw3VVDkA5lokiVygojASpxHkEm OmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=MSarGlnW9YOaZQr8nLXdZ/RHsS9R64+NgW7cxT9Bbn8=; b=gNyATEHpLzwZayNC7V7ha2D2irQ8EY5ohWuv9RERlVl1B6BACitmKXgEz5ASD0Lk/C iVophHKW1OsPYf1OdZGbMrNTpTQHrSm4uWhMzQgY/blCUlAwHDsm7ufMiXRolKGPGatr D5+nnVf71EAraGijeJX4YOQXoqSwSrkbRYZQLGDjCXaPX+/Qk4qBZ8FQ96guUyskfCNn 1zMRP9HjGqtbB+pMl13e8Pd7WSNHA2+RrEITnfoGoOVUAHD0tPjoNI6mJKG0NysaFgEL xNSxppKdC7yVqG4UuqSYzvDKTKp7G7AHq5UaRFvjxwK6QzQBJiUnqTidWUWQVlAELAWO MOGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Q3fs9o3m; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si7537575ejr.389.2019.09.09.04.34.42; Mon, 09 Sep 2019 04:34:42 -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=@nifty.com header.s=dec2015msa header.b=Q3fs9o3m; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404136AbfIILei (ORCPT + 28 others); Mon, 9 Sep 2019 07:34:38 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:60097 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403880AbfIILeh (ORCPT ); Mon, 9 Sep 2019 07:34:37 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x89BYPw6012688; Mon, 9 Sep 2019 20:34:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x89BYPw6012688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1568028866; bh=MSarGlnW9YOaZQr8nLXdZ/RHsS9R64+NgW7cxT9Bbn8=; h=From:To:Cc:Subject:Date:From; b=Q3fs9o3m9BOg5J/DkalhKGRPjLgAx3UPUN9aKw0GqKRlVIKbiSp7e7d3zhEFeRFDq PYL4zEMjhaovA7gYIYzpHk7DikEznHO6NusBsPzPkp0fVFIWIPZYgh1SmgBCOJ0IQ9 heD93HRUsOT23pmAaSlEHkVLjeWMNF4aWce9g6UWaYTuzcxY4VWkwPHX9ymmIMcfQU ObWXb9arotJ1nJSH2MYM2schM0p+qyoyRQdUoFzSR4FmZVPNvDzDiJzj362QZ0RaWb e8CqamjHtTQptro5TSaYEBs5UVr/7w7Zt0Xu5NBAMP+88E5UuUQ/KSI59WaojHNKAK 6b83kbWQDUCug== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Lucas De Marchi , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] modpost: use MODULE_INFO() for __module_depends Date: Mon, 9 Sep 2019 20:34:22 +0900 Message-Id: <20190909113423.2289-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes *.mod.c much more readable. I confirmed depmod still produced the same modules.dep file. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index f277e116e0eb..480c7b60153b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2250,10 +2250,7 @@ static void add_depends(struct buffer *b, struct module *mod) s->module->seen = is_vmlinux(s->module->name); buf_printf(b, "\n"); - buf_printf(b, "static const char __module_depends[]\n"); - buf_printf(b, "__used\n"); - buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n"); - buf_printf(b, "\"depends="); + buf_printf(b, "MODULE_INFO(depends, \""); for (s = mod->unres; s; s = s->next) { const char *p; if (!s->module) @@ -2271,7 +2268,7 @@ static void add_depends(struct buffer *b, struct module *mod) buf_printf(b, "%s%s", first ? "" : ",", p); first = 0; } - buf_printf(b, "\";\n"); + buf_printf(b, "\");\n"); } static void add_srcversion(struct buffer *b, struct module *mod) From patchwork Mon Sep 9 11:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 173374 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4229804ilq; Mon, 9 Sep 2019 04:34:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo2uwzztRsNjkk7172fpmwlef61aSmLQiMesksJSBfDYr727G2+HnBP8mKA2g6sToJXCid X-Received: by 2002:aa7:c355:: with SMTP id j21mr23358144edr.210.1568028882838; Mon, 09 Sep 2019 04:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568028882; cv=none; d=google.com; s=arc-20160816; b=UjrDVsyxGeyUau7H83NL0/9ZYvPHURY0aI5nbuM9L0yOPfP50qbrdo2hdNXKqtvSJf zVsY11iFi/TNJgJNP8ixRBzgPjJWKjhLftNdI/IX+/j2a8GCQf0gkLn7+i4c+mj+Un8Y DS21obv+0pLv9kQpj4O0Z/a3UqxvQcl0JKwdOUqcYd8+K2ezH1HtJ5AibJ1BUatJWHlZ Aja5gjrD2deQ6+y00RLGvlpio1yfQw8RqPu1X184zo5UBz+3o12lErgO8K+Mervrg5Ui GZJF8dCUQxuNLMCGa8pS3+EEr7crB9Rqo2lWBNSgRzj/PTRlc1w2C5byPGvuCHyCeV8G E1lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=qwVV+ymKu24KVZhw2r78oztqOJ1wcoVVFfPTdN1I4Ew=; b=H454FhSufd8XXXDKCsYajjx3eemPSXDW3mm0QQ98RllSwh8OlnbhG/UQUcTU85ywOU lTJQ7z5ZJmvXErt9TeZJost/1fEasJzG2N2SMlA605EVfJL2oVm5EvmWG62QviqGPKop kRaymEDX100G5Q1KldXuJGFavtmHslySJE5Axolx+cvAv2+YLWTdZA3NO3oF0I0B21St U4mb4UAC01oUwOKploe7054s84PsGvtR7A2raDefy5Pi3ZtethWUNAGfiNKH97V7iQdR os8rFGsAGCfpTLY6pEkEoPd41Lm0b++1uUGALvWiQmO797PUh2WTDaOJDDhlElsIgWlx SAnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ESJ4wZNU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si7537575ejr.389.2019.09.09.04.34.42; Mon, 09 Sep 2019 04:34:42 -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=@nifty.com header.s=dec2015msa header.b=ESJ4wZNU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404161AbfIILek (ORCPT + 28 others); Mon, 9 Sep 2019 07:34:40 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:60119 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404103AbfIILej (ORCPT ); Mon, 9 Sep 2019 07:34:39 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x89BYPw7012688; Mon, 9 Sep 2019 20:34:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x89BYPw7012688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1568028866; bh=qwVV+ymKu24KVZhw2r78oztqOJ1wcoVVFfPTdN1I4Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESJ4wZNUd6jlgvkXG32t74wGRLXE4TB3AQ81jyghI1D1F/YwNuZWxQTFyiu58XRxl SnLmzXb8AyOB/oHunoyhrxmD+EAck/seIvIdyudjQ4pvifp+sX8pUZ+AJF+SiXZk5h laA+1/arZUaoWKmYm9he2aTxCBmJWNl+Yzjs4NQajTucjfrue63e5w8KG49hTNop1V SnWWG4h8cdihm0zGUIaA8XP073uYUr9yI6yOtOUuvYWHFPuCOH3/9Q2Uik7O8ldCA2 BqrymsyaVe9ZUOQfrmK5Azb4wcFfHg+F2zRRUQBCA4CWfyBZRbt9Km4s4jvhpDmID2 psVgmNdqSYaKg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Lucas De Marchi , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] modpost: use __section in the output to *.mod.c Date: Mon, 9 Sep 2019 20:34:23 +0900 Message-Id: <20190909113423.2289-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190909113423.2289-1-yamada.masahiro@socionext.com> References: <20190909113423.2289-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the __section() shorthand. This avoids escaping double-quotes, and improves the readability. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 480c7b60153b..0dd1bb6f6eec 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2159,7 +2159,7 @@ static void add_header(struct buffer *b, struct module *mod) buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); - buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); + buf_printf(b, "__section(.gnu.linkonce.this_module) = {\n"); buf_printf(b, "\t.name = KBUILD_MODNAME,\n"); if (mod->has_init) buf_printf(b, "\t.init = init_module,\n"); @@ -2213,8 +2213,7 @@ static int add_versions(struct buffer *b, struct module *mod) buf_printf(b, "\n"); buf_printf(b, "static const struct modversion_info ____versions[]\n"); - buf_printf(b, "__used\n"); - buf_printf(b, "__attribute__((section(\"__versions\"))) = {\n"); + buf_printf(b, "__used __section(__versions) = {\n"); for (s = mod->unres; s; s = s->next) { if (!s->module)