Re: [PATCH v2] tracing: Make is_signed_type() compatible with sparse

From: Bart Van Assche

Date: Tue Sep 01 2026 - 17:43:36 EST


On 9/1/26 2:29 PM, David Laight wrote:
On Tue, 1 Sep 2026 11:05:18 -0700
Bart Van Assche <bvanassche@xxxxxxx> wrote:

On 9/1/26 1:20 AM, David Laight wrote:
I suspect you need to change the TRACE_EVENT() calls to remove the
__bitwise marker.

How to remove the __bitwise marker? Removing the __bitwise marker is not
supported by sparse, isn't it?

Wont (__force u32)u32_bitwise_var remove it - you just have to know the
type.

Yes, removing __bitwise is possible if the underlying type is known. In
the context of the is_signed_type() macro, the underlying type is not
passed as an argument to that macro.

The implementation in sparse of __type_unqual__ does not remove
__attribute__((bitwise)) as far as I know. __typeof_unqual__ only strips
C type qualifiers: const, volatile, restrict, and _Atomic.

The only generic way I know of to remove the __bitwise marker is by
using _Generic(). But that approach has been rejected by Linus.

Bart.