public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Matthew Wilcox <willy@infradead.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH 1/1] container_of: Document container_of_const() is preferred
Date: Fri, 9 Aug 2024 15:59:13 +0300	[thread overview]
Message-ID: <ZrYSoQxHxyA5vsGT@smile.fi.intel.com> (raw)
In-Reply-To: <20240617100825.2510728-1-sakari.ailus@linux.intel.com>

On Mon, Jun 17, 2024 at 01:08:25PM +0300, Sakari Ailus wrote:
> There is a warning in kerneldoc documentation of container_of() that
> constness of @ptr is lost. While this is a suggestion container_of_const()
> should be used instead, the vast majority of new code still uses
> container_of():

A side note...

> $ git diff v6.8 v6.9|grep container_of\(|wc -l
> 788
> $ git diff v6.8 v6.9|grep container_of_const|wc -l
> 11

This is classic "Useless use of grep".

$ git log --oneline -G 'container_of\(' v6.8..v6.9 | wc -l
296

However, if you really want the _new_ code only, you have to run to `git grep`:

$ git grep -n -w container_of v6.8 | wc
20763

$ git grep -n -w container_of v6.9 | wc
20943

180 new uses.

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2024-08-09 12:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 10:08 [PATCH 1/1] container_of: Document container_of_const() is preferred Sakari Ailus
2024-06-17 10:44 ` Greg Kroah-Hartman
2024-06-18  9:09   ` Sakari Ailus
2024-06-18 10:01     ` Greg Kroah-Hartman
2024-06-18 11:52       ` Sakari Ailus
2024-06-18 12:54         ` Greg Kroah-Hartman
2024-06-18 13:56           ` Matthew Wilcox
2024-06-18 14:02             ` Greg Kroah-Hartman
2024-08-09 12:59 ` Andy Shevchenko [this message]

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=ZrYSoQxHxyA5vsGT@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jgg@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=willy@infradead.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