public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Chen Gang <gang.chen@asianux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel/module.c: for looping, need use 'goto' instead of 'break' to jump out in time
Date: Mon, 13 May 2013 10:47:19 +0930	[thread overview]
Message-ID: <87li7j3cgw.fsf@rustcorp.com.au> (raw)
In-Reply-To: <5189C1D6.1040209@asianux.com>

Chen Gang <gang.chen@asianux.com> writes:
> On 2013年05月08日 08:29, Rusty Russell wrote:
>> Chen Gang <gang.chen@asianux.com> writes:
>>> > In the 'for' looping, when error occurs, the 'break' only jump out of
>>> > 'switch', and still in 'for' looping.  If error occurs multiple times,
>>> > the original error value will be overwrite.
>>> >
>>> > Currently, that will not cause issue, but still better to improve it,
>>> > so that let it return the first real error code in time.
>> We choose to print all the problems, rather than just one.  I don't
>> really mind though.
>> 
>
> It sounds good: "choose to print all the problems, rather than just one"
>
> If so, it seems enough to only return a bool value to known whether
> success or fail, do not need the error details any more (since they are
> already been printed)
>
>> It we want this patch, it would be neater to just 'return -ENOEXEC'
>> and 'return PTR_ERR(ksym) ?: -ENOENT'.
>
> If we really want this patch (still only print the first error, and
> return the real error value), I should send patch v2 (also 'ret' is
> obsoleted)

I would take such a patch, since it makes things a little neater.  But
if you don't write it, I wouldn't write it myself, since it's
borderline.

Thanks,
Rusty.

  reply	other threads:[~2013-05-13  2:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  6:27 [PATCH] kernel/module.c: for looping, need use 'goto' instead of 'break' to jump out in time Chen Gang
2013-05-08  0:29 ` Rusty Russell
2013-05-08  3:09   ` Chen Gang
2013-05-13  1:17     ` Rusty Russell [this message]
2013-05-13  3:33       ` Chen Gang
2013-05-13 12:24         ` [PATCH v2] kernel/module.c: cleanup patch for looping, let return 'bool' value instead of real error number Chen Gang
2013-05-14  2:16           ` Chen Gang
2013-05-17  4:33             ` [PATCH v3] kernel/module.c: need return the first error code to upper caller when error occurs Chen Gang
2013-05-22 11:26               ` Chen Gang
2013-05-23  3:54                 ` Rusty Russell
2013-05-23  5:13                   ` Chen Gang

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=87li7j3cgw.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=gang.chen@asianux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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