[PATCH 00/17] xfs: unsigned flags conversion for c11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks,

With the addition of C11 compiler specs to 5.18-rc1, some compilers
are generating warnings about our use of signed flag values being
placed into unsigned fields.

The initial warning is caused by the trace event infrastructure
using __print_flags(). The array structure used internally that we
use macros to initialise defines the flags field as an unsigned
long. This causes signed int flags that set the high bit to be sign
extended and not be correct. gcc-5 then fails to detect this value
as a constant and it throws errors.

The fix for this is to just define the flag values as unsigned ints.
While we only need to convert the buffer flags to avoid the build
error for merge into 5.18-rcX, this series converts all the flags
fields that are used to initialise trace event __print_flags()
arrays. Most of these flags are stored in unsigned int variables, we
really should be declaring them as unsigned values anyway.

Hence this patch set cleans up all these flag values to use unsigned
values, use unsigned storage variables, and convert all the places
that pass them around to use unsigned varaibles. I've converted
all the value definitions to use consistent (1u << x) definitions so
it is clear they are intended to be one bit per value flags.

There are other flags values and fields in XFS that I have not
converted - these can be cleaned up over time as they currently do
not have non-obvious build-breaking potential.

This is based on 5.18-rc2.

Cheers,

Dave.





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux