From: Dan Carpenter <dan.carpenter@oracle.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Greg KH <greg@kroah.com>,
devel@driverdev.osuosl.org, linux-iio@vger.kernel.org,
Greg Kroah-Hartman <gregkh@suse.de>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH] staging:iio: Add wrapper functions around buffer access ops
Date: Wed, 14 Dec 2011 19:42:20 +0300 [thread overview]
Message-ID: <20111214164220.GM3503@mwanda> (raw)
In-Reply-To: <4EE8BB28.3060807@metafoo.de>
[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]
On Wed, Dec 14, 2011 at 04:05:12PM +0100, Lars-Peter Clausen wrote:
> On 12/14/2011 03:31 PM, Dan Carpenter wrote:
> > On Wed, Dec 14, 2011 at 11:15:49AM +0100, Lars-Peter Clausen wrote:
> >> Marking the function as __must_check doesn't make much sense here. Since it
> >> will either return an error or the buffer length. So you'll always use the
> >> returned result one way or the other.
> >
> > Isn't that the point of a __must_check?
>
> My understanding is that you should use __must_check if it is potentially
> dangerous to ignore the return value. Which is not the case here, if you
> don't look at the return value it's kind of pointless to call the function
> in the first, but it is not dangerous.
>
I only responded to the previous email because you described exactly
the situation that __must_check is designed for, as a reason to not
use it. It struck me as humourous.
ERR_PTR() is likewise not dangerous. It's just a cast, but it
doesn't make sense to not check it, so that's why it has a
__must_check tag. If a function is part of the infrastructure and
gets called a lot then a __must_check is appropriate.
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-12-14 16:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 10:08 [PATCH] staging:iio: Add wrapper functions around buffer access ops Lars-Peter Clausen
2011-12-13 0:45 ` Greg KH
2011-12-13 9:01 ` Lars-Peter Clausen
2011-12-13 23:59 ` Greg KH
2011-12-14 7:19 ` Jonathan Cameron
2011-12-14 10:15 ` Lars-Peter Clausen
2011-12-14 14:31 ` Dan Carpenter
2011-12-14 15:05 ` Lars-Peter Clausen
2011-12-14 16:42 ` Dan Carpenter [this message]
2011-12-14 15:49 ` Greg KH
2011-12-14 17:35 ` Lars-Peter Clausen
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=20111214164220.GM3503@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).