All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: damien.lemoal@opensource.wdc.com
Cc: linux-kernel@vger.kernel.org,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Martin Liska <mliska@suse.cz>,
	linux-ide@vger.kernel.org
Subject: [PATCH 2/2] ata: ahci (gcc13): use U suffix for enum definitions
Date: Mon, 31 Oct 2022 12:43:10 +0100	[thread overview]
Message-ID: <20221031114310.10337-2-jirislaby@kernel.org> (raw)
In-Reply-To: <20221031114310.10337-1-jirislaby@kernel.org>

gcc13 now uses the type of the enum for all its members [1]. Given the
ata enum defines its members using both unsigned and signed ints, the
type of the enum is promoted to long.

Make sure the rest of the members are unsigned ints using U suffix.

The error in question is for example this:
  drivers/block/mtip32xx/mtip32xx.c:722:25: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long in'

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113

Cc: Martin Liska <mliska@suse.cz>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
 drivers/ata/ahci.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 94b5c81f08dd..14eb6e97f6f7 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -39,7 +39,7 @@
 enum {
 	AHCI_MAX_PORTS		= 32,
 	AHCI_MAX_SG		= 168, /* hardware max is 64K */
-	AHCI_DMA_BOUNDARY	= 0xffffffff,
+	AHCI_DMA_BOUNDARY	= ~0U,
 	AHCI_MAX_CMDS		= 32,
 	AHCI_CMD_SZ		= 32,
 	AHCI_CMD_SLOT_SZ	= AHCI_MAX_CMDS * AHCI_CMD_SZ,
@@ -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 |
@@ -191,14 +191,14 @@ enum {
 	PORT_FBS_DWE_OFFSET	= 16, /* FBS device with error offset */
 	PORT_FBS_ADO_OFFSET	= 12, /* FBS active dev optimization offset */
 	PORT_FBS_DEV_OFFSET	= 8,  /* FBS device to issue offset */
-	PORT_FBS_DEV_MASK	= (0xf << PORT_FBS_DEV_OFFSET),  /* FBS.DEV */
+	PORT_FBS_DEV_MASK	= (0xfU << PORT_FBS_DEV_OFFSET),  /* FBS.DEV */
 	PORT_FBS_SDE		= BIT(2), /* FBS single device error */
 	PORT_FBS_DEC		= BIT(1), /* FBS device error clear */
 	PORT_FBS_EN		= BIT(0), /* Enable FBS */
 
 	/* PORT_DEVSLP bits */
 	PORT_DEVSLP_DM_OFFSET	= 25,             /* DITO multiplier offset */
-	PORT_DEVSLP_DM_MASK	= (0xf << 25),    /* DITO multiplier mask */
+	PORT_DEVSLP_DM_MASK	= (0xfU << 25),    /* DITO multiplier mask */
 	PORT_DEVSLP_DITO_OFFSET	= 15,             /* DITO offset */
 	PORT_DEVSLP_MDAT_OFFSET	= 10,             /* Minimum assertion time */
 	PORT_DEVSLP_DETO_OFFSET	= 2,              /* DevSlp exit timeout */
-- 
2.38.1


  reply	other threads:[~2022-10-31 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 11:43 [PATCH 1/2] ata: ahci (gcc13): use BIT() for bit definitions in enum Jiri Slaby (SUSE)
2022-10-31 11:43 ` Jiri Slaby (SUSE) [this message]
2022-11-08  5:00   ` [PATCH 2/2] ata: ahci (gcc13): use U suffix for enum definitions Damien Le Moal
2022-11-08  5:01   ` Damien Le Moal
2022-11-08  4:58 ` [PATCH 1/2] ata: ahci (gcc13): use BIT() for bit definitions in enum Damien Le Moal

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=20221031114310.10337-2-jirislaby@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mliska@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.