Re: [PATCH] ata: ahci: fix enum constants for gcc-13
From: Arnd Bergmann
Date: Thu Dec 01 2022 - 16:28:38 EST
On Thu, Dec 1, 2022, at 21:48, Randy Dunlap wrote:
> On 12/1/22 12:43, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@xxxxxxxx>
>>
>> gcc-13 slightly changes the type of constant expressions that are deifined
>
> defined
fixed
>> ---
>> drivers/ata/ahci.h | 234 ++++++++++++++++++++++-----------------------
>> 1 file changed, 117 insertions(+), 117 deletions(-)
>
> What #include <linux/bits.h> ?
> or is it just done indirectly?
Good point. It survived a build test, and it's one of the headers that
is almost always included from somewhere, but you are correct that
there should be an explicit include here as well.
I also found that PORT_CMD_ICC_MASK is still a negative number
that needs to be changed:
@@ -178,10 +178,10 @@ enum {
PORT_CMD_SPIN_UP = BIT(1), /* Spin up device */
PORT_CMD_START = BIT(0), /* Enable port DMA engine */
- PORT_CMD_ICC_MASK = (0xf << 28), /* i/f ICC state mask */
- PORT_CMD_ICC_ACTIVE = (0x1 << 28), /* Put i/f in active state */
- PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */
- PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */
+ PORT_CMD_ICC_MASK = (0xfu << 28), /* i/f ICC state mask */
+ PORT_CMD_ICC_ACTIVE = (0x1u << 28), /* Put i/f in active state */
+ PORT_CMD_ICC_PARTIAL = (0x2u << 28), /* Put i/f in partial state */
+ PORT_CMD_ICC_SLUMBER = (0x6u << 28), /* Put i/f in slumber state */
/* PORT_CMD capabilities mask */
PORT_CMD_CAP = PORT_CMD_HPCP | PORT_CMD_MPSP |
I've addressed all three issues now, will send a v2 after Luis is
able to validate that this fixes the problem.
Arnd