* [Qemu-devel] [PATCH trivial] qemu-img: Remove redundancy "ret = -1" @ 2014-07-03 15:57 Chen Gang 2014-07-09 13:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev 0 siblings, 1 reply; 3+ messages in thread From: Chen Gang @ 2014-07-03 15:57 UTC (permalink / raw) To: Michael Tokarev; +Cc: Kevin Wolf, qemu-trivial, qemu-devel, stefanha In this case, 'ret' is already '-1', so need not do it again. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> --- qemu-img.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index c98896b..d4518e7 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -246,7 +246,6 @@ static int read_password(char *buf, int buf_size) if (errno == EAGAIN || errno == EINTR) { continue; } else { - ret = -1; break; } } else if (ret == 0) { -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH trivial] qemu-img: Remove redundancy "ret = -1" 2014-07-03 15:57 [Qemu-devel] [PATCH trivial] qemu-img: Remove redundancy "ret = -1" Chen Gang @ 2014-07-09 13:58 ` Michael Tokarev 2014-07-10 2:33 ` Chen Gang 0 siblings, 1 reply; 3+ messages in thread From: Michael Tokarev @ 2014-07-09 13:58 UTC (permalink / raw) To: Chen Gang; +Cc: Kevin Wolf, qemu-trivial, qemu-devel, stefanha 03.07.2014 17:57, Chen Gang wrote: > In this case, 'ret' is already '-1', so need not do it again. It's a very minor thing in an error path, maybe compiler even eliminates this statement entirely by its own already. Not sure it is worth the effort but applied to the -trivial tree anyway, thanks! /mjt ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH trivial] qemu-img: Remove redundancy "ret = -1" 2014-07-09 13:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev @ 2014-07-10 2:33 ` Chen Gang 0 siblings, 0 replies; 3+ messages in thread From: Chen Gang @ 2014-07-10 2:33 UTC (permalink / raw) To: Michael Tokarev; +Cc: Kevin Wolf, qemu-trivial, qemu-devel, stefanha On 07/09/2014 09:58 PM, Michael Tokarev wrote: > 03.07.2014 17:57, Chen Gang wrote: >> In this case, 'ret' is already '-1', so need not do it again. > > It's a very minor thing in an error path, maybe compiler even > eliminates this statement entirely by its own already. > Yeah, normal compiler with -O2, should eliminate it (maybe -O1 also OK). > Not sure it is worth the effort but applied to the -trivial tree > anyway, thanks! For me, '-trivial' means none-urgent, but not mean minor (in fact some of urgent things are minor), Coding-styles and trying to keep source code simple are none-urgent, but not minor. Normal things: - None-urgent and none-important things, we need not do -- it is just wasting members' time resources. - Urgent and none-important things, need process it in time. - None-urgent and important things, need process it when have time. Special things: - For urgent and important things which can be separated: - need process for its' urgent part in time. - and then process for its important part when have time. - For urgent and important things which can not be separated: - air, water and life are in this case. - open, share, and attitude like air, water, and life. - God have already blessed, but we need let them better and better. Welcome any suggestions, discussions and completions. Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-10 2:34 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-07-03 15:57 [Qemu-devel] [PATCH trivial] qemu-img: Remove redundancy "ret = -1" Chen Gang 2014-07-09 13:58 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev 2014-07-10 2:33 ` Chen Gang
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).