From: Pete Zaitcev <zaitcev@redhat.com>
To: hch@ns.caldera.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kill unneeded code from mm/memory.c
Date: Wed, 1 Aug 2001 21:54:20 -0400 [thread overview]
Message-ID: <200108020154.f721sKR04927@devserv.devel.redhat.com> (raw)
In-Reply-To: <mailman.996710160.18802.linux-kernel2news@redhat.com>
In-Reply-To: <mailman.996710160.18802.linux-kernel2news@redhat.com>
> diff -uNr ../master/linux-2.4.7-ac3/mm/memory.c linux/mm/memory.c
> --- ../master/linux-2.4.7-ac3/mm/memory.c Thu Aug 2 01:48:23 2001
> +++ linux/mm/memory.c Thu Aug 2 01:50:12 2001
> @@ -1041,17 +1041,10 @@
> }
> }
> inode->i_size = offset;
> - if (inode->i_op && inode->i_op->truncate)
> - {
> - /* This doesnt scale but it is meant to be a 2.4 invariant */
> - lock_kernel();
> - inode->i_op->truncate(inode);
> - unlock_kernel();
> - }
> - return 0;
> -
> +
> out_truncate:
> if (inode->i_op && inode->i_op->truncate) {
> + /* This doesnt scale but it is meant to be a 2.4 invariant */
> lock_kernel();
> inode->i_op->truncate(inode);
> unlock_kernel();
I disagree. It is the style to have a function trip exceptions
by doing goto out_something. Those exceptions are stacked
in the fall through fashion, but the success case IS NOT.
By implemention this factorization you save several bytes
and make just everyone to wonder if there is a bug or mispatch
with missing "return 0" case here.
-- Pete
next parent reply other threads:[~2001-08-02 1:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.996710160.18802.linux-kernel2news@redhat.com>
2001-08-02 1:54 ` Pete Zaitcev [this message]
2001-08-02 8:40 ` [PATCH] kill unneeded code from mm/memory.c Christoph Hellwig
2001-08-01 23:53 Christoph Hellwig
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=200108020154.f721sKR04927@devserv.devel.redhat.com \
--to=zaitcev@redhat.com \
--cc=hch@ns.caldera.de \
--cc=linux-kernel@vger.kernel.org \
/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