From patchwork Wed May 9 09:50:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135235 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5423808lji; Wed, 9 May 2018 02:51:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrdAGfSHeF4d4QynjM5TYRf4oFH3GgKYQkX+K6woH9DAh6PzFF+C4yQsuKri4DTCvtyEX3W X-Received: by 2002:a63:6fc8:: with SMTP id k191-v6mr35434805pgc.330.1525859470334; Wed, 09 May 2018 02:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859470; cv=none; d=google.com; s=arc-20160816; b=Z8eNbii9jiUZPSsm6oC3XoKr21gPkr4++81XZabT/wNhCu0opCGxaOcADPf19Z/fk9 3XPKELyIUjqSzSdkblyi4PIWaD7X2kC9ybQyAoliU+DDXl4EUKb+bA0FJx0ozoL1B1a3 ImHzZSxffMbwxU7EdRFIQUiMJGCZKCUK2h7EPfBIgTP1IsJqvx51pwfAgP7xXH/lipIi eFY6PZTf69Z3kQaavhEer329YzqMZKayEJDbNLB+FtXB8xrxbyGdUgQdHizqoUVwGFYw hrak1BKbT2uiVoPsPELGk5it5MejQJlcAG1TfPACh0XoSm2P4DlYqDuz2P4q/ORLl8mx ztgw== 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:arc-authentication-results; bh=yaTomzog4af21guXGL9xN2AcYRx/fiNNVX3GYZLrlSc=; b=eoWGDeVFgBAS4TZ82clL5SfZJeMM1lucBLOrMt4HvZc5p47m7c1I743LKijOGSUrLS LdvpxzcPLGDSAYSU78q9+OWjwdBevxMwSajY9gTOVvwwNmpghJP+FbETq0+EGgtXWo0t 2LxAGnPLVZlkt8eHcQrY9PmcA8mgyeRP+jxjSU9mq+wLn79r8M5llr3AE4foDABOqAL9 sOA74HcmDYSW4U18+kYetRqL5lEViwEarJpOmnv/Fx9Y/1g7yszkwcn/uAf0q+t+5YYX 9Cb1Xc/NE474H/RlKY5Q1FwZN9yYP05heWG4NdwbJt3WYPPSmznfE+uZq/QU7vSINaFP TJXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Q/DyLgwz; 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 r9si17702899pfg.247.2018.05.09.02.51.10; Wed, 09 May 2018 02:51:10 -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=Q/DyLgwz; 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 S934514AbeEIJu4 (ORCPT + 29 others); Wed, 9 May 2018 05:50:56 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:53968 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934133AbeEIJuw (ORCPT ); Wed, 9 May 2018 05:50:52 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w499oiPM018127; Wed, 9 May 2018 18:50:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w499oiPM018127 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525859445; bh=yaTomzog4af21guXGL9xN2AcYRx/fiNNVX3GYZLrlSc=; h=From:To:Cc:Subject:Date:From; b=Q/DyLgwzMwWlpVZ+YrR+wb+jnEKQ5P3TkN6jAZG/NGqmzmgFxflg0b+Qs1zS3V4xu UVYYzwTJdBPCO4tLhkxIXrcAlTdWJJlUikOgIWBfBydhS8/q+hN3UJhy7hw5vwBmSO v1PjV8eu5hbmGDFsxFBd7soBUXCQvjW1ol670KjLozjAC+IAcdU5y1k6/ARQsy8Dvw t7lbkEbQEaq5eQAQAWtQdlTlLT9+lSnUi6BOheOyCnmekHKPQIshfzgItWrplNqzwX JPbnAepTbmLGepBdBFpBKKjifCQ5UoAOTNTKc2EfWMg3y8effnMGPNts4QUoSw/855 CLPMSIYYBUrwQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/4] modpost: pass struct elf_info pointer to get_modinfo() Date: Wed, 9 May 2018 18:50:37 +0900 Message-Id: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_(next_)modinfo takes a pointer and length pair of the .modinfo section. Instead, pass struct elf_info pointer to reduce the number of function arguments. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index bc71925..37a6a0b4 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -724,16 +724,17 @@ static char *next_string(char *string, unsigned long *secsize) return string; } -static char *get_next_modinfo(void *modinfo, unsigned long modinfo_len, - const char *tag, char *info) +static char *get_next_modinfo(struct elf_info *info, const char *tag, + char *prev) { char *p; unsigned int taglen = strlen(tag); - unsigned long size = modinfo_len; + char *modinfo = info->modinfo; + unsigned long size = info->modinfo_len; - if (info) { - size -= info - (char *)modinfo; - modinfo = next_string(info, &size); + if (prev) { + size -= prev - modinfo; + modinfo = next_string(prev, &size); } for (p = modinfo; p; p = next_string(p, &size)) { @@ -743,11 +744,10 @@ static char *get_next_modinfo(void *modinfo, unsigned long modinfo_len, return NULL; } -static char *get_modinfo(void *modinfo, unsigned long modinfo_len, - const char *tag) +static char *get_modinfo(struct elf_info *info, const char *tag) { - return get_next_modinfo(modinfo, modinfo_len, tag, NULL); + return get_next_modinfo(info, tag, NULL); } /** @@ -1951,7 +1951,7 @@ static void read_symbols(char *modname) mod->skip = 1; } - license = get_modinfo(info.modinfo, info.modinfo_len, "license"); + license = get_modinfo(&info, "license"); if (!license && !is_vmlinux(modname)) warn("modpost: missing MODULE_LICENSE() in %s\n" "see include/linux/module.h for " @@ -1963,8 +1963,7 @@ static void read_symbols(char *modname) mod->gpl_compatible = 0; break; } - license = get_next_modinfo(info.modinfo, info.modinfo_len, - "license", license); + license = get_next_modinfo(&info, "license", license); } for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { @@ -1977,7 +1976,7 @@ static void read_symbols(char *modname) (is_vmlinux(modname) && vmlinux_section_warnings)) check_sec_ref(mod, modname, &info); - version = get_modinfo(info.modinfo, info.modinfo_len, "version"); + version = get_modinfo(&info, "version"); if (version) maybe_frob_rcs_version(modname, version, info.modinfo, version - (char *)info.hdr); From patchwork Wed May 9 09:50:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135237 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5424099lji; Wed, 9 May 2018 02:51:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo9O7RGWOc3nCsridsZtTFmjFgrZxLdHYRjlYLa2Zf/wky4BbhsngZjKcLDkY9s+76+9k6a X-Received: by 2002:a65:538a:: with SMTP id x10-v6mr33844595pgq.181.1525859493210; Wed, 09 May 2018 02:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859493; cv=none; d=google.com; s=arc-20160816; b=nHIx9w10fENWo8lyNXtHwGj5eWNbMUIl+408PDBv1l7S2ZTZ8lkFI/jbobhazyU7TC aL+pmlDlevY28x7ImpEGBKftyaWnPeDywgVMqYh2rfO41m2gI8/IWhbYeM235BTXXb0M aA1RzYWRcqYibKdwGCu2zJGo6HHn00osJNhPtCGdgOa0ehi7AnIup9lYRpIz2Lw4mMGF Hm7u88xRf1/Ri+kkRMZ9DW7GTxljVPJQjAecyRYyyINN9vy4k9om8eiVds0KfqSGx7Ql N5mU+eU4YRe2zLtZo7Te8G97sjGz4kYyq1rYKY9jixcvbLU+KAIaOmuIMYRk9gI0ftN6 x+zA== 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 :arc-authentication-results; bh=wbPqzqvArwea1E71BXsGqTT4rsndB2L+CocO3Pk97ZQ=; b=R9UQMGsz7hncoySuaLe1sKiW4bKufIjFLQ31ZrlaKUIWAZ8vgmj1/QfPsijW9qCGtd rbBnORgvWIoUYwtBNP0I7yBtmDT8ArPhpMLc3jmV/nC02h/y0b0L0lyKYRKsjqLXS1wQ R817f03S6Ozsiy8cwNc5mUkxZhhax00NFZc5AnHCASzI8aYLIEmHF6UkISf3Viq7/ewx z3mv5EVGA+g0sPZiuYWjHZviUuX8JZIwaTqiW8cc/MVPPcyM7GvGX4Jg5MSOTwEBHPpe EVdFZBEG/THk36pN7mKsAyWzPOqqRSp/m/CFPxNd4qy2b8y49s+9F/q61bQsFMJOXBXK PKWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JNwGQ4jw; 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 33-v6si27005581plf.308.2018.05.09.02.51.32; Wed, 09 May 2018 02:51:33 -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=JNwGQ4jw; 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 S934543AbeEIJva (ORCPT + 29 others); Wed, 9 May 2018 05:51:30 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:53967 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934150AbeEIJuw (ORCPT ); Wed, 9 May 2018 05:50:52 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w499oiPN018127; Wed, 9 May 2018 18:50:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w499oiPN018127 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525859445; bh=wbPqzqvArwea1E71BXsGqTT4rsndB2L+CocO3Pk97ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNwGQ4jwClTCCRuGzx/KU1wsBzC9XAKudc5bYT+ejZrDf5A3iUyAM7UtWk75rLj6a RSUMy9ZkGrFGiMjZq2jFBZrapWfkY6BTmdObhGxuXniPM32UDbwlp3mLtGv4Y4FUh8 LuYlhZROm6dZemetGB1IQRpfOuPUqEhyCbMd7OEq8+4vArLgD0aIjmiNS+ghJZtVbf I+vZcwB7h3LxnM/Jzc5bvXY2rDU5alY/YY2ZHeqaTnqmyPCJq9FFSmUFcYThC2wfTf rikPCU6uZ2y95lN/6qCjT0jQMr1VLBffFChYnZRSkeYgXSJQJDCkjpz9x7h8ccddi5 3Rsv18UitvSIQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] modpost: use strstarts() helper more widely Date: Wed, 9 May 2018 18:50:38 +0900 Message-Id: <1525859440-29583-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> References: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, strstarts() is only used in export_from_secname(). Use it more widely to improve the code readability. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) -- 2.7.4 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 37a6a0b4..8606b6c 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -596,19 +596,19 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) return 1; if (info->hdr->e_machine == EM_PPC) /* Special register function linked on all modules during final link of .ko */ - if (strncmp(symname, "_restgpr_", sizeof("_restgpr_") - 1) == 0 || - strncmp(symname, "_savegpr_", sizeof("_savegpr_") - 1) == 0 || - strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 || - strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0 || - strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 || - strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0) + if (strstarts(symname, "_restgpr_") || + strstarts(symname, "_savegpr_") || + strstarts(symname, "_rest32gpr_") || + strstarts(symname, "_save32gpr_") || + strstarts(symname, "_restvr_") || + strstarts(symname, "_savevr_")) return 1; if (info->hdr->e_machine == EM_PPC64) /* Special register function linked on all modules during final link of .ko */ - if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 || - strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0 || - strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 || - strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0 || + if (strstarts(symname, "_restgpr0_") || + strstarts(symname, "_savegpr0_") || + strstarts(symname, "_restvr_") || + strstarts(symname, "_savevr_") || strcmp(symname, ".TOC.") == 0) return 1; /* Do not ignore this symbol */ @@ -623,13 +623,13 @@ static void handle_modversions(struct module *mod, struct elf_info *info, bool is_crc = false; if ((!is_vmlinux(mod->name) || mod->is_dot_o) && - strncmp(symname, "__ksymtab", 9) == 0) + strstarts(symname, "__ksymtab")) export = export_from_secname(info, get_secindex(info, sym)); else export = export_from_sec(info, get_secindex(info, sym)); /* CRC'd symbol */ - if (strncmp(symname, "__crc_", strlen("__crc_")) == 0) { + if (strstarts(symname, "__crc_")) { is_crc = true; crc = (unsigned int) sym->st_value; if (sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS) { @@ -648,7 +648,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, switch (sym->st_shndx) { case SHN_COMMON: - if (!strncmp(symname, "__gnu_lto_", sizeof("__gnu_lto_")-1)) { + if (strstarts(symname, "__gnu_lto_")) { /* Should warn here, but modpost runs before the linker */ } else warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); @@ -691,7 +691,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, break; default: /* All exported symbols */ - if (strncmp(symname, "__ksymtab_", strlen("__ksymtab_")) == 0) { + if (strstarts(symname, "__ksymtab_")) { sym_add_exported(symname + strlen("__ksymtab_"), mod, export); } @@ -1171,13 +1171,13 @@ static int secref_whitelist(const struct sectioncheck *mismatch, /* Check for pattern 1 */ if (match(tosec, init_data_sections) && match(fromsec, data_sections) && - (strncmp(fromsym, "__param", strlen("__param")) == 0)) + strstarts(fromsym, "__param")) return 0; /* Check for pattern 1a */ if (strcmp(tosec, ".init.text") == 0 && match(fromsec, data_sections) && - (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0)) + strstarts(fromsym, "__param_ops_")) return 0; /* Check for pattern 2 */ @@ -1532,8 +1532,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, from = find_elf_symbol2(elf, r->r_offset, fromsec); fromsym = sym_name(elf, from); - if (!strncmp(fromsym, "reference___initcall", - sizeof("reference___initcall")-1)) + if (strstarts(fromsym, "reference___initcall")) return; tosec = sec_name(elf, get_secindex(elf, sym)); @@ -2163,9 +2162,7 @@ static void add_retpoline(struct buffer *b) static void add_staging_flag(struct buffer *b, const char *name) { - static const char *staging_dir = "drivers/staging"; - - if (strncmp(staging_dir, name, strlen(staging_dir)) == 0) + if (strstarts(name, "drivers/staging")) buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); } From patchwork Wed May 9 09:50:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135234 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5423665lji; Wed, 9 May 2018 02:50:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrS+vuwxCOairYidRr/I1jWj460az9PlvKBq+xhdJdMuJISQRLjdZ5rn6Zt9UhbZO40Qysl X-Received: by 2002:a63:9846:: with SMTP id l6-v6mr3707534pgo.217.1525859459504; Wed, 09 May 2018 02:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859459; cv=none; d=google.com; s=arc-20160816; b=m8loSpf+zPElUZZNyEV+urDLfscbScfSPqSz9Iehz3jgupo+XP8ePZ/VZ/KjXIgWyI kiXFZ9gKTzIy+sgecS6kDZG7bzrBJU4v3qG0GlgyKvQmzkWNs3585XK9J+peob155Msx +Y3gIZorGrf8GW3W5orVjq0FWR1q4Xjd90WV+npRbRcta+o4JSDZ0T4dwZ5CacOTKDMU uPT30ehICYp4I8nfac7qg/xRrFm4luJlBH51Do/575NG0/nSu2mv6H9s50bF5LPbNJ7I YHTs4j62bBthc6ckojCWcdTDsNztrPF0NLudJhPVVFYrhSFxjS+s90ULJWhhaHerJsgO O8zw== 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 :arc-authentication-results; bh=kIlbVj9Rct97c7dFUI0MYQX2njKCjdQopAnqkmOVQP4=; b=mrQ97odmhN2TM/Y4VNKgvcxZG8gs9fDSmKISHg23ZSpqTRPvFSZ8kHidIHveue5jxl eEeuBcOW5uq5uuc35d0rQL1HK9H/kgZDrapD5qSEYAiqBYay0byBOrHNLPWI5MtSAQZO 5+His1xrth4EjDq18S2bgjv7uZ2sFcihOutAsCKBBFMlokwFC+93QUMLDdD8tlqU6mZv isLZuU0MBqRPkMltLh8cNPz0mZzFr+1UgKR9ZRnqDIzx3TjKtTe7yb5HwTIC0WipYkhG jNICO6NtpCbqEd+ZDxU5/BvCKq3ReaI2EfnFH0vASTu59YtrODHjHKEJi2cUQZfJnfsj 3hmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RHn2pI7v; 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 r9si17702899pfg.247.2018.05.09.02.50.59; Wed, 09 May 2018 02:50:59 -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=RHn2pI7v; 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 S934531AbeEIJu5 (ORCPT + 29 others); Wed, 9 May 2018 05:50:57 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:53966 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934142AbeEIJuw (ORCPT ); Wed, 9 May 2018 05:50:52 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w499oiPO018127; Wed, 9 May 2018 18:50:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w499oiPO018127 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525859446; bh=kIlbVj9Rct97c7dFUI0MYQX2njKCjdQopAnqkmOVQP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RHn2pI7vc8IxQZdJVCPx6CpJUDy7BeS060xA0ua66wWoD+Ww2W4EWrkSB3/mM8K8z 4CFLiHZilEhHHkNiI3Ce6MoFLk/OGUthmOEDwsQlZHy/1JuAYNbEER5jL/sf7eio9n UyUr30qpKgEgER2Qhy8M+QqzWWVPjUVPAxrIA8t1RSFO13aTgQReIq3SBfZK1KsAxn 0IWd+8Bmn06nWD5kzrLlhyl1x2a4zYoCyC9gHtdsQg4qeeQMVGW+I/i3EotPInnAMN tyXqfqUu1B2GJh/yhq+c4KISsz7txSTQeGJn4BGaLPQ5HT5njxNnyhqCwfCYhRT/Hc 1d/oGlDkudxyw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] modpost: remove redundant is_vmlinux() test Date: Wed, 9 May 2018 18:50:39 +0900 Message-Id: <1525859440-29583-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> References: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The second test of is_vmlinux() is redundant. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 8606b6c..9e70a6a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1971,8 +1971,7 @@ static void read_symbols(char *modname) handle_modversions(mod, &info, sym, symname); handle_moddevtable(mod, &info, sym, symname); } - if (!is_vmlinux(modname) || - (is_vmlinux(modname) && vmlinux_section_warnings)) + if (!is_vmlinux(modname) || vmlinux_section_warnings) check_sec_ref(mod, modname, &info); version = get_modinfo(&info, "version"); From patchwork Wed May 9 09:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135236 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5423953lji; Wed, 9 May 2018 02:51:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKwuIyAPjVpJ/CqN+lPVfstunzkeyVUQuNpk4Usiy79zWduUHzVTwMD0EGX2zpc7Cuarjp X-Received: by 2002:a63:824a:: with SMTP id w71-v6mr4328971pgd.37.1525859481170; Wed, 09 May 2018 02:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859481; cv=none; d=google.com; s=arc-20160816; b=Y7qxlK3tyrWDwhX14XyIaHVvbCcO7hsuw98ucB8MJKCp3wzQVM+wyZSu4BtW2+AC1H ZcVPeWJ3TFNLPgNKEfgCyeO/rYYgyaWz7WZQXwA1T4iUvkKcd48AR3PY/1oC+RHdJH/d ioZbsxYLuHAt3hxTx2QukWKIj72cdvqSoHuWhjJqWAu/3lU9jK+Ycr5EA1gUhmphFZYC M0g+ReVhjAnEqJbXUOf0r7JlaQPM36bCG9vEGpJd5+GspTNoZFFlIzvefrTzUqFdm5TS LWoaKXL2Zj5HFJylsISbrGT6U9IFg8fKno+xhPxxxdrJ8kEanRJVozLhgmudPUVKSNwv unuA== 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 :arc-authentication-results; bh=iOeNdUYBpjMH5xDF92pRaVEMFaP/3pM/lj6ZmqM8A8I=; b=KtzThXoXCdh58hj9joFply+vL5Nj5Q/z2Nb+biq5+Tc/ze8cKDiVmexkeQH6VdpjqL HrGwD+PandySjm54nVeZE49e0L4V2zunlF1RkzGdpGHNhvjOyur2GRASlU14CCUxcsPV le084ZtVeiY5fqeKRQN2xJFTIC5UvCxkwzBhEoko6iUFoTVTc5gCH0LG/WE18kAWbg6D YTgoJgbwb2PDBu/hC+TMlAsXCBhj0uNSPQ1gzmgxxYMXDxhoBfXD8n3n0OhoTcN56VnQ 9nkZ6IWyPVCDu0rlDYgF92rP8BsxZGSdO7igXLs4eMrjLifkpKPBInHQL0Trew+QX/k5 hVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P14JP532; 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 m3-v6si26206622pld.296.2018.05.09.02.51.20; Wed, 09 May 2018 02:51:21 -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=P14JP532; 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 S934493AbeEIJuy (ORCPT + 29 others); Wed, 9 May 2018 05:50:54 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:53969 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934106AbeEIJuw (ORCPT ); Wed, 9 May 2018 05:50:52 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w499oiPP018127; Wed, 9 May 2018 18:50:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w499oiPP018127 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525859447; bh=iOeNdUYBpjMH5xDF92pRaVEMFaP/3pM/lj6ZmqM8A8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P14JP532SBL2n8NaStrr7jURYlAWwUcLBGlIlVQkbZazc9GWaQCTccGHtLQHRD5gh jmkbNQI+67dDb5G/YRdS140abzIZL3yyx8F6/keAZaGy4eLO4W9yAhhSW0h4Bv80ZN JmdlOz69m1xEPU8GHAxPDAYZRl9iOAMvGhk9EFxa8pJGDd2NLs8cKLRL2QZvFVaLtv bYOzcOhMGU9+hSapK5KjNR3pcZyovix5cB/dp5AcH25qvPedaSp+Weoio/72jtqbui m9BXOjWy858MnMw4MF7OZ+znQooD4u2Efia/FnXmsw0MSUFS0WbCnlUJtgH6kRTEqk Oj8d31/1kHqFA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] modpost: constify *modname function argument where possible Date: Wed, 9 May 2018 18:50:40 +0900 Message-Id: <1525859440-29583-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> References: <1525859440-29583-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Neither find_module() nor read_symbols() does change *modname. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9e70a6a..1663fb1 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -121,7 +121,7 @@ void *do_nofail(void *ptr, const char *expr) /* A list of all modules we processed */ static struct module *modules; -static struct module *find_module(char *modname) +static struct module *find_module(const char *modname) { struct module *mod; @@ -1929,7 +1929,7 @@ static char *remove_dot(char *s) return s; } -static void read_symbols(char *modname) +static void read_symbols(const char *modname) { const char *symname; char *version;