NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: misc/49272: Patching with Coccinelle?: Deletion of unnecessary checks before specific function calls
The following reply was made to PR misc/49272; it has been noted by GNATS.
From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: misc/49272: Patching with Coccinelle?: Deletion of unnecessary
checks before specific function calls
Date: Tue, 14 Oct 2014 11:10:32 -0700
On Mon, 13 Oct 2014, Markus Elfring wrote:
>> What are you proposing to change? I see no actual proposal here,
>> just a very broad suggestion.
>
>I try to clarify your general change acceptance for the involved implementation
>details. More concrete update suggestions can be seen from my similar proposal
>for Linux.
>https://lkml.org/lkml/2014/3/5/356
>https://systeme.lip6.fr/pipermail/cocci/2014-March/000676.html
>http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/
OK, so you want to change
if (x)
free(x);
to just
free(x);
and similarly for some functions other than free(), based on the
idea that free() itself checks the pointer. It would have been
nice if you had actually said that, instead of making us read
several web pages.
I don't think we should make such changes in NetBSD. Performing
the test in the caller saves the function call overhead, and has
no down side at all that I can see.
--apb (Alan Barrett)
Home |
Main Index |
Thread Index |
Old Index