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 v3] kernel/module.c: need return the first error code to upper caller when error occurs
Date: Thu, 23 May 2013 13:24:08 +0930	[thread overview]
Message-ID: <87fvxes65b.fsf@rustcorp.com.au> (raw)
In-Reply-To: <519CAB4F.1000501@asianux.com>

Chen Gang <gang.chen@asianux.com> writes:
> Hello Maintainers:
>
> Please help check the patch whether OK or not, when you have time.

Hi Chen,

        There's nothing *wrong* with the patch, but I don't think it's
worthwhile.  If this were your very first kernel patch, I'd probably
apply it just to encourage you, but you're not a newbie any more!

Cheers,
Rusty.

> On 05/17/2013 12:33 PM, Chen Gang wrote:
>> 
>> When multiple errors occur, simplify_symbols() will return the last
>> error code to the upper caller.
>> 
>> In this case, better to return the first error code to the upper caller.
>> 
>> Just like "using compiler": it will print all errors and warnings as
>> much as it can, but the user usually mainly focus on the first error or
>> warning. Since 'user' only can get one error return code, 'he/she'
>> usually assume the error code will match the first error print line.
>> 
>> 
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>>  kernel/module.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>> 
>> diff --git a/kernel/module.c b/kernel/module.c
>> index e4ee1bf..9e6c96d 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1976,7 +1976,8 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
>>  			pr_debug("Common symbol: %s\n", name);
>>  			printk("%s: please compile with -fno-common\n",
>>  			       mod->name);
>> -			ret = -ENOEXEC;
>> +			if (!ret)
>> +				ret = -ENOEXEC;
>>  			break;
>>  
>>  		case SHN_ABS:
>> @@ -1999,7 +2000,8 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
>>  
>>  			printk(KERN_WARNING "%s: Unknown symbol %s (err %li)\n",
>>  			       mod->name, name, PTR_ERR(ksym));
>> -			ret = PTR_ERR(ksym) ?: -ENOENT;
>> +			if (!ret)
>> +				ret = PTR_ERR(ksym) ?: -ENOENT;
>>  			break;
>>  
>>  		default:
>> 
>
>
> -- 
> Chen Gang
>
> Asianux Corporation

  reply	other threads:[~2013-05-23  4:56 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
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 [this message]
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=87fvxes65b.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