From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 660C7C10F11 for ; Wed, 24 Apr 2019 17:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 335FC20835 for ; Wed, 24 Apr 2019 17:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126621; bh=RtmBPvo27gjkmmkMUDnGgBEJNLs/w7S0CYR6f8VdT1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=F83oF+lLAzTWWEL4wGS1uzvD7465q829ISriEhi4bYpS+pehWprq4bEjfXSzzlapT /RmbWhKUlnugSXkKlPueUox7sCGLyz4TUUSw97jNy6Y18HydwTB5g86ba/3s6l4P6h v91bVbk6LVSGGydwMj7WOMhrzIA9/goYm3NY+REc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389375AbfDXRXj (ORCPT ); Wed, 24 Apr 2019 13:23:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:49290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389011AbfDXRXf (ORCPT ); Wed, 24 Apr 2019 13:23:35 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2222F20835; Wed, 24 Apr 2019 17:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126614; bh=RtmBPvo27gjkmmkMUDnGgBEJNLs/w7S0CYR6f8VdT1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yxhz4JNIiY0ujQgfzV4wRDSgl7IQ7b5DFNVEicZuY1qZ0WXUzw3NSfnpN4+bsIvJ5 DtLtcjhnmMCIbLkTI3WF9TW+swJQjwIN7rlAbRL81782+t3VO6S8GbvZ4l3D+oInMl /cn1ApHvpXdiCAehrbmRkuR0w139PrRcyZNEEMlY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Mathieu Malaterre , Nathan Chancellor , Sasha Levin Subject: [PATCH 4.4 146/168] modpost: file2alias: check prototype of handler Date: Wed, 24 Apr 2019 19:09:50 +0200 Message-Id: <20190424170931.846891168@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170923.452349382@linuxfoundation.org> References: <20190424170923.452349382@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit f880eea68fe593342fa6e09be9bb661f3c297aec upstream. Use specific prototype instead of an opaque pointer so that the compiler can catch function prototype mismatch. Signed-off-by: Masahiro Yamada Reviewed-by: Mathieu Malaterre Signed-off-by: Nathan Chancellor Signed-off-by: Sasha Levin --- 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 d0b164084225..4250d3d6f391 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 @@ -1198,12 +1198,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. */ @@ -1314,7 +1313,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.19.1