linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE
@ 2015-07-19 17:23 Vaishali Thakkar
  2015-07-20  2:42 ` Michael Neuling
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vaishali Thakkar @ 2015-07-19 17:23 UTC (permalink / raw)
  To: Ian Munsie; +Cc: Michael Neuling, linuxppc-dev, linux-kernel

Macro DEFINE_PCI_DEVICE_TABLE is deprecated. So, here use
struct pci_device_id instead of DEFINE_PCI_DEVICE_TABLE with
the goal of getting rid of this macro completely.

The Coccinelle semantic patch that performs this transformation
is as follows:

@@
identifier a;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer i;
@@
- DEFINE_PCI_DEVICE_TABLE(a)
+ const struct pci_device_id a[]
= i;

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 32ad097..3ed0621 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -133,7 +133,7 @@ u8 cxl_afu_cr_read8(struct cxl_afu *afu, int cr, u64 off)
 	return (val >> ((off & 0x3) * 8)) & 0xff;
 }
 
-static DEFINE_PCI_DEVICE_TABLE(cxl_pci_tbl) = {
+static const struct pci_device_id cxl_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x0477), },
 	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x044b), },
 	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x04cf), },
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE
  2015-07-19 17:23 [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE Vaishali Thakkar
@ 2015-07-20  2:42 ` Michael Neuling
  2015-07-20  2:46 ` Ian Munsie
  2015-08-27 21:58 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Neuling @ 2015-07-20  2:42 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Ian Munsie, linuxppc-dev, linux-kernel

On Sun, 2015-07-19 at 22:53 +0530, Vaishali Thakkar wrote:
> Macro DEFINE_PCI_DEVICE_TABLE is deprecated. So, here use
> struct pci_device_id instead of DEFINE_PCI_DEVICE_TABLE with
> the goal of getting rid of this macro completely.
>=20
> The Coccinelle semantic patch that performs this transformation
> is as follows:
>=20
> @@
> identifier a;
> declarer name DEFINE_PCI_DEVICE_TABLE;
> initializer i;
> @@
> - DEFINE_PCI_DEVICE_TABLE(a)
> + const struct pci_device_id a[]
> =3D i;
>=20
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>

Looks good, thanks!

Acked-by: Michael Neuling <mikey@neuling.org>


> ---
>  drivers/misc/cxl/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index 32ad097..3ed0621 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -133,7 +133,7 @@ u8 cxl_afu_cr_read8(struct cxl_afu *afu, int cr, u64 =
off)
>  	return (val >> ((off & 0x3) * 8)) & 0xff;
>  }
> =20
> -static DEFINE_PCI_DEVICE_TABLE(cxl_pci_tbl) =3D {
> +static const struct pci_device_id cxl_pci_tbl[] =3D {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x0477), },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x044b), },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_IBM, 0x04cf), },

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE
  2015-07-19 17:23 [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE Vaishali Thakkar
  2015-07-20  2:42 ` Michael Neuling
@ 2015-07-20  2:46 ` Ian Munsie
  2015-08-27 21:58 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Munsie @ 2015-07-20  2:46 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Michael Neuling, linuxppc-dev, linux-kernel

Acked-by: Ian Munsie <imunsie@au1.ibm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE
  2015-07-19 17:23 [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE Vaishali Thakkar
  2015-07-20  2:42 ` Michael Neuling
  2015-07-20  2:46 ` Ian Munsie
@ 2015-08-27 21:58 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2015-08-27 21:58 UTC (permalink / raw)
  To: Vaishali Thakkar, Ian Munsie; +Cc: Michael Neuling, linuxppc-dev, linux-kernel

On Sun, 2015-19-07 at 17:23:52 UTC, Vaishali Thakkar wrote:
> Macro DEFINE_PCI_DEVICE_TABLE is deprecated. So, here use
> struct pci_device_id instead of DEFINE_PCI_DEVICE_TABLE with
> the goal of getting rid of this macro completely.
> 
> The Coccinelle semantic patch that performs this transformation
> is as follows:
> 
> @@
> identifier a;
> declarer name DEFINE_PCI_DEVICE_TABLE;
> initializer i;
> @@
> - DEFINE_PCI_DEVICE_TABLE(a)
> + const struct pci_device_id a[]
> = i;
> 
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> Acked-by: Michael Neuling <mikey@neuling.org>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f47f966fbe0aaff4ebbdb83d

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-27 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-19 17:23 [PATCH] cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE Vaishali Thakkar
2015-07-20  2:42 ` Michael Neuling
2015-07-20  2:46 ` Ian Munsie
2015-08-27 21:58 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).