public inbox for ksummit@lists.linux.dev
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: ksummit@lists.linux.dev
Subject: Re: [MAINTAINER SUMMIT] Enforcing API deprecation
Date: Fri, 29 Aug 2025 11:00:43 +0200	[thread overview]
Message-ID: <1fa9e347-99c8-4548-816e-ccef0e51999c@kernel.org> (raw)
In-Reply-To: <CACMJSet5r0PDFsYRcNWKQH_jfimqpQWZ2nL2YKoc-+QisNNykA@mail.gmail.com>

On 27/08/2025 16:47, Bartosz Golaszewski wrote:
> On Tue, 26 Aug 2025 at 22:12, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> On Tue, 26 Aug 2025 at 12:58, Bartosz Golaszewski
>> <bartosz.golaszewski@linaro.org> wrote:
>>>
> 
> [snip]
> 
>>> 4. Make build bots detect it.
>>
>> Fine, but doesn't solve anything.
>>
> 
> How so? The developer gets an email telling them they used a legacy
> API, the maintainer sees a build bot report and knows to ignore the
> patch. That's already better than what we (don't) have currently.

I think build-time warnings or emails from LKP about using deprecated
API do solve the problem, in the very long term. Why? We do remove old
platforms, so even if we do not convert in-tree users from deprecated
API, these warnings would reduce amount of new code coming to the
kernel. Eventually at some point we just drop old architectures, old
platforms or drivers and that might be the last user of the deprecated API.


> 
>>> I would like to propose a discussion on how to enforce API deprecation
>>> in a way that supports efforts to reduce technical debt, without being
>>> hampered by developers and maintainers who mean no harm but simply
>>> don’t know any better.
>>
>> Here's the only thing that works: if you change the API, you have to
>> fix up all existing users.
>>
>> If you are not willing to fix up all existing users, and you introduce
>> a parallel API, then you are the one that maintains both the old and
>> the new API forever.

Sure, I don't think anyone questions that part. So imagine we maintain
both APIs, but we do not want the old one to grow?

>>
>> Or at least until somebody else did the work that you weren't willing to do.
>>
> 
> That sounds great in theory but in practice, one may be willing to do
> the work and it will still take years (as is the case with GPIO) where
> there were thousands of calls to the legacy API and - due to the
> nature of the differences between the old and new one - the
> conversions are far from trivial.
> 
> I'm not advocating a policy change, I'm trying to bring up the subject
> of making the effort easier for those who participate in the tree-wide
> refactoring.

How about sparse attributes for the old API as deprecated and in the
same time all existing users as "ignore-that-sparse-warning"? We already
have a few drivers doing:
	#ifdef __CHECKER__
to avoid many false positives (e.g. handling inlines). Also few for
skipping locking (drivers/scsi/qla2xxx/qla_nx.c), but this feels rather
like anti-pattern.

We also have cases of:
	#ifdef CONFIG_CC_IS_GCC
	#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
	#endif


Best regards,
Krzysztof

  parent reply	other threads:[~2025-08-29  9:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 19:57 [MAINTAINER SUMMIT] Enforcing API deprecation Bartosz Golaszewski
2025-08-26 20:12 ` Linus Torvalds
2025-08-26 20:28   ` Jiri Kosina
2025-08-26 22:44     ` Linus Torvalds
2025-08-26 23:25       ` Al Viro
2025-08-27 15:07       ` Bartosz Golaszewski
2025-08-27 16:42         ` Rob Herring
2025-08-27 16:57           ` Linus Torvalds
2025-08-28 15:11             ` Bartosz Golaszewski
2025-09-03 13:19               ` Eric W. Biederman
2025-08-27 14:47   ` Bartosz Golaszewski
2025-08-27 14:58     ` Julia Lawall
2025-08-27 15:31       ` Bartosz Golaszewski
2025-08-29  9:00     ` Krzysztof Kozlowski [this message]
2025-08-26 20:24 ` Johannes Berg
2025-08-26 21:02   ` Laurent Pinchart

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=1fa9e347-99c8-4548-816e-ccef0e51999c@kernel.org \
    --to=krzk@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=ksummit@lists.linux.dev \
    --cc=torvalds@linux-foundation.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