* [PATCH] drm/hisilicon: Adding a const declaration to an invariant construct
@ 2020-10-29 7:11 ` Tian Tao
0 siblings, 0 replies; 4+ messages in thread
From: Tian Tao @ 2020-10-29 7:11 UTC (permalink / raw)
To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
dri-devel, xinliang.liu, linux-kernel
Some constructs cannot be changed after being assigned a value,
so add const declarations to invariant constructs.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 2 +-
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
index a1eabad..ef18b47 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
@@ -139,7 +139,7 @@ static const u32 channel_formats1[] = {
DRM_FORMAT_ABGR8888
};
-static struct drm_plane_funcs hibmc_plane_funcs = {
+static const struct drm_plane_funcs hibmc_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 0c1b40d..fee6fe8 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -369,7 +369,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
drm_dev_put(dev);
}
-static struct pci_device_id hibmc_pci_table[] = {
+static const struct pci_device_id hibmc_pci_table[] = {
{ PCI_VDEVICE(HUAWEI, 0x1711) },
{0,}
};
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/hisilicon: Adding a const declaration to an invariant construct
@ 2020-10-29 7:11 ` Tian Tao
0 siblings, 0 replies; 4+ messages in thread
From: Tian Tao @ 2020-10-29 7:11 UTC (permalink / raw)
To: airlied, daniel, tzimmermann, kraxel, alexander.deucher, tglx,
dri-devel, xinliang.liu, linux-kernel
Some constructs cannot be changed after being assigned a value,
so add const declarations to invariant constructs.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 2 +-
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
index a1eabad..ef18b47 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
@@ -139,7 +139,7 @@ static const u32 channel_formats1[] = {
DRM_FORMAT_ABGR8888
};
-static struct drm_plane_funcs hibmc_plane_funcs = {
+static const struct drm_plane_funcs hibmc_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 0c1b40d..fee6fe8 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -369,7 +369,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
drm_dev_put(dev);
}
-static struct pci_device_id hibmc_pci_table[] = {
+static const struct pci_device_id hibmc_pci_table[] = {
{ PCI_VDEVICE(HUAWEI, 0x1711) },
{0,}
};
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/hisilicon: Adding a const declaration to an invariant construct
2020-10-29 7:11 ` Tian Tao
@ 2020-10-29 19:13 ` Thomas Zimmermann
-1 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2020-10-29 19:13 UTC (permalink / raw)
To: Tian Tao, airlied, daniel, kraxel, alexander.deucher, tglx,
dri-devel, xinliang.liu, linux-kernel
[-- Attachment #1.1.1: Type: text/plain, Size: 1821 bytes --]
Hi
Am 29.10.20 um 08:11 schrieb Tian Tao:
> Some constructs cannot be changed after being assigned a value,
> so add const declarations to invariant constructs.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 2 +-
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> index a1eabad..ef18b47 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> @@ -139,7 +139,7 @@ static const u32 channel_formats1[] = {
> DRM_FORMAT_ABGR8888
> };
>
> -static struct drm_plane_funcs hibmc_plane_funcs = {
> +static const struct drm_plane_funcs hibmc_plane_funcs = {
> .update_plane = drm_atomic_helper_update_plane,
> .disable_plane = drm_atomic_helper_disable_plane,
> .destroy = drm_plane_cleanup,
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 0c1b40d..fee6fe8 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -369,7 +369,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
> drm_dev_put(dev);
> }
>
> -static struct pci_device_id hibmc_pci_table[] = {
> +static const struct pci_device_id hibmc_pci_table[] = {
> { PCI_VDEVICE(HUAWEI, 0x1711) },
> {0,}
> };
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.1.2: OpenPGP_0x680DC11D530B7A23.asc --]
[-- Type: application/pgp-keys, Size: 4259 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/hisilicon: Adding a const declaration to an invariant construct
@ 2020-10-29 19:13 ` Thomas Zimmermann
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2020-10-29 19:13 UTC (permalink / raw)
To: Tian Tao, airlied, daniel, kraxel, alexander.deucher, tglx,
dri-devel, xinliang.liu, linux-kernel
[-- Attachment #1.1.1.1: Type: text/plain, Size: 1821 bytes --]
Hi
Am 29.10.20 um 08:11 schrieb Tian Tao:
> Some constructs cannot be changed after being assigned a value,
> so add const declarations to invariant constructs.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 2 +-
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> index a1eabad..ef18b47 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> @@ -139,7 +139,7 @@ static const u32 channel_formats1[] = {
> DRM_FORMAT_ABGR8888
> };
>
> -static struct drm_plane_funcs hibmc_plane_funcs = {
> +static const struct drm_plane_funcs hibmc_plane_funcs = {
> .update_plane = drm_atomic_helper_update_plane,
> .disable_plane = drm_atomic_helper_disable_plane,
> .destroy = drm_plane_cleanup,
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 0c1b40d..fee6fe8 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -369,7 +369,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
> drm_dev_put(dev);
> }
>
> -static struct pci_device_id hibmc_pci_table[] = {
> +static const struct pci_device_id hibmc_pci_table[] = {
> { PCI_VDEVICE(HUAWEI, 0x1711) },
> {0,}
> };
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.1.1.2: OpenPGP_0x680DC11D530B7A23.asc --]
[-- Type: application/pgp-keys, Size: 4259 bytes --]
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-29 19:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 7:11 [PATCH] drm/hisilicon: Adding a const declaration to an invariant construct Tian Tao
2020-10-29 7:11 ` Tian Tao
2020-10-29 19:13 ` Thomas Zimmermann
2020-10-29 19:13 ` Thomas Zimmermann
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.