lkml.org 
[lkml]   [2013]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/module.c: for looping, need use 'goto' instead of 'break' to jump out in time
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)

Thanks.

--
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-05-08 06:01    [W:0.629 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site