public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: Abhijit Pawar <abhi.c.pawar@gmail.com>, Ben Myers <bpm@sgi.com>,
	Alex Elder <elder@kernel.org>,
	linux-kernel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH 1/1] fs/xfs remove obsolete simple_strto<foo>
Date: Sat, 12 Jan 2013 09:52:47 +1100	[thread overview]
Message-ID: <20130111225246.GO3120@dastard> (raw)
In-Reply-To: <50EFB2FE.2000307@oracle.com>

On Fri, Jan 11, 2013 at 02:36:46PM +0800, Jeff Liu wrote:
> On 01/09/2013 10:04 PM, Abhijit Pawar wrote:
> > This patch replaces usages of obsolete simple_strtoul with kstrtoint in xfs_args and suffix_strtoul.
> > 
> > Signed-off-by: Abhijit Pawar <abhi.c.pawar@gmail.com>
> > ---
> > +			if (kstrtoint(value, 10, &dswidth))
> > +				return EINVAL;
> >  		} else if (!strcmp(this_char, MNTOPT_32BITINODE)) {
> >  			mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
> >  		} else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
> > 
> checkpatch.pl show warning if we return EINVAL as below:
> WARNING: return of an errno should typically be -ve (return -EINVAL)
> 
> Can we just ignore such code style issue?

Returning a positive error is not a code style issue. It's a
correctness issue. the core of the XFS code returns positive error
numbers as that's the way it was done on Irix (where the XFs code
comes from). The rest of the Linux code tends to use negative values
for error returns, and we've never converted the XFS code base to
negative errors.

You should always feel free to ignore checkpatch warnings that make
no sense. I haven't used checkpatch now for several years - I
stopped using it when it got too noisy warning about uselesss,
trivial things in the XFS code base....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2013-01-11 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 14:04 [PATCH 1/1] fs/xfs remove obsolete simple_strto<foo> Abhijit Pawar
2013-01-11  6:36 ` Jeff Liu
2013-01-11  7:46   ` Abhijit Pawar
2013-01-11 19:09     ` Ben Myers
2013-01-11 22:52   ` Dave Chinner [this message]
2013-01-12  2:48     ` Jeff Liu
2013-01-12  2:54 ` Jeff Liu

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=20130111225246.GO3120@dastard \
    --to=david@fromorbit.com \
    --cc=abhi.c.pawar@gmail.com \
    --cc=bpm@sgi.com \
    --cc=elder@kernel.org \
    --cc=jeff.liu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox