Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp844014yba; Wed, 24 Apr 2019 10:30:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqLieBnuIm0RJYupjmXHaiNasm7O2LxqeUcCZHBBITg20qzCT4rZIs3RirIZH1oWLI6icD X-Received: by 2002:a63:1055:: with SMTP id 21mr13118799pgq.200.1556127010106; Wed, 24 Apr 2019 10:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556127010; cv=none; d=google.com; s=arc-20160816; b=gP6AfVBltAfn/ncik9iZ+rwX4VKcRVcTE7VpOS2AEJsD8bfo9+NIVmUNEKH5flC5KM ZtgwcK1Rmdic9gxgw7taurIMqOrNju3QQftFERnwCc7gCtpCh+Eb3eaP2bMegMKel4g3 QL+xL1fDs2Th5+Y8x8gNyQ9n4BH9BTIJ/0LbsMyBF7ckcYCmsovleBWO60qqJ3LxgQqH UQJx1uN6zJ1nQU8xc1RXXKfdKh88aa+9/3haBDYpN8qSwiVUjorJzyCKq0X3mMkXjWQd DjoYN6aeyJjMFXN1XvcWo9dISQtERLUrXanFYoG7+QMu/97YBz5hFF10yEjUrZoQzMc8 FAwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OP6lmy/rYZY5cw+uTSqGslPAa+j9bZJwIMQGGt0mYiU=; b=ncO+lNQiwoIjcVgDdavs0jqdI6Ep0HU2lkVHl8CUagjOdC4E3QI97LjBRfMxdAjstP /9aWihiaCMoJe5pWmciv54olnb7apwnFF59bQfPEoIfdPjpSIo/6CirSCttHQNskUlh4 OiMHLfOkYT12xmsznyTNMeCvWRQF3DZ8BQCYc3BIz+Ot0bgCgLoBAb0d4KPS3XY2HtAy eynfwlgK3LDLthsVADLrusuX2qkKZ8fNs+k2Q5A0T1tkMi0dNfW/q94B3XiB+1I9BnBt EU8TtxO2dxeiG2cC0boBL/p4Waeum0PLpNiBIfNn97gIbowI1Xz8e7wSw04O2KDNiDOI FH5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t2crSEv1; 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 i66si2304186pfb.154.2019.04.24.10.29.55; Wed, 24 Apr 2019 10:30: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=@kernel.org header.s=default header.b=t2crSEv1; 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 S2390661AbfDXR2S (ORCPT + 99 others); Wed, 24 Apr 2019 13:28:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:54418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390624AbfDXR2M (ORCPT ); Wed, 24 Apr 2019 13:28:12 -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 78A54205ED; Wed, 24 Apr 2019 17:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126892; bh=wYJvOLFXM690ZlUhoZRZMWv4lJTdf5IP3GfcarvN2mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t2crSEv16lDmnMjW9TJSQSNwdHcZmxkTVKHL7wTELMDOeLhW0SnojJCrmb2ojrcRK jp+sJHNNKdLgVEfF+Vh2Rm+bUOMFdDX/U5glCjhscs0o/F/l/Wonsr2AYn91rNy5EY 0w2a0fB9eqejVJNJVV7yYxoufFP4KX68Go/FFhac= 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.14 53/70] modpost: file2alias: check prototype of handler Date: Wed, 24 Apr 2019 19:10:13 +0200 Message-Id: <20190424170917.248249903@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170906.751869122@linuxfoundation.org> References: <20190424170906.751869122@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 6e3ae94cf123..55b4c0dc2b93 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 @@ -1228,12 +1228,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. */ @@ -1346,7 +1345,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