Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712665 > unrolled thread

[PATCH] scsi: ncr5380: constify pnp_device_id

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-16 07:00 +0200
Last post2017-08-17 03:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] scsi: ncr5380: constify pnp_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-16 07:00 +0200
    Re: [PATCH] scsi: ncr5380: constify pnp_device_id Finn Thain <fthain@telegraphics.com.au> - 2017-08-16 09:20 +0200
    Re: [PATCH] scsi: ncr5380: constify pnp_device_id "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-08-17 03:00 +0200

#1712665 — [PATCH] scsi: ncr5380: constify pnp_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-16 07:00 +0200
Subject[PATCH] scsi: ncr5380: constify pnp_device_id
Message-ID<ueYAV-2vJ-1@gated-at.bofh.it>
pnp_device_id are not supposed to change at runtime. All functions
working with pnp_device_id provided by <linux/pnp.h> work with
const pnp_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/scsi/g_NCR5380.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index c34fc91..1968d81 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -703,7 +703,7 @@ static struct isa_driver generic_NCR5380_isa_driver = {
 };
 
 #ifdef CONFIG_PNP
-static struct pnp_device_id generic_NCR5380_pnp_ids[] = {
+static const struct pnp_device_id generic_NCR5380_pnp_ids[] = {
 	{ .id = "DTC436e", .driver_data = BOARD_DTC3181E },
 	{ .id = "" }
 };
-- 
2.7.4

[toc] | [next] | [standalone]


#1712727

FromFinn Thain <fthain@telegraphics.com.au>
Date2017-08-16 09:20 +0200
Message-ID<uf0Mp-42X-1@gated-at.bofh.it>
In reply to#1712665
On Wed, 16 Aug 2017, Arvind Yadav wrote:

> pnp_device_id are not supposed to change at runtime. All functions
> working with pnp_device_id provided by <linux/pnp.h> work with
> const pnp_device_id. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Acked-by: Finn Thain <fthain@telegraphics.com.au>

> ---
>  drivers/scsi/g_NCR5380.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
> index c34fc91..1968d81 100644
> --- a/drivers/scsi/g_NCR5380.c
> +++ b/drivers/scsi/g_NCR5380.c
> @@ -703,7 +703,7 @@ static struct isa_driver generic_NCR5380_isa_driver = {
>  };
>  
>  #ifdef CONFIG_PNP
> -static struct pnp_device_id generic_NCR5380_pnp_ids[] = {
> +static const struct pnp_device_id generic_NCR5380_pnp_ids[] = {
>  	{ .id = "DTC436e", .driver_data = BOARD_DTC3181E },
>  	{ .id = "" }
>  };
> 

[toc] | [prev] | [next] | [standalone]


#1713454

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-08-17 03:00 +0200
Message-ID<ufhkd-5JZ-7@gated-at.bofh.it>
In reply to#1712665
Arvind,

> pnp_device_id are not supposed to change at runtime. All functions
> working with pnp_device_id provided by <linux/pnp.h> work with
> const pnp_device_id. So mark the non-const structs as const.

Applied to 4.14/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web