public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	NeilBrown <neilb@suse.com>, Jiri Kosina <trivial@kernel.org>
Subject: Re: [PATCH trivial] kernel.h: Make container_of_safe type safe
Date: Mon, 28 Jan 2019 05:42:42 -0800	[thread overview]
Message-ID: <20190128134242.GA10951@infradead.org> (raw)
In-Reply-To: <20190124205451.GA19634@ziepe.ca>

On Thu, Jan 24, 2019 at 08:55:05PM +0000, Jason Gunthorpe wrote:
> The final ternary expression is given void * and type * as arguments, so
> the resulting type of the macro ends up being void *.
> 
> container_of returns a type which maches the argument, this provides type
> safety and allows the expression to be immediately used as the target
> type.
> 
> Explicitly cast ERR_CAST() to get the correct type.

I think we should just kill off container_of_safe - it has no user
in the tree, is grossly misnamed and not really all that useful to start
with.

  reply	other threads:[~2019-01-28 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 20:55 [PATCH trivial] kernel.h: Make container_of_safe type safe Jason Gunthorpe
2019-01-28 13:42 ` Christoph Hellwig [this message]
2019-01-28 18:44   ` Jason Gunthorpe
2019-01-29  7:40     ` Christoph Hellwig

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=20190128134242.GA10951@infradead.org \
    --to=hch@infradead.org \
    --cc=jgg@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=trivial@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