diff mbox series

[RFC] ahci: imx: fix the build warning

Message ID 1521522094-31217-1-git-send-email-hongxing.zhu@nxp.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [RFC] ahci: imx: fix the build warning | expand

Commit Message

Hongxing Zhu March 20, 2018, 5:01 a.m. UTC
Fix the following build warning introduced by commit.
e5878732a521 ("ahci: imx: add the imx6qp ahci sata support")

drivers/ata/ahci_imx.c: In function 'imx_sata_disable':
drivers/ata/ahci_imx.c:478:2: warning: enumeration value 'AHCI_IMX53'
not handled in switch [-Wswitch]
  switch (imxpriv->type) {
	    ^~~~~~

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 drivers/ata/ahci_imx.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tejun Heo March 20, 2018, 8:12 p.m. UTC | #1
On Tue, Mar 20, 2018 at 01:01:34PM +0800, Richard Zhu wrote:
> Fix the following build warning introduced by commit.
> e5878732a521 ("ahci: imx: add the imx6qp ahci sata support")
> 
> drivers/ata/ahci_imx.c: In function 'imx_sata_disable':
> drivers/ata/ahci_imx.c:478:2: warning: enumeration value 'AHCI_IMX53'
> not handled in switch [-Wswitch]
>   switch (imxpriv->type) {
> 	    ^~~~~~
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  drivers/ata/ahci_imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
> index 577458f..f898a0f 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -476,6 +476,9 @@ static void imx_sata_disable(struct ahci_host_priv *hpriv)
>  		return;
>  
>  	switch (imxpriv->type) {
> +	case AHCI_IMX53:
> +		break;
> +

Can we just add default: as the last entry or just switch it to if/else?

Thanks.
Hongxing Zhu March 21, 2018, 2:15 a.m. UTC | #2
-----Original Message-----
From: Tejun Heo [mailto:htejun@gmail.com] On Behalf Of Tejun Heo
Sent: Wednesday, March 21, 2018 4:12 AM
To: Richard Zhu <hongxing.zhu@nxp.com>
Cc: hdegoede@redhat.com; linux-ide@vger.kernel.org
Subject: Re: [RFC] ahci: imx: fix the build warning

On Tue, Mar 20, 2018 at 01:01:34PM +0800, Richard Zhu wrote:
> Fix the following build warning introduced by commit.
> e5878732a521 ("ahci: imx: add the imx6qp ahci sata support")
> 
> drivers/ata/ahci_imx.c: In function 'imx_sata_disable':
> drivers/ata/ahci_imx.c:478:2: warning: enumeration value 'AHCI_IMX53'
> not handled in switch [-Wswitch]
>   switch (imxpriv->type) {
> 	    ^~~~~~
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  drivers/ata/ahci_imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index 
> 577458f..f898a0f 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -476,6 +476,9 @@ static void imx_sata_disable(struct ahci_host_priv *hpriv)
>  		return;
>  
>  	switch (imxpriv->type) {
> +	case AHCI_IMX53:
> +		break;
> +

Can we just add default: as the last entry or just switch it to if/else?
[Richard] Thanks for your comment. Okay, the default as the last entry in next version.
Thanks.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 577458f..f898a0f 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -476,6 +476,9 @@  static void imx_sata_disable(struct ahci_host_priv *hpriv)
 		return;
 
 	switch (imxpriv->type) {
+	case AHCI_IMX53:
+		break;
+
 	case AHCI_IMX6QP:
 		regmap_update_bits(imxpriv->gpr, IOMUXC_GPR5,
 				   IMX6Q_GPR5_SATA_SW_PD,