2017-08-23 16:15:21

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH] gpio: pl061: constify amba_id

amba_id are not supposed to change at runtime. All functions
working with const amba_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/gpio/gpio-pl061.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 3d3d6b6..6aaaab7 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -405,7 +405,7 @@ static const struct dev_pm_ops pl061_dev_pm_ops = {
};
#endif

-static struct amba_id pl061_ids[] = {
+static const struct amba_id pl061_ids[] = {
{
.id = 0x00041061,
.mask = 0x000fffff,
--
2.7.4


2017-08-23 16:16:17

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH] drm: pl111: constify amba_id

amba_id are not supposed to change at runtime. All functions
working with const amba_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ac8771b..522875c 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -243,7 +243,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
return 0;
}

-static struct amba_id pl111_id_table[] = {
+static const struct amba_id pl111_id_table[] = {
{
.id = 0x00041111,
.mask = 0x000fffff,
--
2.7.4

2017-08-31 11:58:25

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpio: pl061: constify amba_id

On Wed, Aug 23, 2017 at 6:15 PM, Arvind Yadav <[email protected]> wrote:

> amba_id are not supposed to change at runtime. All functions
> working with const amba_id. So mark the non-const structs as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>

Patch applied.

Yours,
Linus Walleij

2017-09-18 17:28:58

by Eric Anholt

[permalink] [raw]
Subject: Re: [PATCH] drm: pl111: constify amba_id

Arvind Yadav <[email protected]> writes:

> amba_id are not supposed to change at runtime. All functions
> working with const amba_id. So mark the non-const structs as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---
> drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
> index ac8771b..522875c 100644
> --- a/drivers/gpu/drm/pl111/pl111_drv.c
> +++ b/drivers/gpu/drm/pl111/pl111_drv.c
> @@ -243,7 +243,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
> return 0;
> }
>
> -static struct amba_id pl111_id_table[] = {
> +static const struct amba_id pl111_id_table[] = {
> {
> .id = 0x00041111,
> .mask = 0x000fffff,
> --
> 2.7.4

Sorry about dropping your patch here -- Linus was working on a bigger
series for pl110 support that also happened to fix this.


Attachments:
signature.asc (832.00 B)