Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3418453ybg; Sun, 20 Oct 2019 13:17:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqkvsUymbClK8gd5b5u9N6HI9g1B8PP6ZtHuyEUOojmmSsKv7JdlABbVt7Vy2aV8q8swV3 X-Received: by 2002:a05:6402:28c:: with SMTP id l12mr21916018edv.145.1571602643408; Sun, 20 Oct 2019 13:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571602643; cv=none; d=google.com; s=arc-20160816; b=zwSSAqh5adjrQhLrHofpYoeIeWiHzhi+o2Q1eK4rdHwLbhwwJ6diO5CvuMZrTK3fPX zZ6H9S604hGrZVas2q2T03uLEhDVNQpzuu66WwywhYF+5stg8SSep/tEe7u4ddLA06X/ 8HM+y57JJ5t4rAoA0fPnGsEET/F/avjDWiZlwed4o56e1zN3++9R0mqKg9wqwTgdHbO1 R0Pb8RHiLtLG3JfGffnPnZ3U5d54WmEVN6os159ooB67HYcntRj3wLVUekDmZ2p3PgpP Jj8vsIqa2w8JznpM7+/DwY8mSAo0Rv5RgK/blreDTTydBicnBvluga11MCrKx7ms42FD QmEQ== 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:date:cc:to:from:subject :message-id; bh=5kyxdEbbqlP8IuaaPhr4hDgqyV6uwllYk+BJIm5DLdk=; b=mA/hmlj2HQdVHcpvXRixzf3u+PQxL1quvXreHqxVzlzqIlYg0j4o32gch6J59BfyBg AOz0UqE5pM7x1EdtylP7p6ElWY8JIJ5VF5k+Ma2qjcue5zXmSIGpnZEr0n1H3f2UWSDm Y7+rYJQWuAC1IBT9+sTIQ7hJjXXMiG90Auhj+dXfqhdKxFJcAZvrvRYOw33EUmU6gCuM RoXCsE+82At5Wm6Nx3iBWKvWZf6IfgpWwWT4DrvAhgUKxVR94NROBRrab12VB9uAjxdt Ez3ae0KowZt3gEsmoU35nTJIqiEWz6m2EG8r0AdK8dDdxFaV0guXvNd94qB/36rH+gl1 bDtQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e49si2190356eda.229.2019.10.20.13.16.44; Sun, 20 Oct 2019 13:17:23 -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; 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 S1726428AbfJTUQY (ORCPT + 99 others); Sun, 20 Oct 2019 16:16:24 -0400 Received: from smtprelay0030.hostedemail.com ([216.40.44.30]:38572 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725940AbfJTUQY (ORCPT ); Sun, 20 Oct 2019 16:16:24 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 5D9B3182CED28; Sun, 20 Oct 2019 20:16:22 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:599:960:968:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3872:3873:3874:4321:5007:6119:7903:7904:9010:10004:10400:10848:11232:11658:11914:12297:12663:12740:12760:12895:13069:13255:13311:13357:13439:14659:14721:21080:21433:21622:21740:30054:30070:30090:30091,0,RBL:47.151.135.224:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: wheel18_5490528770d3c X-Filterd-Recvd-Size: 2507 Received: from XPS-9350.home (unknown [47.151.135.224]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Sun, 20 Oct 2019 20:16:21 +0000 (UTC) Message-ID: <7ef650e0a6487a3eefc8df9eaf0ab20b5d26bad1.camel@perches.com> Subject: Re: [Outreachy kernel] Re: [PATCH v1 1/5] staging: wfx: fix warnings of no space is necessary From: Joe Perches To: Julia Lawall Cc: Dan Carpenter , Jules Irenge , devel@driverdev.osuosl.org, outreachy-kernel@googlegroups.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Date: Sun, 20 Oct 2019 13:16:19 -0700 In-Reply-To: References: <20191019140719.2542-1-jbi.octave@gmail.com> <20191019140719.2542-2-jbi.octave@gmail.com> <20191019142443.GH24678@kadam> <20191019180514.GI24678@kadam> <336960fdf88dbed69dd3ed2689a5fb1d2892ace8.camel@perches.com> <20191020191759.GJ24678@kadam> <6e6bc92cac0858fe5bd37b28f688d3da043f4bef.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2019-10-20 at 21:52 +0200, Julia Lawall wrote: > On Sun, 20 Oct 2019, Joe Perches wrote: [] > > There's probably a generic cocci mechanism to check function > > prototypes and then remove uses of unnecessary void pointer casts > > in function calls. I'm not going to try to figure out that syntax. > > With the --recursive-includes option, perhaps: > > @r@ > identifier f; > parameter list[n] ps; > type T; > identifier i; > @@ > > T f(ps, void *i, ...); > > @@ > expression e; > identifier r.f; > expression list[r.n] es; > @@ > > f(es, > - (void *)(e) > + e > ,...) > > This of course only works for functions that have prototypes, and not for > macros. It will also run slowly. You are not kidding about slow, but it doesn't seem to work for mem, maybe because system includes aren't analyzed. Single file processing time on an XPS13 averages more than 100 seconds per file. Also: expression e; could probably be better as: type T; T *p; as some of the expressions cast to void are int or size_t and it's probably better to restrict the conversions to just pointer or array types.