Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5922573imu; Mon, 26 Nov 2018 06:57:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4JbQfaOOY8fO8rcQXP3RI6nFO7hGUC0fzwdhtFh5/Klsg9j8jwnP8l4CQiR9Yek47rPDT X-Received: by 2002:a62:6f49:: with SMTP id k70mr5865894pfc.7.1543244270075; Mon, 26 Nov 2018 06:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543244270; cv=none; d=google.com; s=arc-20160816; b=hXZt+9kP5nmVuDwNSLtXt9/U+QBdizpSryLhW/xPpoLNSeW10+Vsukx4zHQRAP7M4V cDIyRVzv9YuQs9+r7AMMSf9UR61jerZ6KOfyG7tSZJpIvn2t9v60Ra6bL+JoD2vtKTkX mu48AE1qFwlOa2WF3WnB6+IJ5CmQQH0xRv7EMYttbHhs6JXGk0A8fTpxNCm498CvNroM dWW1gv7y+jHK+M65ygN4mI+oHip7WtG+mALhSmPxQtpJR5MhHs/Bp4SBAirMQ7lJMTpA yw/zae7UaV7cF1H7CW1wgaD52NNHwNrx5hdSPU4IrGE2re0U409RNKQ5p8JPQbeBSTsU 9OeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=F3GmQsado+aP7mYIIudxuKv6hyfoo9G6RoAPe6e82Yg=; b=t1S7GljVyOUwdSfTdv8Xc/prdniM+LodDuMXxcipXfbqEYlnP9pnBFlKLIizCyqi7Z E5+MbF2lgoD/ujkFSlwmXW23kBCDIHkqBHDzURdO/zUf2wImsjk5t+E94JQbTIhhJmIZ igmvsTO7av0wZqaRyYX4Zlt2joGKeGL5N1PkhLsuKzAR94mF4cfOlh9eA451aEeSRm+H jQkQR7B/i0z3xTaL2SKEadTICelSqQEzUJNpDBXE27bsXUWCFw0b+PY7usgllY9xkftG nFe8ZrfW/X26dJinL/clAIZy4yBF04wdJHQz/TOrFnh20svGzhdJy0n+RumBnlW1cMfw E+vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MV0UOfLZ; 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 32si564848plg.29.2018.11.26.06.57.14; Mon, 26 Nov 2018 06:57:50 -0800 (PST) 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=MV0UOfLZ; 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 S1726914AbeK0Bsf (ORCPT + 99 others); Mon, 26 Nov 2018 20:48:35 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:35743 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbeK0Bsf (ORCPT ); Mon, 26 Nov 2018 20:48:35 -0500 Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (authenticated) by conssluserg-02.nifty.com with ESMTP id wAQEs7o1021624; Mon, 26 Nov 2018 23:54:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com wAQEs7o1021624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1543244048; bh=F3GmQsado+aP7mYIIudxuKv6hyfoo9G6RoAPe6e82Yg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MV0UOfLZfp79YT+XKrWDyKmwPedPlaHZc5Xrgoz4okbWv0wBNwP2vRLoVpZcY64T/ tZ0+L6UnTdq0V8lpt6rZOI57qfhyEBW9S6aof3kM1hFMwYu4YFf1oyZSOpcNlyrwqO kA3n2XUijI4vmPvzVVWse3+X2VdJJwl7XymQ0VWm7sXIi6JbeJRiMAWiMwQLala/DA DcS7KAejzs3bAcgBJaLudxGTjApShi9Gn9tj1fDJ449PtFpbjY5o7FezFHb68FOmKU em+gdp0xBl5oAKYkjeREAeNi+Hlz4i9vHHDWCmuFYbmCoOeTK7OnHRKIJ+P3lrDX+M CFNcUUEuTFBsg== X-Nifty-SrcIP: [209.85.217.46] Received: by mail-vs1-f46.google.com with SMTP id p74so11490729vsc.0; Mon, 26 Nov 2018 06:54:07 -0800 (PST) X-Gm-Message-State: AGRZ1gL1eS4Bq2Y1YJL0copjZCva/bSyP6Ut3hknmsGi1IOX9FV/MJdv kaoXoYkIf3q0IB1R0e0Y1uFj1GuFKycksxlJlU8= X-Received: by 2002:a67:a858:: with SMTP id r85mr11474395vse.215.1543244046411; Mon, 26 Nov 2018 06:54:06 -0800 (PST) MIME-Version: 1.0 References: <1542860922-9730-1-git-send-email-yamada.masahiro@socionext.com> <1542860922-9730-2-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: <1542860922-9730-2-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Mon, 26 Nov 2018 23:53:30 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] modpost: file2alias: check prototype of handler To: Linux Kbuild mailing list Cc: Jessica Yu , Rusty Russell , Mathieu Malaterre , Miguel Ojeda , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 23, 2018 at 1:51 AM Masahiro Yamada wrote: > > Use specific prototype instead of an opaque pointer so that the > compiler can catch incompatible pointer type. > > Signed-off-by: Masahiro Yamada > --- Applied to linux-kbuild. > scripts/mod/file2alias.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c > index 7e4aede..a37af7d 100644 > --- a/scripts/mod/file2alias.c > +++ b/scripts/mod/file2alias.c > @@ -47,7 +47,7 @@ typedef struct { > struct devtable { > const char *device_id; /* name of table, __mod___*_device_table. */ > unsigned long id_size; > - void *function; > + int (*do_entry)(const char *filename, void *symval, char *alias); > }; > > /* Define a variable f that holds the value of field f of struct devid > @@ -1299,12 +1299,11 @@ static bool sym_is(const char *name, unsigned namelen, const char *symbol) > static void do_table(void *symval, unsigned long size, > unsigned long id_size, > const char *device_id, > - void *function, > + int (*do_entry)(const char *filename, void *symval, char *alias), > struct module *mod) > { > unsigned int i; > char alias[500]; > - int (*do_entry)(const char *, void *entry, char *alias) = function; > > device_id_check(mod->name, device_id, size, id_size, symval); > /* Leave last one: it's the terminator. */ > @@ -1420,7 +1419,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, > > if (sym_is(name, namelen, p->device_id)) { > do_table(symval, sym->st_size, p->id_size, > - p->device_id, p->function, mod); > + p->device_id, p->do_entry, mod); > break; > } > } > -- > 2.7.4 > -- Best Regards Masahiro Yamada