Skip to contentSkip to conversation

constify rio_device_id

PATCH In review Arvind Yadav 3 participants 9 messages Aug 26, 2017 – Sep 26, 2017 Rapidio

lore
Share & tools
lore
#0 lore raw

cover constify rio_device_id

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

Arvind Yadav (5):
[PATCH 1/5] rapidio: idt_gen2: constify rio_device_id [PATCH 2/5] rapidio: idt_gen3: constify rio_device_id [PATCH 3/5] rapidio: idtcps: constify rio_device_id [PATCH 4/5] rapidio: tsi568: constify rio_device_id [PATCH 5/5] rapidio: tsi57x: constify rio_device_id

 drivers/rapidio/switches/idt_gen2.c | 2 +-
 drivers/rapidio/switches/idt_gen3.c | 2 +-
 drivers/rapidio/switches/idtcps.c   | 2 +-
 drivers/rapidio/switches/tsi568.c   | 2 +-
 drivers/rapidio/switches/tsi57x.c   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 rapidio: idt_gen2: constify rio_device_id

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

---
 drivers/rapidio/switches/idt_gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/switches/idt_gen2.c +1 -1
index e67b923..4931ed7 100644
@@ -458,7 +458,7 @@ static void idtg2_remove(struct rio_dev *rdev)
 	idtg2_sysfs(rdev, false);
 }
 
-static struct rio_device_id idtg2_id_table[] = {
+static const struct rio_device_id idtg2_id_table[] = {
 	{RIO_DEVICE(RIO_DID_IDTCPS1848, RIO_VID_IDT)},
 	{RIO_DEVICE(RIO_DID_IDTCPS1616, RIO_VID_IDT)},
 	{RIO_DEVICE(RIO_DID_IDTVPS1616, RIO_VID_IDT)},
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/5 rapidio: idt_gen3: constify rio_device_id

In reply to Arvind Yadav

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

---
 drivers/rapidio/switches/idt_gen3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/switches/idt_gen3.c +1 -1
index c5923a5..85a3908 100644
@@ -348,7 +348,7 @@ static void idtg3_shutdown(struct rio_dev *rdev)
 	}
 }
 
-static struct rio_device_id idtg3_id_table[] = {
+static const struct rio_device_id idtg3_id_table[] = {
 	{RIO_DEVICE(RIO_DID_IDTRXS1632, RIO_VID_IDT)},
 	{RIO_DEVICE(RIO_DID_IDTRXS2448, RIO_VID_IDT)},
 	{ 0, }	/* terminate list */
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/5 rapidio: idtcps: constify rio_device_id

In reply to Arvind Yadav

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

---
 drivers/rapidio/switches/idtcps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/switches/idtcps.c +1 -1
index 7fbb60d..4058ce2 100644
@@ -168,7 +168,7 @@ static void idtcps_remove(struct rio_dev *rdev)
 	spin_unlock(&rdev->rswitch->lock);
 }
 
-static struct rio_device_id idtcps_id_table[] = {
+static const struct rio_device_id idtcps_id_table[] = {
 	{RIO_DEVICE(RIO_DID_IDTCPS6Q, RIO_VID_IDT)},
 	{RIO_DEVICE(RIO_DID_IDTCPS8, RIO_VID_IDT)},
 	{RIO_DEVICE(RIO_DID_IDTCPS10Q, RIO_VID_IDT)},
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/5 rapidio: tsi568: constify rio_device_id

In reply to Arvind Yadav

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

---
 drivers/rapidio/switches/tsi568.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/switches/tsi568.c +1 -1
index 8a43561..1214628b 100644
@@ -169,7 +169,7 @@ static void tsi568_remove(struct rio_dev *rdev)
 	spin_unlock(&rdev->rswitch->lock);
 }
 
-static struct rio_device_id tsi568_id_table[] = {
+static const struct rio_device_id tsi568_id_table[] = {
 	{RIO_DEVICE(RIO_DID_TSI568, RIO_VID_TUNDRA)},
 	{ 0, }	/* terminate list */
 };
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/5 rapidio: tsi57x: constify rio_device_id

In reply to Arvind Yadav

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

---
 drivers/rapidio/switches/tsi57x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/switches/tsi57x.c +1 -1
index 2700d15..9f063e2 100644
@@ -336,7 +336,7 @@ static void tsi57x_remove(struct rio_dev *rdev)
 	spin_unlock(&rdev->rswitch->lock);
 }
 
-static struct rio_device_id tsi57x_id_table[] = {
+static const struct rio_device_id tsi57x_id_table[] = {
 	{RIO_DEVICE(RIO_DID_TSI572, RIO_VID_TUNDRA)},
 	{RIO_DEVICE(RIO_DID_TSI574, RIO_VID_TUNDRA)},
 	{RIO_DEVICE(RIO_DID_TSI577, RIO_VID_TUNDRA)},
Signature · 1 line
2.7.4
Acked-by on the v1 series
#6 lore raw
In reply to Arvind Yadav

Hi Andrew,

Please apply the patches listed below. I will forward them to you.

Thank you,

Alex.

-----Original Message-----
From: Arvind Yadav [mailto:[email protected]]
Sent: Saturday, August 26, 2017 4:04 AM
To: [email protected]; Bounine, Alexandre <[email protected]>
Cc: [email protected]
Subject: [PATCH 0/5] constify rio_device_id

rio_device_id are not supposed to change at runtime. rio driver is working with const 'id_table'. So mark the non-const rio_device_id structs as const.

Arvind Yadav (5):
[PATCH 1/5] rapidio: idt_gen2: constify rio_device_id [PATCH 2/5] rapidio: idt_gen3: constify rio_device_id [PATCH 3/5] rapidio: idtcps: constify rio_device_id [PATCH 4/5] rapidio: tsi568: constify rio_device_id [PATCH 5/5] rapidio: tsi57x: constify rio_device_id

 drivers/rapidio/switches/idt_gen2.c | 2 +-
 drivers/rapidio/switches/idt_gen3.c | 2 +-
 drivers/rapidio/switches/idtcps.c   | 2 +-
 drivers/rapidio/switches/tsi568.c   | 2 +-
 drivers/rapidio/switches/tsi57x.c   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#7 lore raw
Quoted 5 lines · Alexandre

Hi Andrew,

Please apply the patches listed below. I will forward them to you.

I'm subscribed to linux-kernel so the extra forwardings weren't needed, thanks.

I'm thinking we might as well fold all these into a single patch, save a few electrons?

#8 lore raw

Yes, single patch makes sense.

-----Original Message-----
From: Andrew Morton [mailto:[email protected]]
Sent: Monday, September 25, 2017 7:14 PM
To: Bounine, Alexandre <[email protected]>
Cc: [email protected]; [email protected]; Arvind Yadav <[email protected]>
Subject: Re: [PATCH 0/5] constify rio_device_id

Quoted 5 lines · Alexandre

Hi Andrew,

Please apply the patches listed below. I will forward them to you.

I'm subscribed to linux-kernel so the extra forwardings weren't needed, thanks.

I'm thinking we might as well fold all these into a single patch, save a few electrons?