From: Karsten Keil <kkeil@suse.de>
To: Domen Puncer <domen@coderock.org>
Cc: Ralph Corderoy <ralph@inputplus.co.uk>,
akpm@osdl.org, linux-kernel@vger.kernel.org,
isdn4linux@listserv.isdn4linux.de, jlamanna@gmail.com
Subject: Re: [patch 1/8] isdn_bsdcomp.c - vfree() checking cleanups
Date: Mon, 7 Mar 2005 11:26:09 +0100 [thread overview]
Message-ID: <20050307102609.GB11334@pingi3.kke.suse.de> (raw)
In-Reply-To: <20050307002133.GG32564@nd47.coderock.org>
On Mon, Mar 07, 2005 at 01:21:33AM +0100, Domen Puncer wrote:
> On 07/03/05 00:07 +0000, Ralph Corderoy wrote:
> >
> > Hi Domen,
> >
> > > - if (db->dict) {
> > > - vfree (db->dict);
> > > - db->dict = NULL;
> > > - }
> > > + vfree (db->dict);
> > > + db->dict = NULL;
> >
> > Is it really worth always calling vfree() which calls __vunmap() before
> > db->dict is determined to be NULL in order to turn three lines into two?
>
> Four lines into two :-)
>
> > Plus the write to db->dict which might otherwise not be needed. The old
> > code was clear, clean, and fast, no?
>
> Shorter and more readable code is always better, right? And speed really
> doesn't seem to be an issue here.
>
I also prefer the old code, since it make clear, that you must be careful
here, since the function can be called with already freed db->dict, and for
me this version is not better readable as the old one.
--
Karsten Keil
SuSE Labs
ISDN development
next prev parent reply other threads:[~2005-03-07 10:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-06 22:37 domen
2005-03-07 0:07 ` Ralph Corderoy
2005-03-07 0:21 ` Domen Puncer
2005-03-07 10:26 ` Karsten Keil [this message]
2005-03-07 11:06 ` Ralph Corderoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050307102609.GB11334@pingi3.kke.suse.de \
--to=kkeil@suse.de \
--cc=akpm@osdl.org \
--cc=domen@coderock.org \
--cc=isdn4linux@listserv.isdn4linux.de \
--cc=jlamanna@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralph@inputplus.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®