From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "jmoyer@redhat.com" <jmoyer@redhat.com>,
"Weiny, Ira" <ira.weiny@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl patch 3/4] query_fw_finish_status: get rid of redundant variable
Date: Mon, 21 Oct 2019 17:11:31 +0000 [thread overview]
Message-ID: <4d82d2c90961587f6b5d1868f900b421a8055ec4.camel@intel.com> (raw)
In-Reply-To: <20191018224918.GB12995@iweiny-DESK2.sc.intel.com>
On Fri, 2019-10-18 at 15:49 -0700, Ira Weiny wrote:
> On Fri, Oct 18, 2019 at 05:06:10PM -0400, Jeff Moyer wrote:
> > Ira Weiny <ira.weiny@intel.com> writes:
> >
> > > On Fri, Oct 18, 2019 at 04:23:01PM -0400, Jeff Moyer wrote:
> > > > The 'done' variable only adds confusion.
> > > >
> > > > goto out;
> > > > }
> > > > - } while (!done);
> > > > + } while (true);
> > >
> > > I'm not a fan of "while (true)". But I'm not the maintainer. The Logic seems
> > > fine otherwise.
> >
> > The way things stand today is a mashup of goto vs. break. I'll
> > follow-up with fixed up patch next week if there is consensus on the
> > change. If you have a suggestion for a better way, that's welcome as
> > well.
>
> Yea that is the reason I did not object strongly. I don't have a good idea of
> how to clean the loop up without a pretty big refactoring. Which I'm not
> prepared to do. :-/ So if Vishal is ok with it, I am.
I looked into this - and I agree that while (true) isn't the greatest.
I think we can refactor it to loop off the timeout value, and that keeps
the loop always bounded. For other cases we break out as usual.
For now, we can go with the simpler fixup, and revisit the bigger
refactoring later.
Thanks,
-Vishal
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
next prev parent reply other threads:[~2019-10-21 19:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 20:22 [ndctl patch 0/4] misc. cleanups Jeff Moyer
2019-10-18 20:22 ` [ndctl patch 1/4] util/abspath: cleanup prefix_filename Jeff Moyer
2019-10-18 20:55 ` Ira Weiny
2019-10-18 20:23 ` [ndctl patch 2/4] fix building of tags tables Jeff Moyer
2019-10-18 20:56 ` Ira Weiny
2019-10-18 20:23 ` [ndctl patch 3/4] query_fw_finish_status: get rid of redundant variable Jeff Moyer
2019-10-18 20:54 ` Ira Weiny
2019-10-18 21:06 ` Jeff Moyer
2019-10-18 22:49 ` Ira Weiny
2019-10-21 17:11 ` Verma, Vishal L [this message]
2019-10-23 22:28 ` Verma, Vishal L
2019-10-23 22:51 ` Verma, Vishal L
2019-10-25 22:21 ` Ira Weiny
2019-10-25 23:51 ` Verma, Vishal L
2019-10-28 19:37 ` Jeff Moyer
2019-10-28 21:13 ` Ira Weiny
2019-10-28 21:28 ` Jeff Moyer
2019-10-28 22:12 ` Jeff Moyer
2019-10-29 16:15 ` Ira Weiny
2019-10-18 20:23 ` [ndctl patch 4/4] load-keys: get rid of duplicate assignment Jeff Moyer
2019-10-18 20:57 ` Ira Weiny
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=4d82d2c90961587f6b5d1868f900b421a8055ec4.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=ira.weiny@intel.com \
--cc=jmoyer@redhat.com \
--cc=linux-nvdimm@lists.01.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).