diff mbox series

ata: pata_atiixp: make static read-only arrays const

Message ID 20220123221622.5543-1-colin.i.king@gmail.com
State New
Headers show
Series ata: pata_atiixp: make static read-only arrays const | expand

Commit Message

Colin Ian King Jan. 23, 2022, 10:16 p.m. UTC
The static arrays pio_timings and mwdma_timings are read-only so
it make sense to make them const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/ata/pata_atiixp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sergei Shtylyov Jan. 24, 2022, 5:18 p.m. UTC | #1
On 1/24/22 1:16 AM, Colin Ian King wrote:

> The static arrays pio_timings and mwdma_timings are read-only so
> it make sense to make them const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey
Damien Le Moal Jan. 27, 2022, 11:35 p.m. UTC | #2
On 1/24/22 07:16, Colin Ian King wrote:
> The static arrays pio_timings and mwdma_timings are read-only so
> it make sense to make them const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied to for-5.18. Thanks !
diff mbox series

Patch

diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index c3a65ccd4b79..efdb94cff68b 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -102,7 +102,7 @@  static int atiixp_prereset(struct ata_link *link, unsigned long deadline)
 
 static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev, int pio)
 {
-	static u8 pio_timings[5] = { 0x5D, 0x47, 0x34, 0x22, 0x20 };
+	static const u8 pio_timings[5] = { 0x5D, 0x47, 0x34, 0x22, 0x20 };
 
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	int dn = 2 * ap->port_no + adev->devno;
@@ -149,7 +149,7 @@  static void atiixp_set_piomode(struct ata_port *ap, struct ata_device *adev)
 
 static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 {
-	static u8 mwdma_timings[5] = { 0x77, 0x21, 0x20 };
+	static const u8 mwdma_timings[5] = { 0x77, 0x21, 0x20 };
 
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	int dma = adev->dma_mode;