All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Chen Gang <gang.chen@asianux.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	zhangyanfei@cn.fujitsu.com, Jiri Kosina <jkosina@suse.cz>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] PowerPC: kernel: need return the related error code when failure occurs.
Date: Tue, 21 May 2013 18:10:31 +1000	[thread overview]
Message-ID: <20130521081031.GA29303@iris.ozlabs.ibm.com> (raw)
In-Reply-To: <519B0ACA.6090008@asianux.com>

On Tue, May 21, 2013 at 01:48:58PM +0800, Chen Gang wrote:
> 
> When error occurs, need return the related error code to let upper
> caller know about it.
> 
> ppc_md.nvram_size() can return the error code (e.g. core99_nvram_size()
> in 'arch/powerpc/platforms/powermac/nvram.c').
> 
> And when '*ppos >= size', need return -ESPIPE (Illegal seek)

Why?  When *ppos >= size, it should return 0 (end of file) in my opinion.
ESPIPE means that any seek would be ineffective, not that a particular
seek went out of bounds.

Paul.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@samba.org>
To: Chen Gang <gang.chen@asianux.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	zhangyanfei@cn.fujitsu.com, Jiri Kosina <jkosina@suse.cz>,
	Michael Ellerman <michael@ellerman.id.au>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PowerPC: kernel: need return the related error code when failure occurs.
Date: Tue, 21 May 2013 18:10:31 +1000	[thread overview]
Message-ID: <20130521081031.GA29303@iris.ozlabs.ibm.com> (raw)
In-Reply-To: <519B0ACA.6090008@asianux.com>

On Tue, May 21, 2013 at 01:48:58PM +0800, Chen Gang wrote:
> 
> When error occurs, need return the related error code to let upper
> caller know about it.
> 
> ppc_md.nvram_size() can return the error code (e.g. core99_nvram_size()
> in 'arch/powerpc/platforms/powermac/nvram.c').
> 
> And when '*ppos >= size', need return -ESPIPE (Illegal seek)

Why?  When *ppos >= size, it should return 0 (end of file) in my opinion.
ESPIPE means that any seek would be ineffective, not that a particular
seek went out of bounds.

Paul.

  reply	other threads:[~2013-05-21  8:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  5:48 [PATCH] PowerPC: kernel: need return the related error code when failure occurs Chen Gang
2013-05-21  8:10 ` Paul Mackerras [this message]
2013-05-21  8:10   ` Paul Mackerras
2013-05-21  9:03   ` Chen Gang
2013-05-21  9:03     ` Chen Gang
2013-05-21  9:20     ` [PATCH v2] " Chen Gang
2013-05-21  9:20       ` Chen Gang
2013-05-27 10:01       ` Chen Gang
2013-05-27 10:01         ` 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=20130521081031.GA29303@iris.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=arnd@arndb.de \
    --cc=gang.chen@asianux.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=zhangyanfei@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.