From: Karel Zak <kzak@redhat.com>
To: Boris Egorov <egorov@linux.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] libfdisk: fix get_partition_unused_primary()
Date: Fri, 14 Nov 2014 10:11:48 +0100 [thread overview]
Message-ID: <20141114091148.GE6704@x2.net.home> (raw)
In-Reply-To: <1415942836-1248-1-git-send-email-egorov@linux.com>
On Fri, Nov 14, 2014 at 11:27:16AM +0600, Boris Egorov wrote:
> Now function takes address to variable and fills it with partition
> number. Caller treats return value as int and use it appropriately.
Yep, it's better.
> static int get_partition_unused_primary(struct fdisk_context *cxt,
...
> + *partno = rc == 0 ? n : rc;
^^^^^^^^^^^
I have replaced this line with
if (rc == 0)
*partno = n;
it seems we don't have to mix partno and return codes here at all.
> + return 0;
return rc;
Applied, thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2014-11-14 9:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 5:27 [PATCH] libfdisk: fix get_partition_unused_primary() Boris Egorov
2014-11-14 9:11 ` Karel Zak [this message]
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=20141114091148.GE6704@x2.net.home \
--to=kzak@redhat.com \
--cc=egorov@linux.com \
--cc=util-linux@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;
as well as URLs for NNTP newsgroup(s).