All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-19 10:27 ` Christophe Leroy
  0 siblings, 0 replies; 21+ messages in thread
From: Christophe Leroy @ 2022-03-19 10:27 UTC (permalink / raw)
  To: Ben Skeggs, Karol Herbst, Lyude Paul, David Airlie, Daniel Vetter
  Cc: nouveau, dri-devel, Christophe Leroy, linux-kernel

While working at fixing powerpc headers, I ended up with the
following error.

	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1

powerpc and a few other architectures have a prom_init() global function.
One day or another it will conflict with the one in shadowrom.c

Those being static, they can easily be renamed. Do it.

While at it, also rename the ops structure as 'nvbios_prom' instead of
'nvbios_rom' in order to make it clear that it refers to the
NV_PROM device.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.

 drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
index fac1bff1311b..cfa8a0c356dd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
@@ -19,7 +19,7 @@ struct nvbios_source {
 int nvbios_extend(struct nvkm_bios *, u32 length);
 int nvbios_shadow(struct nvkm_bios *);
 
-extern const struct nvbios_source nvbios_rom;
+extern const struct nvbios_source nvbios_prom;
 extern const struct nvbios_source nvbios_ramin;
 extern const struct nvbios_source nvbios_acpi_fast;
 extern const struct nvbios_source nvbios_acpi_slow;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
index 4b571cc6bc70..19188683c8fc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
@@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
 	struct shadow mthds[] = {
 		{ 0, &nvbios_of },
 		{ 0, &nvbios_ramin },
-		{ 0, &nvbios_rom },
+		{ 0, &nvbios_prom },
 		{ 0, &nvbios_acpi_fast },
 		{ 4, &nvbios_acpi_slow },
 		{ 1, &nvbios_pcirom },
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
index ffa4b395220a..39144ceb117b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
@@ -25,7 +25,7 @@
 #include <subdev/pci.h>
 
 static u32
-prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
+nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 {
 	struct nvkm_device *device = data;
 	u32 i;
@@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 }
 
 static void
-prom_fini(void *data)
+nvbios_prom_fini(void *data)
 {
 	struct nvkm_device *device = data;
 	nvkm_pci_rom_shadow(device->pci, true);
 }
 
 static void *
-prom_init(struct nvkm_bios *bios, const char *name)
+nvbios_prom_init(struct nvkm_bios *bios, const char *name)
 {
 	struct nvkm_device *device = bios->subdev.device;
 	if (device->card_type == NV_40 && device->chipset >= 0x4c)
@@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
 }
 
 const struct nvbios_source
-nvbios_rom = {
+nvbios_prom = {
 	.name = "PROM",
-	.init = prom_init,
-	.fini = prom_fini,
-	.read = prom_read,
+	.init = nvbios_prom_init,
+	.fini = nvbios_prom_fini,
+	.read = nvbios_prom_read,
 	.rw = false,
 };
-- 
2.35.1


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

* [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-19 10:27 ` Christophe Leroy
  0 siblings, 0 replies; 21+ messages in thread
From: Christophe Leroy @ 2022-03-19 10:27 UTC (permalink / raw)
  To: Ben Skeggs, Karol Herbst, Lyude Paul, David Airlie, Daniel Vetter
  Cc: Christophe Leroy, dri-devel, nouveau, linux-kernel

While working at fixing powerpc headers, I ended up with the
following error.

	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1

powerpc and a few other architectures have a prom_init() global function.
One day or another it will conflict with the one in shadowrom.c

Those being static, they can easily be renamed. Do it.

While at it, also rename the ops structure as 'nvbios_prom' instead of
'nvbios_rom' in order to make it clear that it refers to the
NV_PROM device.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.

 drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
index fac1bff1311b..cfa8a0c356dd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
@@ -19,7 +19,7 @@ struct nvbios_source {
 int nvbios_extend(struct nvkm_bios *, u32 length);
 int nvbios_shadow(struct nvkm_bios *);
 
-extern const struct nvbios_source nvbios_rom;
+extern const struct nvbios_source nvbios_prom;
 extern const struct nvbios_source nvbios_ramin;
 extern const struct nvbios_source nvbios_acpi_fast;
 extern const struct nvbios_source nvbios_acpi_slow;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
index 4b571cc6bc70..19188683c8fc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
@@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
 	struct shadow mthds[] = {
 		{ 0, &nvbios_of },
 		{ 0, &nvbios_ramin },
-		{ 0, &nvbios_rom },
+		{ 0, &nvbios_prom },
 		{ 0, &nvbios_acpi_fast },
 		{ 4, &nvbios_acpi_slow },
 		{ 1, &nvbios_pcirom },
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
index ffa4b395220a..39144ceb117b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
@@ -25,7 +25,7 @@
 #include <subdev/pci.h>
 
 static u32
-prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
+nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 {
 	struct nvkm_device *device = data;
 	u32 i;
@@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 }
 
 static void
-prom_fini(void *data)
+nvbios_prom_fini(void *data)
 {
 	struct nvkm_device *device = data;
 	nvkm_pci_rom_shadow(device->pci, true);
 }
 
 static void *
-prom_init(struct nvkm_bios *bios, const char *name)
+nvbios_prom_init(struct nvkm_bios *bios, const char *name)
 {
 	struct nvkm_device *device = bios->subdev.device;
 	if (device->card_type == NV_40 && device->chipset >= 0x4c)
@@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
 }
 
 const struct nvbios_source
-nvbios_rom = {
+nvbios_prom = {
 	.name = "PROM",
-	.init = prom_init,
-	.fini = prom_fini,
-	.read = prom_read,
+	.init = nvbios_prom_init,
+	.fini = nvbios_prom_fini,
+	.read = nvbios_prom_read,
 	.rw = false,
 };
-- 
2.35.1


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

* [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-19 10:27 ` Christophe Leroy
  0 siblings, 0 replies; 21+ messages in thread
From: Christophe Leroy @ 2022-03-19 10:27 UTC (permalink / raw)
  To: Ben Skeggs, Karol Herbst, Lyude Paul, David Airlie, Daniel Vetter
  Cc: nouveau, dri-devel, Christophe Leroy, linux-kernel

While working at fixing powerpc headers, I ended up with the
following error.

	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1

powerpc and a few other architectures have a prom_init() global function.
One day or another it will conflict with the one in shadowrom.c

Those being static, they can easily be renamed. Do it.

While at it, also rename the ops structure as 'nvbios_prom' instead of
'nvbios_rom' in order to make it clear that it refers to the
NV_PROM device.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.

 drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
index fac1bff1311b..cfa8a0c356dd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
@@ -19,7 +19,7 @@ struct nvbios_source {
 int nvbios_extend(struct nvkm_bios *, u32 length);
 int nvbios_shadow(struct nvkm_bios *);
 
-extern const struct nvbios_source nvbios_rom;
+extern const struct nvbios_source nvbios_prom;
 extern const struct nvbios_source nvbios_ramin;
 extern const struct nvbios_source nvbios_acpi_fast;
 extern const struct nvbios_source nvbios_acpi_slow;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
index 4b571cc6bc70..19188683c8fc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
@@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
 	struct shadow mthds[] = {
 		{ 0, &nvbios_of },
 		{ 0, &nvbios_ramin },
-		{ 0, &nvbios_rom },
+		{ 0, &nvbios_prom },
 		{ 0, &nvbios_acpi_fast },
 		{ 4, &nvbios_acpi_slow },
 		{ 1, &nvbios_pcirom },
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
index ffa4b395220a..39144ceb117b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
@@ -25,7 +25,7 @@
 #include <subdev/pci.h>
 
 static u32
-prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
+nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 {
 	struct nvkm_device *device = data;
 	u32 i;
@@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
 }
 
 static void
-prom_fini(void *data)
+nvbios_prom_fini(void *data)
 {
 	struct nvkm_device *device = data;
 	nvkm_pci_rom_shadow(device->pci, true);
 }
 
 static void *
-prom_init(struct nvkm_bios *bios, const char *name)
+nvbios_prom_init(struct nvkm_bios *bios, const char *name)
 {
 	struct nvkm_device *device = bios->subdev.device;
 	if (device->card_type == NV_40 && device->chipset >= 0x4c)
@@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
 }
 
 const struct nvbios_source
-nvbios_rom = {
+nvbios_prom = {
 	.name = "PROM",
-	.init = prom_init,
-	.fini = prom_fini,
-	.read = prom_read,
+	.init = nvbios_prom_init,
+	.fini = nvbios_prom_fini,
+	.read = nvbios_prom_read,
 	.rw = false,
 };
-- 
2.35.1


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-03-19 10:27 ` Christophe Leroy
  (?)
@ 2022-03-22 18:25   ` Lyude Paul
  -1 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-03-22 18:25 UTC (permalink / raw)
  To: Christophe Leroy, Ben Skeggs, Karol Herbst, David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push to drm-misc-next

On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
> char *)'
>         make[5]: *** [scripts/Makefile.build:288:
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
> to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>         struct shadow mthds[] = {
>                 { 0, &nvbios_of },
>                 { 0, &nvbios_ramin },
> -               { 0, &nvbios_rom },
> +               { 0, &nvbios_prom },
>                 { 0, &nvbios_acpi_fast },
>                 { 4, &nvbios_acpi_slow },
>                 { 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> *bios)
>  {
>         struct nvkm_device *device = data;
>         u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>         struct nvkm_device *device = data;
>         nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>         struct nvkm_device *device = bios->subdev.device;
>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>         .name = "PROM",
> -       .init = prom_init,
> -       .fini = prom_fini,
> -       .read = prom_read,
> +       .init = nvbios_prom_init,
> +       .fini = nvbios_prom_fini,
> +       .read = nvbios_prom_read,
>         .rw = false,
>  };

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-22 18:25   ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-03-22 18:25 UTC (permalink / raw)
  To: Christophe Leroy, Ben Skeggs, Karol Herbst, David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push to drm-misc-next

On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
> char *)'
>         make[5]: *** [scripts/Makefile.build:288:
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
> to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>         struct shadow mthds[] = {
>                 { 0, &nvbios_of },
>                 { 0, &nvbios_ramin },
> -               { 0, &nvbios_rom },
> +               { 0, &nvbios_prom },
>                 { 0, &nvbios_acpi_fast },
>                 { 4, &nvbios_acpi_slow },
>                 { 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> *bios)
>  {
>         struct nvkm_device *device = data;
>         u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>         struct nvkm_device *device = data;
>         nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>         struct nvkm_device *device = bios->subdev.device;
>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>         .name = "PROM",
> -       .init = prom_init,
> -       .fini = prom_fini,
> -       .read = prom_read,
> +       .init = nvbios_prom_init,
> +       .fini = nvbios_prom_fini,
> +       .read = nvbios_prom_read,
>         .rw = false,
>  };

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-22 18:25   ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-03-22 18:25 UTC (permalink / raw)
  To: Christophe Leroy, Ben Skeggs, Karol Herbst, David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push to drm-misc-next

On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
> char *)'
>         make[5]: *** [scripts/Makefile.build:288:
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
> to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>         struct shadow mthds[] = {
>                 { 0, &nvbios_of },
>                 { 0, &nvbios_ramin },
> -               { 0, &nvbios_rom },
> +               { 0, &nvbios_prom },
>                 { 0, &nvbios_acpi_fast },
>                 { 4, &nvbios_acpi_slow },
>                 { 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> *bios)
>  {
>         struct nvkm_device *device = data;
>         u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>         struct nvkm_device *device = data;
>         nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>         struct nvkm_device *device = bios->subdev.device;
>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>         .name = "PROM",
> -       .init = prom_init,
> -       .fini = prom_fini,
> -       .read = prom_read,
> +       .init = nvbios_prom_init,
> +       .fini = nvbios_prom_fini,
> +       .read = nvbios_prom_read,
>         .rw = false,
>  };

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-03-19 10:27 ` Christophe Leroy
  (?)
@ 2022-03-22 18:43   ` Tommaso Merciai
  -1 siblings, 0 replies; 21+ messages in thread
From: Tommaso Merciai @ 2022-03-22 18:43 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Ben Skeggs, Karol Herbst, Lyude Paul, David Airlie,
	Daniel Vetter, dri-devel, nouveau, linux-kernel

On Sat, Mar 19, 2022 at 11:27:51AM +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
> 	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
> 	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>  	struct shadow mthds[] = {
>  		{ 0, &nvbios_of },
>  		{ 0, &nvbios_ramin },
> -		{ 0, &nvbios_rom },
> +		{ 0, &nvbios_prom },
>  		{ 0, &nvbios_acpi_fast },
>  		{ 4, &nvbios_acpi_slow },
>  		{ 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  {
>  	struct nvkm_device *device = data;
>  	u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>  	struct nvkm_device *device = data;
>  	nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>  	struct nvkm_device *device = bios->subdev.device;
>  	if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>  	.name = "PROM",
> -	.init = prom_init,
> -	.fini = prom_fini,
> -	.read = prom_read,
> +	.init = nvbios_prom_init,
> +	.fini = nvbios_prom_fini,
> +	.read = nvbios_prom_read,
>  	.rw = false,
>  };
> -- 
> 2.35.1
> 

Look's good.

Tommaso
-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-22 18:43   ` Tommaso Merciai
  0 siblings, 0 replies; 21+ messages in thread
From: Tommaso Merciai @ 2022-03-22 18:43 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Karol Herbst, David Airlie, nouveau, linux-kernel, dri-devel, Ben Skeggs

On Sat, Mar 19, 2022 at 11:27:51AM +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
> 	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
> 	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>  	struct shadow mthds[] = {
>  		{ 0, &nvbios_of },
>  		{ 0, &nvbios_ramin },
> -		{ 0, &nvbios_rom },
> +		{ 0, &nvbios_prom },
>  		{ 0, &nvbios_acpi_fast },
>  		{ 4, &nvbios_acpi_slow },
>  		{ 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  {
>  	struct nvkm_device *device = data;
>  	u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>  	struct nvkm_device *device = data;
>  	nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>  	struct nvkm_device *device = bios->subdev.device;
>  	if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>  	.name = "PROM",
> -	.init = prom_init,
> -	.fini = prom_fini,
> -	.read = prom_read,
> +	.init = nvbios_prom_init,
> +	.fini = nvbios_prom_fini,
> +	.read = nvbios_prom_read,
>  	.rw = false,
>  };
> -- 
> 2.35.1
> 

Look's good.

Tommaso
-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-03-22 18:43   ` Tommaso Merciai
  0 siblings, 0 replies; 21+ messages in thread
From: Tommaso Merciai @ 2022-03-22 18:43 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: David Airlie, nouveau, linux-kernel, dri-devel, Ben Skeggs,
	Daniel Vetter

On Sat, Mar 19, 2022 at 11:27:51AM +0100, Christophe Leroy wrote:
> While working at fixing powerpc headers, I ended up with the
> following error.
> 
> 	drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)'
> 	make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> 
> powerpc and a few other architectures have a prom_init() global function.
> One day or another it will conflict with the one in shadowrom.c
> 
> Those being static, they can easily be renamed. Do it.
> 
> While at it, also rename the ops structure as 'nvbios_prom' instead of
> 'nvbios_rom' in order to make it clear that it refers to the
> NV_PROM device.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> index fac1bff1311b..cfa8a0c356dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> @@ -19,7 +19,7 @@ struct nvbios_source {
>  int nvbios_extend(struct nvkm_bios *, u32 length);
>  int nvbios_shadow(struct nvkm_bios *);
>  
> -extern const struct nvbios_source nvbios_rom;
> +extern const struct nvbios_source nvbios_prom;
>  extern const struct nvbios_source nvbios_ramin;
>  extern const struct nvbios_source nvbios_acpi_fast;
>  extern const struct nvbios_source nvbios_acpi_slow;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> index 4b571cc6bc70..19188683c8fc 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>  	struct shadow mthds[] = {
>  		{ 0, &nvbios_of },
>  		{ 0, &nvbios_ramin },
> -		{ 0, &nvbios_rom },
> +		{ 0, &nvbios_prom },
>  		{ 0, &nvbios_acpi_fast },
>  		{ 4, &nvbios_acpi_slow },
>  		{ 1, &nvbios_pcirom },
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> index ffa4b395220a..39144ceb117b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> @@ -25,7 +25,7 @@
>  #include <subdev/pci.h>
>  
>  static u32
> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  {
>  	struct nvkm_device *device = data;
>  	u32 i;
> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>  }
>  
>  static void
> -prom_fini(void *data)
> +nvbios_prom_fini(void *data)
>  {
>  	struct nvkm_device *device = data;
>  	nvkm_pci_rom_shadow(device->pci, true);
>  }
>  
>  static void *
> -prom_init(struct nvkm_bios *bios, const char *name)
> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>  {
>  	struct nvkm_device *device = bios->subdev.device;
>  	if (device->card_type == NV_40 && device->chipset >= 0x4c)
> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>  }
>  
>  const struct nvbios_source
> -nvbios_rom = {
> +nvbios_prom = {
>  	.name = "PROM",
> -	.init = prom_init,
> -	.fini = prom_fini,
> -	.read = prom_read,
> +	.init = nvbios_prom_init,
> +	.fini = nvbios_prom_fini,
> +	.read = nvbios_prom_read,
>  	.rw = false,
>  };
> -- 
> 2.35.1
> 

Look's good.

Tommaso
-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-03-22 18:25   ` [Nouveau] " Lyude Paul
  (?)
@ 2022-06-07 13:00     ` Michael Ellerman
  -1 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-07 13:00 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel

Lyude Paul <lyude@redhat.com> writes:
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
> Will push to drm-misc-next

I don't see this patch in mainline or drm-misc-next, did it get lost?

cheers

> On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> While working at fixing powerpc headers, I ended up with the
>> following error.
>> 
>>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
>> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
>> char *)'
>>         make[5]: *** [scripts/Makefile.build:288:
>> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> 
>> powerpc and a few other architectures have a prom_init() global function.
>> One day or another it will conflict with the one in shadowrom.c
>> 
>> Those being static, they can easily be renamed. Do it.
>> 
>> While at it, also rename the ops structure as 'nvbios_prom' instead of
>> 'nvbios_rom' in order to make it clear that it refers to the
>> NV_PROM device.
>> 
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
>> to keep things consistant.
>> 
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>>  3 files changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> index fac1bff1311b..cfa8a0c356dd 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> @@ -19,7 +19,7 @@ struct nvbios_source {
>>  int nvbios_extend(struct nvkm_bios *, u32 length);
>>  int nvbios_shadow(struct nvkm_bios *);
>>  
>> -extern const struct nvbios_source nvbios_rom;
>> +extern const struct nvbios_source nvbios_prom;
>>  extern const struct nvbios_source nvbios_ramin;
>>  extern const struct nvbios_source nvbios_acpi_fast;
>>  extern const struct nvbios_source nvbios_acpi_slow;
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> index 4b571cc6bc70..19188683c8fc 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>>         struct shadow mthds[] = {
>>                 { 0, &nvbios_of },
>>                 { 0, &nvbios_ramin },
>> -               { 0, &nvbios_rom },
>> +               { 0, &nvbios_prom },
>>                 { 0, &nvbios_acpi_fast },
>>                 { 4, &nvbios_acpi_slow },
>>                 { 1, &nvbios_pcirom },
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> index ffa4b395220a..39144ceb117b 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> @@ -25,7 +25,7 @@
>>  #include <subdev/pci.h>
>>  
>>  static u32
>> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> *bios)
>>  {
>>         struct nvkm_device *device = data;
>>         u32 i;
>> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
>> nvkm_bios *bios)
>>  }
>>  
>>  static void
>> -prom_fini(void *data)
>> +nvbios_prom_fini(void *data)
>>  {
>>         struct nvkm_device *device = data;
>>         nvkm_pci_rom_shadow(device->pci, true);
>>  }
>>  
>>  static void *
>> -prom_init(struct nvkm_bios *bios, const char *name)
>> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>>  {
>>         struct nvkm_device *device = bios->subdev.device;
>>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>>  }
>>  
>>  const struct nvbios_source
>> -nvbios_rom = {
>> +nvbios_prom = {
>>         .name = "PROM",
>> -       .init = prom_init,
>> -       .fini = prom_fini,
>> -       .read = prom_read,
>> +       .init = nvbios_prom_init,
>> +       .fini = nvbios_prom_fini,
>> +       .read = nvbios_prom_read,
>>         .rw = false,
>>  };
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-07 13:00     ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-07 13:00 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Lyude Paul <lyude@redhat.com> writes:
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
> Will push to drm-misc-next

I don't see this patch in mainline or drm-misc-next, did it get lost?

cheers

> On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> While working at fixing powerpc headers, I ended up with the
>> following error.
>> 
>>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
>> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
>> char *)'
>>         make[5]: *** [scripts/Makefile.build:288:
>> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> 
>> powerpc and a few other architectures have a prom_init() global function.
>> One day or another it will conflict with the one in shadowrom.c
>> 
>> Those being static, they can easily be renamed. Do it.
>> 
>> While at it, also rename the ops structure as 'nvbios_prom' instead of
>> 'nvbios_rom' in order to make it clear that it refers to the
>> NV_PROM device.
>> 
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
>> to keep things consistant.
>> 
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>>  3 files changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> index fac1bff1311b..cfa8a0c356dd 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> @@ -19,7 +19,7 @@ struct nvbios_source {
>>  int nvbios_extend(struct nvkm_bios *, u32 length);
>>  int nvbios_shadow(struct nvkm_bios *);
>>  
>> -extern const struct nvbios_source nvbios_rom;
>> +extern const struct nvbios_source nvbios_prom;
>>  extern const struct nvbios_source nvbios_ramin;
>>  extern const struct nvbios_source nvbios_acpi_fast;
>>  extern const struct nvbios_source nvbios_acpi_slow;
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> index 4b571cc6bc70..19188683c8fc 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>>         struct shadow mthds[] = {
>>                 { 0, &nvbios_of },
>>                 { 0, &nvbios_ramin },
>> -               { 0, &nvbios_rom },
>> +               { 0, &nvbios_prom },
>>                 { 0, &nvbios_acpi_fast },
>>                 { 4, &nvbios_acpi_slow },
>>                 { 1, &nvbios_pcirom },
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> index ffa4b395220a..39144ceb117b 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> @@ -25,7 +25,7 @@
>>  #include <subdev/pci.h>
>>  
>>  static u32
>> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> *bios)
>>  {
>>         struct nvkm_device *device = data;
>>         u32 i;
>> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
>> nvkm_bios *bios)
>>  }
>>  
>>  static void
>> -prom_fini(void *data)
>> +nvbios_prom_fini(void *data)
>>  {
>>         struct nvkm_device *device = data;
>>         nvkm_pci_rom_shadow(device->pci, true);
>>  }
>>  
>>  static void *
>> -prom_init(struct nvkm_bios *bios, const char *name)
>> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>>  {
>>         struct nvkm_device *device = bios->subdev.device;
>>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>>  }
>>  
>>  const struct nvbios_source
>> -nvbios_rom = {
>> +nvbios_prom = {
>>         .name = "PROM",
>> -       .init = prom_init,
>> -       .fini = prom_fini,
>> -       .read = prom_read,
>> +       .init = nvbios_prom_init,
>> +       .fini = nvbios_prom_fini,
>> +       .read = nvbios_prom_read,
>>         .rw = false,
>>  };
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-07 13:00     ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-07 13:00 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Lyude Paul <lyude@redhat.com> writes:
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
> Will push to drm-misc-next

I don't see this patch in mainline or drm-misc-next, did it get lost?

cheers

> On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> While working at fixing powerpc headers, I ended up with the
>> following error.
>> 
>>         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error:
>> conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const
>> char *)'
>>         make[5]: *** [scripts/Makefile.build:288:
>> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> 
>> powerpc and a few other architectures have a prom_init() global function.
>> One day or another it will conflict with the one in shadowrom.c
>> 
>> Those being static, they can easily be renamed. Do it.
>> 
>> While at it, also rename the ops structure as 'nvbios_prom' instead of
>> 'nvbios_rom' in order to make it clear that it refers to the
>> NV_PROM device.
>> 
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name
>> to keep things consistant.
>> 
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>>  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>>  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
>>  3 files changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> index fac1bff1311b..cfa8a0c356dd 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> @@ -19,7 +19,7 @@ struct nvbios_source {
>>  int nvbios_extend(struct nvkm_bios *, u32 length);
>>  int nvbios_shadow(struct nvkm_bios *);
>>  
>> -extern const struct nvbios_source nvbios_rom;
>> +extern const struct nvbios_source nvbios_prom;
>>  extern const struct nvbios_source nvbios_ramin;
>>  extern const struct nvbios_source nvbios_acpi_fast;
>>  extern const struct nvbios_source nvbios_acpi_slow;
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> index 4b571cc6bc70..19188683c8fc 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>>         struct shadow mthds[] = {
>>                 { 0, &nvbios_of },
>>                 { 0, &nvbios_ramin },
>> -               { 0, &nvbios_rom },
>> +               { 0, &nvbios_prom },
>>                 { 0, &nvbios_acpi_fast },
>>                 { 4, &nvbios_acpi_slow },
>>                 { 1, &nvbios_pcirom },
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> index ffa4b395220a..39144ceb117b 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> @@ -25,7 +25,7 @@
>>  #include <subdev/pci.h>
>>  
>>  static u32
>> -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> *bios)
>>  {
>>         struct nvkm_device *device = data;
>>         u32 i;
>> @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
>> nvkm_bios *bios)
>>  }
>>  
>>  static void
>> -prom_fini(void *data)
>> +nvbios_prom_fini(void *data)
>>  {
>>         struct nvkm_device *device = data;
>>         nvkm_pci_rom_shadow(device->pci, true);
>>  }
>>  
>>  static void *
>> -prom_init(struct nvkm_bios *bios, const char *name)
>> +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>>  {
>>         struct nvkm_device *device = bios->subdev.device;
>>         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
>>  }
>>  
>>  const struct nvbios_source
>> -nvbios_rom = {
>> +nvbios_prom = {
>>         .name = "PROM",
>> -       .init = prom_init,
>> -       .fini = prom_fini,
>> -       .read = prom_read,
>> +       .init = nvbios_prom_init,
>> +       .fini = nvbios_prom_fini,
>> +       .read = nvbios_prom_read,
>>         .rw = false,
>>  };
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-06-07 13:00     ` [Nouveau] " Michael Ellerman
  (?)
@ 2022-06-08 20:48       ` Lyude Paul
  -1 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:48 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel

Whoops, it totally may have. Thank you for the reminder, I will double check
and make sure this gets pushed today

On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> Lyude Paul <lyude@redhat.com> writes:
> > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > 
> > Will push to drm-misc-next
> 
> I don't see this patch in mainline or drm-misc-next, did it get lost?
> 
> cheers
> 
> > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > While working at fixing powerpc headers, I ended up with the
> > > following error.
> > > 
> > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > error:
> > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > const
> > > char *)'
> > >         make[5]: *** [scripts/Makefile.build:288:
> > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > 
> > > powerpc and a few other architectures have a prom_init() global
> > > function.
> > > One day or another it will conflict with the one in shadowrom.c
> > > 
> > > Those being static, they can easily be renamed. Do it.
> > > 
> > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > 'nvbios_rom' in order to make it clear that it refers to the
> > > NV_PROM device.
> > > 
> > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > ---
> > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > name
> > > to keep things consistant.
> > > 
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
> > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > index fac1bff1311b..cfa8a0c356dd 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > >  int nvbios_shadow(struct nvkm_bios *);
> > >  
> > > -extern const struct nvbios_source nvbios_rom;
> > > +extern const struct nvbios_source nvbios_prom;
> > >  extern const struct nvbios_source nvbios_ramin;
> > >  extern const struct nvbios_source nvbios_acpi_fast;
> > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > index 4b571cc6bc70..19188683c8fc 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > >         struct shadow mthds[] = {
> > >                 { 0, &nvbios_of },
> > >                 { 0, &nvbios_ramin },
> > > -               { 0, &nvbios_rom },
> > > +               { 0, &nvbios_prom },
> > >                 { 0, &nvbios_acpi_fast },
> > >                 { 4, &nvbios_acpi_slow },
> > >                 { 1, &nvbios_pcirom },
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > index ffa4b395220a..39144ceb117b 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > @@ -25,7 +25,7 @@
> > >  #include <subdev/pci.h>
> > >  
> > >  static u32
> > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > *bios)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         u32 i;
> > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> > > nvkm_bios *bios)
> > >  }
> > >  
> > >  static void
> > > -prom_fini(void *data)
> > > +nvbios_prom_fini(void *data)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         nvkm_pci_rom_shadow(device->pci, true);
> > >  }
> > >  
> > >  static void *
> > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > >  {
> > >         struct nvkm_device *device = bios->subdev.device;
> > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
> > >  }
> > >  
> > >  const struct nvbios_source
> > > -nvbios_rom = {
> > > +nvbios_prom = {
> > >         .name = "PROM",
> > > -       .init = prom_init,
> > > -       .fini = prom_fini,
> > > -       .read = prom_read,
> > > +       .init = nvbios_prom_init,
> > > +       .fini = nvbios_prom_fini,
> > > +       .read = nvbios_prom_read,
> > >         .rw = false,
> > >  };
> > 
> > -- 
> > Cheers,
> >  Lyude Paul (she/her)
> >  Software Engineer at Red Hat
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-08 20:48       ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:48 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Whoops, it totally may have. Thank you for the reminder, I will double check
and make sure this gets pushed today

On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> Lyude Paul <lyude@redhat.com> writes:
> > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > 
> > Will push to drm-misc-next
> 
> I don't see this patch in mainline or drm-misc-next, did it get lost?
> 
> cheers
> 
> > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > While working at fixing powerpc headers, I ended up with the
> > > following error.
> > > 
> > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > error:
> > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > const
> > > char *)'
> > >         make[5]: *** [scripts/Makefile.build:288:
> > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > 
> > > powerpc and a few other architectures have a prom_init() global
> > > function.
> > > One day or another it will conflict with the one in shadowrom.c
> > > 
> > > Those being static, they can easily be renamed. Do it.
> > > 
> > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > 'nvbios_rom' in order to make it clear that it refers to the
> > > NV_PROM device.
> > > 
> > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > ---
> > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > name
> > > to keep things consistant.
> > > 
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
> > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > index fac1bff1311b..cfa8a0c356dd 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > >  int nvbios_shadow(struct nvkm_bios *);
> > >  
> > > -extern const struct nvbios_source nvbios_rom;
> > > +extern const struct nvbios_source nvbios_prom;
> > >  extern const struct nvbios_source nvbios_ramin;
> > >  extern const struct nvbios_source nvbios_acpi_fast;
> > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > index 4b571cc6bc70..19188683c8fc 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > >         struct shadow mthds[] = {
> > >                 { 0, &nvbios_of },
> > >                 { 0, &nvbios_ramin },
> > > -               { 0, &nvbios_rom },
> > > +               { 0, &nvbios_prom },
> > >                 { 0, &nvbios_acpi_fast },
> > >                 { 4, &nvbios_acpi_slow },
> > >                 { 1, &nvbios_pcirom },
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > index ffa4b395220a..39144ceb117b 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > @@ -25,7 +25,7 @@
> > >  #include <subdev/pci.h>
> > >  
> > >  static u32
> > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > *bios)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         u32 i;
> > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> > > nvkm_bios *bios)
> > >  }
> > >  
> > >  static void
> > > -prom_fini(void *data)
> > > +nvbios_prom_fini(void *data)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         nvkm_pci_rom_shadow(device->pci, true);
> > >  }
> > >  
> > >  static void *
> > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > >  {
> > >         struct nvkm_device *device = bios->subdev.device;
> > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
> > >  }
> > >  
> > >  const struct nvbios_source
> > > -nvbios_rom = {
> > > +nvbios_prom = {
> > >         .name = "PROM",
> > > -       .init = prom_init,
> > > -       .fini = prom_fini,
> > > -       .read = prom_read,
> > > +       .init = nvbios_prom_init,
> > > +       .fini = nvbios_prom_fini,
> > > +       .read = nvbios_prom_read,
> > >         .rw = false,
> > >  };
> > 
> > -- 
> > Cheers,
> >  Lyude Paul (she/her)
> >  Software Engineer at Red Hat
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-08 20:48       ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:48 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Whoops, it totally may have. Thank you for the reminder, I will double check
and make sure this gets pushed today

On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> Lyude Paul <lyude@redhat.com> writes:
> > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > 
> > Will push to drm-misc-next
> 
> I don't see this patch in mainline or drm-misc-next, did it get lost?
> 
> cheers
> 
> > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > While working at fixing powerpc headers, I ended up with the
> > > following error.
> > > 
> > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > error:
> > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > const
> > > char *)'
> > >         make[5]: *** [scripts/Makefile.build:288:
> > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > 
> > > powerpc and a few other architectures have a prom_init() global
> > > function.
> > > One day or another it will conflict with the one in shadowrom.c
> > > 
> > > Those being static, they can easily be renamed. Do it.
> > > 
> > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > 'nvbios_rom' in order to make it clear that it refers to the
> > > NV_PROM device.
> > > 
> > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > ---
> > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > name
> > > to keep things consistant.
> > > 
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++-------
> > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > index fac1bff1311b..cfa8a0c356dd 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > >  int nvbios_shadow(struct nvkm_bios *);
> > >  
> > > -extern const struct nvbios_source nvbios_rom;
> > > +extern const struct nvbios_source nvbios_prom;
> > >  extern const struct nvbios_source nvbios_ramin;
> > >  extern const struct nvbios_source nvbios_acpi_fast;
> > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > index 4b571cc6bc70..19188683c8fc 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > >         struct shadow mthds[] = {
> > >                 { 0, &nvbios_of },
> > >                 { 0, &nvbios_ramin },
> > > -               { 0, &nvbios_rom },
> > > +               { 0, &nvbios_prom },
> > >                 { 0, &nvbios_acpi_fast },
> > >                 { 4, &nvbios_acpi_slow },
> > >                 { 1, &nvbios_pcirom },
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > index ffa4b395220a..39144ceb117b 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > @@ -25,7 +25,7 @@
> > >  #include <subdev/pci.h>
> > >  
> > >  static u32
> > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > *bios)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         u32 i;
> > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct
> > > nvkm_bios *bios)
> > >  }
> > >  
> > >  static void
> > > -prom_fini(void *data)
> > > +nvbios_prom_fini(void *data)
> > >  {
> > >         struct nvkm_device *device = data;
> > >         nvkm_pci_rom_shadow(device->pci, true);
> > >  }
> > >  
> > >  static void *
> > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > >  {
> > >         struct nvkm_device *device = bios->subdev.device;
> > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name)
> > >  }
> > >  
> > >  const struct nvbios_source
> > > -nvbios_rom = {
> > > +nvbios_prom = {
> > >         .name = "PROM",
> > > -       .init = prom_init,
> > > -       .fini = prom_fini,
> > > -       .read = prom_read,
> > > +       .init = nvbios_prom_init,
> > > +       .fini = nvbios_prom_fini,
> > > +       .read = nvbios_prom_read,
> > >         .rw = false,
> > >  };
> > 
> > -- 
> > Cheers,
> >  Lyude Paul (she/her)
> >  Software Engineer at Red Hat
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-06-08 20:48       ` [Nouveau] " Lyude Paul
  (?)
@ 2022-06-08 20:51         ` Lyude Paul
  -1 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:51 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel

Alright, dim's pushing it now. sorry about that!

On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
> Whoops, it totally may have. Thank you for the reminder, I will double check
> and make sure this gets pushed today
> 
> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> > Lyude Paul <lyude@redhat.com> writes:
> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > > 
> > > Will push to drm-misc-next
> > 
> > I don't see this patch in mainline or drm-misc-next, did it get lost?
> > 
> > cheers
> > 
> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > > While working at fixing powerpc headers, I ended up with the
> > > > following error.
> > > > 
> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > > error:
> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > > const
> > > > char *)'
> > > >         make[5]: *** [scripts/Makefile.build:288:
> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > > 
> > > > powerpc and a few other architectures have a prom_init() global
> > > > function.
> > > > One day or another it will conflict with the one in shadowrom.c
> > > > 
> > > > Those being static, they can easily be renamed. Do it.
> > > > 
> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > > 'nvbios_rom' in order to make it clear that it refers to the
> > > > NV_PROM device.
> > > > 
> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > > ---
> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > > name
> > > > to keep things consistant.
> > > > 
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
> > > > -
> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > index fac1bff1311b..cfa8a0c356dd 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > > >  int nvbios_shadow(struct nvkm_bios *);
> > > >  
> > > > -extern const struct nvbios_source nvbios_rom;
> > > > +extern const struct nvbios_source nvbios_prom;
> > > >  extern const struct nvbios_source nvbios_ramin;
> > > >  extern const struct nvbios_source nvbios_acpi_fast;
> > > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > index 4b571cc6bc70..19188683c8fc 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > > >         struct shadow mthds[] = {
> > > >                 { 0, &nvbios_of },
> > > >                 { 0, &nvbios_ramin },
> > > > -               { 0, &nvbios_rom },
> > > > +               { 0, &nvbios_prom },
> > > >                 { 0, &nvbios_acpi_fast },
> > > >                 { 4, &nvbios_acpi_slow },
> > > >                 { 1, &nvbios_pcirom },
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > index ffa4b395220a..39144ceb117b 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > @@ -25,7 +25,7 @@
> > > >  #include <subdev/pci.h>
> > > >  
> > > >  static u32
> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > > *bios)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         u32 i;
> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
> > > > struct
> > > > nvkm_bios *bios)
> > > >  }
> > > >  
> > > >  static void
> > > > -prom_fini(void *data)
> > > > +nvbios_prom_fini(void *data)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         nvkm_pci_rom_shadow(device->pci, true);
> > > >  }
> > > >  
> > > >  static void *
> > > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > > >  {
> > > >         struct nvkm_device *device = bios->subdev.device;
> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
> > > > *name)
> > > >  }
> > > >  
> > > >  const struct nvbios_source
> > > > -nvbios_rom = {
> > > > +nvbios_prom = {
> > > >         .name = "PROM",
> > > > -       .init = prom_init,
> > > > -       .fini = prom_fini,
> > > > -       .read = prom_read,
> > > > +       .init = nvbios_prom_init,
> > > > +       .fini = nvbios_prom_fini,
> > > > +       .read = nvbios_prom_read,
> > > >         .rw = false,
> > > >  };
> > > 
> > > -- 
> > > Cheers,
> > >  Lyude Paul (she/her)
> > >  Software Engineer at Red Hat
> > 
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-08 20:51         ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:51 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Alright, dim's pushing it now. sorry about that!

On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
> Whoops, it totally may have. Thank you for the reminder, I will double check
> and make sure this gets pushed today
> 
> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> > Lyude Paul <lyude@redhat.com> writes:
> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > > 
> > > Will push to drm-misc-next
> > 
> > I don't see this patch in mainline or drm-misc-next, did it get lost?
> > 
> > cheers
> > 
> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > > While working at fixing powerpc headers, I ended up with the
> > > > following error.
> > > > 
> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > > error:
> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > > const
> > > > char *)'
> > > >         make[5]: *** [scripts/Makefile.build:288:
> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > > 
> > > > powerpc and a few other architectures have a prom_init() global
> > > > function.
> > > > One day or another it will conflict with the one in shadowrom.c
> > > > 
> > > > Those being static, they can easily be renamed. Do it.
> > > > 
> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > > 'nvbios_rom' in order to make it clear that it refers to the
> > > > NV_PROM device.
> > > > 
> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > > ---
> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > > name
> > > > to keep things consistant.
> > > > 
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
> > > > -
> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > index fac1bff1311b..cfa8a0c356dd 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > > >  int nvbios_shadow(struct nvkm_bios *);
> > > >  
> > > > -extern const struct nvbios_source nvbios_rom;
> > > > +extern const struct nvbios_source nvbios_prom;
> > > >  extern const struct nvbios_source nvbios_ramin;
> > > >  extern const struct nvbios_source nvbios_acpi_fast;
> > > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > index 4b571cc6bc70..19188683c8fc 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > > >         struct shadow mthds[] = {
> > > >                 { 0, &nvbios_of },
> > > >                 { 0, &nvbios_ramin },
> > > > -               { 0, &nvbios_rom },
> > > > +               { 0, &nvbios_prom },
> > > >                 { 0, &nvbios_acpi_fast },
> > > >                 { 4, &nvbios_acpi_slow },
> > > >                 { 1, &nvbios_pcirom },
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > index ffa4b395220a..39144ceb117b 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > @@ -25,7 +25,7 @@
> > > >  #include <subdev/pci.h>
> > > >  
> > > >  static u32
> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > > *bios)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         u32 i;
> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
> > > > struct
> > > > nvkm_bios *bios)
> > > >  }
> > > >  
> > > >  static void
> > > > -prom_fini(void *data)
> > > > +nvbios_prom_fini(void *data)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         nvkm_pci_rom_shadow(device->pci, true);
> > > >  }
> > > >  
> > > >  static void *
> > > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > > >  {
> > > >         struct nvkm_device *device = bios->subdev.device;
> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
> > > > *name)
> > > >  }
> > > >  
> > > >  const struct nvbios_source
> > > > -nvbios_rom = {
> > > > +nvbios_prom = {
> > > >         .name = "PROM",
> > > > -       .init = prom_init,
> > > > -       .fini = prom_fini,
> > > > -       .read = prom_read,
> > > > +       .init = nvbios_prom_init,
> > > > +       .fini = nvbios_prom_fini,
> > > > +       .read = nvbios_prom_read,
> > > >         .rw = false,
> > > >  };
> > > 
> > > -- 
> > > Cheers,
> > >  Lyude Paul (she/her)
> > >  Software Engineer at Red Hat
> > 
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-08 20:51         ` Lyude Paul
  0 siblings, 0 replies; 21+ messages in thread
From: Lyude Paul @ 2022-06-08 20:51 UTC (permalink / raw)
  To: Michael Ellerman, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Alright, dim's pushing it now. sorry about that!

On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
> Whoops, it totally may have. Thank you for the reminder, I will double check
> and make sure this gets pushed today
> 
> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
> > Lyude Paul <lyude@redhat.com> writes:
> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > > 
> > > Will push to drm-misc-next
> > 
> > I don't see this patch in mainline or drm-misc-next, did it get lost?
> > 
> > cheers
> > 
> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
> > > > While working at fixing powerpc headers, I ended up with the
> > > > following error.
> > > > 
> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
> > > > error:
> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
> > > > const
> > > > char *)'
> > > >         make[5]: *** [scripts/Makefile.build:288:
> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
> > > > 
> > > > powerpc and a few other architectures have a prom_init() global
> > > > function.
> > > > One day or another it will conflict with the one in shadowrom.c
> > > > 
> > > > Those being static, they can easily be renamed. Do it.
> > > > 
> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
> > > > 'nvbios_rom' in order to make it clear that it refers to the
> > > > NV_PROM device.
> > > > 
> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > > > ---
> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
> > > > name
> > > > to keep things consistant.
> > > > 
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
> > > > -
> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > index fac1bff1311b..cfa8a0c356dd 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
> > > >  int nvbios_shadow(struct nvkm_bios *);
> > > >  
> > > > -extern const struct nvbios_source nvbios_rom;
> > > > +extern const struct nvbios_source nvbios_prom;
> > > >  extern const struct nvbios_source nvbios_ramin;
> > > >  extern const struct nvbios_source nvbios_acpi_fast;
> > > >  extern const struct nvbios_source nvbios_acpi_slow;
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > index 4b571cc6bc70..19188683c8fc 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
> > > >         struct shadow mthds[] = {
> > > >                 { 0, &nvbios_of },
> > > >                 { 0, &nvbios_ramin },
> > > > -               { 0, &nvbios_rom },
> > > > +               { 0, &nvbios_prom },
> > > >                 { 0, &nvbios_acpi_fast },
> > > >                 { 4, &nvbios_acpi_slow },
> > > >                 { 1, &nvbios_pcirom },
> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > index ffa4b395220a..39144ceb117b 100644
> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
> > > > @@ -25,7 +25,7 @@
> > > >  #include <subdev/pci.h>
> > > >  
> > > >  static u32
> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
> > > > *bios)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         u32 i;
> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
> > > > struct
> > > > nvkm_bios *bios)
> > > >  }
> > > >  
> > > >  static void
> > > > -prom_fini(void *data)
> > > > +nvbios_prom_fini(void *data)
> > > >  {
> > > >         struct nvkm_device *device = data;
> > > >         nvkm_pci_rom_shadow(device->pci, true);
> > > >  }
> > > >  
> > > >  static void *
> > > > -prom_init(struct nvkm_bios *bios, const char *name)
> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
> > > >  {
> > > >         struct nvkm_device *device = bios->subdev.device;
> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
> > > > *name)
> > > >  }
> > > >  
> > > >  const struct nvbios_source
> > > > -nvbios_rom = {
> > > > +nvbios_prom = {
> > > >         .name = "PROM",
> > > > -       .init = prom_init,
> > > > -       .fini = prom_fini,
> > > > -       .read = prom_read,
> > > > +       .init = nvbios_prom_init,
> > > > +       .fini = nvbios_prom_fini,
> > > > +       .read = nvbios_prom_read,
> > > >         .rw = false,
> > > >  };
> > > 
> > > -- 
> > > Cheers,
> > >  Lyude Paul (she/her)
> > >  Software Engineer at Red Hat
> > 
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
  2022-06-08 20:51         ` [Nouveau] " Lyude Paul
  (?)
@ 2022-06-17  7:08           ` Michael Ellerman
  -1 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-17  7:08 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel

Lyude Paul <lyude@redhat.com> writes:
> Alright, dim's pushing it now. sorry about that!

Thanks, I see it in linux-next now.

cheers

> On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
>> Whoops, it totally may have. Thank you for the reminder, I will double check
>> and make sure this gets pushed today
>> 
>> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
>> > Lyude Paul <lyude@redhat.com> writes:
>> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
>> > > 
>> > > Will push to drm-misc-next
>> > 
>> > I don't see this patch in mainline or drm-misc-next, did it get lost?
>> > 
>> > cheers
>> > 
>> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> > > > While working at fixing powerpc headers, I ended up with the
>> > > > following error.
>> > > > 
>> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
>> > > > error:
>> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
>> > > > const
>> > > > char *)'
>> > > >         make[5]: *** [scripts/Makefile.build:288:
>> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> > > > 
>> > > > powerpc and a few other architectures have a prom_init() global
>> > > > function.
>> > > > One day or another it will conflict with the one in shadowrom.c
>> > > > 
>> > > > Those being static, they can easily be renamed. Do it.
>> > > > 
>> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
>> > > > 'nvbios_rom' in order to make it clear that it refers to the
>> > > > NV_PROM device.
>> > > > 
>> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> > > > ---
>> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
>> > > > name
>> > > > to keep things consistant.
>> > > > 
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
>> > > > -
>> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
>> > > > 
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > index fac1bff1311b..cfa8a0c356dd 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
>> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
>> > > >  int nvbios_shadow(struct nvkm_bios *);
>> > > >  
>> > > > -extern const struct nvbios_source nvbios_rom;
>> > > > +extern const struct nvbios_source nvbios_prom;
>> > > >  extern const struct nvbios_source nvbios_ramin;
>> > > >  extern const struct nvbios_source nvbios_acpi_fast;
>> > > >  extern const struct nvbios_source nvbios_acpi_slow;
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > index 4b571cc6bc70..19188683c8fc 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>> > > >         struct shadow mthds[] = {
>> > > >                 { 0, &nvbios_of },
>> > > >                 { 0, &nvbios_ramin },
>> > > > -               { 0, &nvbios_rom },
>> > > > +               { 0, &nvbios_prom },
>> > > >                 { 0, &nvbios_acpi_fast },
>> > > >                 { 4, &nvbios_acpi_slow },
>> > > >                 { 1, &nvbios_pcirom },
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > index ffa4b395220a..39144ceb117b 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > @@ -25,7 +25,7 @@
>> > > >  #include <subdev/pci.h>
>> > > >  
>> > > >  static u32
>> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> > > > *bios)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         u32 i;
>> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
>> > > > struct
>> > > > nvkm_bios *bios)
>> > > >  }
>> > > >  
>> > > >  static void
>> > > > -prom_fini(void *data)
>> > > > +nvbios_prom_fini(void *data)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         nvkm_pci_rom_shadow(device->pci, true);
>> > > >  }
>> > > >  
>> > > >  static void *
>> > > > -prom_init(struct nvkm_bios *bios, const char *name)
>> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>> > > >  {
>> > > >         struct nvkm_device *device = bios->subdev.device;
>> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
>> > > > *name)
>> > > >  }
>> > > >  
>> > > >  const struct nvbios_source
>> > > > -nvbios_rom = {
>> > > > +nvbios_prom = {
>> > > >         .name = "PROM",
>> > > > -       .init = prom_init,
>> > > > -       .fini = prom_fini,
>> > > > -       .read = prom_read,
>> > > > +       .init = nvbios_prom_init,
>> > > > +       .fini = nvbios_prom_fini,
>> > > > +       .read = nvbios_prom_read,
>> > > >         .rw = false,
>> > > >  };
>> > > 
>> > > -- 
>> > > Cheers,
>> > >  Lyude Paul (she/her)
>> > >  Software Engineer at Red Hat
>> > 
>> 
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

* Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-17  7:08           ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-17  7:08 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Lyude Paul <lyude@redhat.com> writes:
> Alright, dim's pushing it now. sorry about that!

Thanks, I see it in linux-next now.

cheers

> On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
>> Whoops, it totally may have. Thank you for the reminder, I will double check
>> and make sure this gets pushed today
>> 
>> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
>> > Lyude Paul <lyude@redhat.com> writes:
>> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
>> > > 
>> > > Will push to drm-misc-next
>> > 
>> > I don't see this patch in mainline or drm-misc-next, did it get lost?
>> > 
>> > cheers
>> > 
>> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> > > > While working at fixing powerpc headers, I ended up with the
>> > > > following error.
>> > > > 
>> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
>> > > > error:
>> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
>> > > > const
>> > > > char *)'
>> > > >         make[5]: *** [scripts/Makefile.build:288:
>> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> > > > 
>> > > > powerpc and a few other architectures have a prom_init() global
>> > > > function.
>> > > > One day or another it will conflict with the one in shadowrom.c
>> > > > 
>> > > > Those being static, they can easily be renamed. Do it.
>> > > > 
>> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
>> > > > 'nvbios_rom' in order to make it clear that it refers to the
>> > > > NV_PROM device.
>> > > > 
>> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> > > > ---
>> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
>> > > > name
>> > > > to keep things consistant.
>> > > > 
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
>> > > > -
>> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
>> > > > 
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > index fac1bff1311b..cfa8a0c356dd 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
>> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
>> > > >  int nvbios_shadow(struct nvkm_bios *);
>> > > >  
>> > > > -extern const struct nvbios_source nvbios_rom;
>> > > > +extern const struct nvbios_source nvbios_prom;
>> > > >  extern const struct nvbios_source nvbios_ramin;
>> > > >  extern const struct nvbios_source nvbios_acpi_fast;
>> > > >  extern const struct nvbios_source nvbios_acpi_slow;
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > index 4b571cc6bc70..19188683c8fc 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>> > > >         struct shadow mthds[] = {
>> > > >                 { 0, &nvbios_of },
>> > > >                 { 0, &nvbios_ramin },
>> > > > -               { 0, &nvbios_rom },
>> > > > +               { 0, &nvbios_prom },
>> > > >                 { 0, &nvbios_acpi_fast },
>> > > >                 { 4, &nvbios_acpi_slow },
>> > > >                 { 1, &nvbios_pcirom },
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > index ffa4b395220a..39144ceb117b 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > @@ -25,7 +25,7 @@
>> > > >  #include <subdev/pci.h>
>> > > >  
>> > > >  static u32
>> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> > > > *bios)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         u32 i;
>> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
>> > > > struct
>> > > > nvkm_bios *bios)
>> > > >  }
>> > > >  
>> > > >  static void
>> > > > -prom_fini(void *data)
>> > > > +nvbios_prom_fini(void *data)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         nvkm_pci_rom_shadow(device->pci, true);
>> > > >  }
>> > > >  
>> > > >  static void *
>> > > > -prom_init(struct nvkm_bios *bios, const char *name)
>> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>> > > >  {
>> > > >         struct nvkm_device *device = bios->subdev.device;
>> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
>> > > > *name)
>> > > >  }
>> > > >  
>> > > >  const struct nvbios_source
>> > > > -nvbios_rom = {
>> > > > +nvbios_prom = {
>> > > >         .name = "PROM",
>> > > > -       .init = prom_init,
>> > > > -       .fini = prom_fini,
>> > > > -       .read = prom_read,
>> > > > +       .init = nvbios_prom_init,
>> > > > +       .fini = nvbios_prom_fini,
>> > > > +       .read = nvbios_prom_read,
>> > > >         .rw = false,
>> > > >  };
>> > > 
>> > > -- 
>> > > Cheers,
>> > >  Lyude Paul (she/her)
>> > >  Software Engineer at Red Hat
>> > 
>> 
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

* Re: [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
@ 2022-06-17  7:08           ` Michael Ellerman
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Ellerman @ 2022-06-17  7:08 UTC (permalink / raw)
  To: Lyude Paul, Christophe Leroy, Ben Skeggs, Karol Herbst,
	David Airlie, Daniel Vetter
  Cc: nouveau, linux-kernel, dri-devel

Lyude Paul <lyude@redhat.com> writes:
> Alright, dim's pushing it now. sorry about that!

Thanks, I see it in linux-next now.

cheers

> On Wed, 2022-06-08 at 16:48 -0400, Lyude Paul wrote:
>> Whoops, it totally may have. Thank you for the reminder, I will double check
>> and make sure this gets pushed today
>> 
>> On Tue, 2022-06-07 at 23:00 +1000, Michael Ellerman wrote:
>> > Lyude Paul <lyude@redhat.com> writes:
>> > > Reviewed-by: Lyude Paul <lyude@redhat.com>
>> > > 
>> > > Will push to drm-misc-next
>> > 
>> > I don't see this patch in mainline or drm-misc-next, did it get lost?
>> > 
>> > cheers
>> > 
>> > > On Sat, 2022-03-19 at 11:27 +0100, Christophe Leroy wrote:
>> > > > While working at fixing powerpc headers, I ended up with the
>> > > > following error.
>> > > > 
>> > > >         drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1:
>> > > > error:
>> > > > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *,
>> > > > const
>> > > > char *)'
>> > > >         make[5]: *** [scripts/Makefile.build:288:
>> > > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1
>> > > > 
>> > > > powerpc and a few other architectures have a prom_init() global
>> > > > function.
>> > > > One day or another it will conflict with the one in shadowrom.c
>> > > > 
>> > > > Those being static, they can easily be renamed. Do it.
>> > > > 
>> > > > While at it, also rename the ops structure as 'nvbios_prom' instead of
>> > > > 'nvbios_rom' in order to make it clear that it refers to the
>> > > > NV_PROM device.
>> > > > 
>> > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> > > > ---
>> > > > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure
>> > > > name
>> > > > to keep things consistant.
>> > > > 
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h    |  2 +-
>> > > >  drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c  |  2 +-
>> > > >  .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c   | 14 +++++++------
>> > > > -
>> > > >  3 files changed, 9 insertions(+), 9 deletions(-)
>> > > > 
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > index fac1bff1311b..cfa8a0c356dd 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
>> > > > @@ -19,7 +19,7 @@ struct nvbios_source {
>> > > >  int nvbios_extend(struct nvkm_bios *, u32 length);
>> > > >  int nvbios_shadow(struct nvkm_bios *);
>> > > >  
>> > > > -extern const struct nvbios_source nvbios_rom;
>> > > > +extern const struct nvbios_source nvbios_prom;
>> > > >  extern const struct nvbios_source nvbios_ramin;
>> > > >  extern const struct nvbios_source nvbios_acpi_fast;
>> > > >  extern const struct nvbios_source nvbios_acpi_slow;
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > index 4b571cc6bc70..19188683c8fc 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
>> > > > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios)
>> > > >         struct shadow mthds[] = {
>> > > >                 { 0, &nvbios_of },
>> > > >                 { 0, &nvbios_ramin },
>> > > > -               { 0, &nvbios_rom },
>> > > > +               { 0, &nvbios_prom },
>> > > >                 { 0, &nvbios_acpi_fast },
>> > > >                 { 4, &nvbios_acpi_slow },
>> > > >                 { 1, &nvbios_pcirom },
>> > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > index ffa4b395220a..39144ceb117b 100644
>> > > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
>> > > > @@ -25,7 +25,7 @@
>> > > >  #include <subdev/pci.h>
>> > > >  
>> > > >  static u32
>> > > > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
>> > > > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios
>> > > > *bios)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         u32 i;
>> > > > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length,
>> > > > struct
>> > > > nvkm_bios *bios)
>> > > >  }
>> > > >  
>> > > >  static void
>> > > > -prom_fini(void *data)
>> > > > +nvbios_prom_fini(void *data)
>> > > >  {
>> > > >         struct nvkm_device *device = data;
>> > > >         nvkm_pci_rom_shadow(device->pci, true);
>> > > >  }
>> > > >  
>> > > >  static void *
>> > > > -prom_init(struct nvkm_bios *bios, const char *name)
>> > > > +nvbios_prom_init(struct nvkm_bios *bios, const char *name)
>> > > >  {
>> > > >         struct nvkm_device *device = bios->subdev.device;
>> > > >         if (device->card_type == NV_40 && device->chipset >= 0x4c)
>> > > > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char
>> > > > *name)
>> > > >  }
>> > > >  
>> > > >  const struct nvbios_source
>> > > > -nvbios_rom = {
>> > > > +nvbios_prom = {
>> > > >         .name = "PROM",
>> > > > -       .init = prom_init,
>> > > > -       .fini = prom_fini,
>> > > > -       .read = prom_read,
>> > > > +       .init = nvbios_prom_init,
>> > > > +       .fini = nvbios_prom_fini,
>> > > > +       .read = nvbios_prom_read,
>> > > >         .rw = false,
>> > > >  };
>> > > 
>> > > -- 
>> > > Cheers,
>> > >  Lyude Paul (she/her)
>> > >  Software Engineer at Red Hat
>> > 
>> 
>
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat

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

end of thread, other threads:[~2022-06-17  7:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19 10:27 [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions Christophe Leroy
2022-03-19 10:27 ` [Nouveau] " Christophe Leroy
2022-03-19 10:27 ` Christophe Leroy
2022-03-22 18:25 ` Lyude Paul
2022-03-22 18:25   ` Lyude Paul
2022-03-22 18:25   ` [Nouveau] " Lyude Paul
2022-06-07 13:00   ` Michael Ellerman
2022-06-07 13:00     ` Michael Ellerman
2022-06-07 13:00     ` [Nouveau] " Michael Ellerman
2022-06-08 20:48     ` Lyude Paul
2022-06-08 20:48       ` Lyude Paul
2022-06-08 20:48       ` [Nouveau] " Lyude Paul
2022-06-08 20:51       ` Lyude Paul
2022-06-08 20:51         ` Lyude Paul
2022-06-08 20:51         ` [Nouveau] " Lyude Paul
2022-06-17  7:08         ` Michael Ellerman
2022-06-17  7:08           ` Michael Ellerman
2022-06-17  7:08           ` [Nouveau] " Michael Ellerman
2022-03-22 18:43 ` Tommaso Merciai
2022-03-22 18:43   ` [Nouveau] " Tommaso Merciai
2022-03-22 18:43   ` Tommaso Merciai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.