Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3427210ybg; Sun, 20 Oct 2019 13:30:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz44+i7BppzDwXUKYIPZdOjW9jvQDq2fNIEy1AlCURaV7vEBXEy4daeLrfK5KhPBzwHQAsG X-Received: by 2002:a17:906:cd11:: with SMTP id oz17mr18841162ejb.71.1571603419010; Sun, 20 Oct 2019 13:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571603419; cv=none; d=google.com; s=arc-20160816; b=UOYUsv/qiMPdxPNkx6YpgEeisy9nc9wiqs9fJi+cEOJA/eBrzqN+ODAqT1s7dfWijW /nUg9vF4XErLgOMq/KzTH/E42q079Z8QpQ/CX8IC7ttmW+C1hTXieI+NtfEfS4nCNsU/ 6UlJkuuiyc5bYDTZhgdbgZeyYKRclUdjPQXO0hnEMvsvQyBtxIQrZ/Z5BR5X3dKTOvyO D5pkrKNm+vmvNu+gKwPVAjhHX33/cOFY2IO1VowK6PWmTyb59kFwcmVCZtxggwtHnCDy J1Au2l3u5B6Ql12nYjtg6T3RRFBCJKWlCcneV1Awa6HSWpZhp/5uLVwSgSyhiJ31xQhS x9rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=JuafAuJM9hKGsP5GBgFxzO4kvEo/JghFytSykCNUosY=; b=cXqd41Ds8pYkxYlSyRqFjs3qdIhX60tkETTBynnIZYgmZ67zg5+9bQs5336aUYXduA mtQ2zf+qM6nNMmEODIL8kp9MBA81KpkjBbWTsIQ+V6O+imMOG/ENtjZx21xJ2KszgA3D q9FGnGY+4u28jeex9to/K5FlSGzELEsVyt7yW1Hk4Ggfp/s1vC0CyKHOm644LtvqD5cM /KHgXpkKE07uzQiKn//HbU+pgnZ6yIh7SS+/rR2VyYuCdXxgOJhT/Vc4lISNn4WaAvWW /MZFrVyNRdUlkDhozkPfpYjcSV9GiGm5+UdIcEPehPr8vo9M8bH3KBlfVsaeW6vx0FQ+ zcnA== 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 dc10si7438655ejb.81.2019.10.20.13.29.55; Sun, 20 Oct 2019 13:30:18 -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 S1726374AbfJTU3i (ORCPT + 99 others); Sun, 20 Oct 2019 16:29:38 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:46461 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfJTU3i (ORCPT ); Sun, 20 Oct 2019 16:29:38 -0400 X-IronPort-AV: E=Sophos;i="5.67,320,1566856800"; d="scan'208";a="407084399" Received: from ip-121.net-89-2-166.rev.numericable.fr (HELO hadrien) ([89.2.166.121]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 22:29:35 +0200 Date: Sun, 20 Oct 2019 22:29:35 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: Dan Carpenter , Jules Irenge , devel@driverdev.osuosl.org, outreachy-kernel@googlegroups.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [Outreachy kernel] Re: [PATCH v1 1/5] staging: wfx: fix warnings of no space is necessary In-Reply-To: <7ef650e0a6487a3eefc8df9eaf0ab20b5d26bad1.camel@perches.com> Message-ID: 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> <7ef650e0a6487a3eefc8df9eaf0ab20b5d26bad1.camel@perches.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 20 Oct 2019, Joe Perches wrote: > 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. No they are not. > Single file processing time on an XPS13 averages more than > 100 seconds per file. Not surprising. Actually, --include-headers-for-types should provide some benefit. That discards the header files after the type inference. > Also: > > expression e; > > could probably be better as: > > type T; > T *p; Good point. expression *e; would be sufficient. julia > > 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. > > >