mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] drm/tilcdc: add const to of_device_id
@ 2021-12-16  9:26 Xiang wangx
  2021-12-16  9:44 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Xiang wangx @ 2021-12-16  9:26 UTC (permalink / raw)
  To: jyri.sarha; +Cc: tomba, airlied, daniel, dri-devel, linux-kernel, Xiang wangx

struct of_device_id should normally be const.

Signed-off-by: Xiang wangx <wangxiang@cdjrlc.com>
---

Changes since v1
* add const in line 63

 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 3ddb7c710a3d..7c36ecd82ebc 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -60,7 +60,7 @@ void tilcdc_module_cleanup(struct tilcdc_module *mod)
 	list_del(&mod->list);
 }
 
-static struct of_device_id tilcdc_of_match[];
+static const struct of_device_id tilcdc_of_match[];
 
 static int tilcdc_atomic_check(struct drm_device *dev,
 			       struct drm_atomic_state *state)
@@ -587,7 +587,7 @@ static int tilcdc_pdev_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct of_device_id tilcdc_of_match[] = {
+static const struct of_device_id tilcdc_of_match[] = {
 		{ .compatible = "ti,am33xx-tilcdc", },
 		{ .compatible = "ti,da850-tilcdc", },
 		{ },
-- 
2.34.1


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

* Re: [PATCH v2] drm/tilcdc: add const to of_device_id
  2021-12-16  9:26 [PATCH v2] drm/tilcdc: add const to of_device_id Xiang wangx
@ 2021-12-16  9:44 ` Joe Perches
  2021-12-16 10:20   ` Jyri Sarha
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2021-12-16  9:44 UTC (permalink / raw)
  To: Xiang wangx, jyri.sarha; +Cc: tomba, airlied, daniel, dri-devel, linux-kernel

On Thu, 2021-12-16 at 17:26 +0800, Xiang wangx wrote:
> struct of_device_id should normally be const.
[]
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
[]
> @@ -60,7 +60,7 @@ void tilcdc_module_cleanup(struct tilcdc_module *mod)
>  	list_del(&mod->list);
>  }
>  
> -static struct of_device_id tilcdc_of_match[];
> +static const struct of_device_id tilcdc_of_match[];

This line could likely be removed instead.

$ git grep -w -n tilcdc_of_match
drivers/gpu/drm/tilcdc/tilcdc_drv.c:63:static struct of_device_id tilcdc_of_match[];
drivers/gpu/drm/tilcdc/tilcdc_drv.c:590:static struct of_device_id tilcdc_of_match[] = {
drivers/gpu/drm/tilcdc/tilcdc_drv.c:595:MODULE_DEVICE_TABLE(of, tilcdc_of_match);
drivers/gpu/drm/tilcdc/tilcdc_drv.c:603:                .of_match_table = tilcdc_of_match,

> @@ -587,7 +587,7 @@ static int tilcdc_pdev_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static struct of_device_id tilcdc_of_match[] = {
> +static const struct of_device_id tilcdc_of_match[] = {
>  		{ .compatible = "ti,am33xx-tilcdc", },
>  		{ .compatible = "ti,da850-tilcdc", },
>  		{ },



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

* Re: [PATCH v2] drm/tilcdc: add const to of_device_id
  2021-12-16  9:44 ` Joe Perches
@ 2021-12-16 10:20   ` Jyri Sarha
  0 siblings, 0 replies; 3+ messages in thread
From: Jyri Sarha @ 2021-12-16 10:20 UTC (permalink / raw)
  To: Joe Perches; +Cc: Xiang wangx, tomba, airlied, daniel, dri-devel, linux-kernel

On 2021-12-16 11:44, Joe Perches wrote:
> On Thu, 2021-12-16 at 17:26 +0800, Xiang wangx wrote:
>> struct of_device_id should normally be const.
> []
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
>> b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> []
>> @@ -60,7 +60,7 @@ void tilcdc_module_cleanup(struct tilcdc_module 
>> *mod)
>>  	list_del(&mod->list);
>>  }
>> 
>> -static struct of_device_id tilcdc_of_match[];
>> +static const struct of_device_id tilcdc_of_match[];
> 
> This line could likely be removed instead.
> 
> $ git grep -w -n tilcdc_of_match
> drivers/gpu/drm/tilcdc/tilcdc_drv.c:63:static struct of_device_id
> tilcdc_of_match[];
> drivers/gpu/drm/tilcdc/tilcdc_drv.c:590:static struct of_device_id
> tilcdc_of_match[] = {
> drivers/gpu/drm/tilcdc/tilcdc_drv.c:595:MODULE_DEVICE_TABLE(of,
> tilcdc_of_match);
> drivers/gpu/drm/tilcdc/tilcdc_drv.c:603:
> .of_match_table = tilcdc_of_match,
> 

Oh yes. It appears to have been there from day one and even then it was 
bogus.

Xiang Wang, could you produce one more version of the patch with the 
declaration removed.

Best regards,
Jyri

>> @@ -587,7 +587,7 @@ static int tilcdc_pdev_remove(struct 
>> platform_device *pdev)
>>  	return 0;
>>  }
>> 
>> -static struct of_device_id tilcdc_of_match[] = {
>> +static const struct of_device_id tilcdc_of_match[] = {
>>  		{ .compatible = "ti,am33xx-tilcdc", },
>>  		{ .compatible = "ti,da850-tilcdc", },
>>  		{ },

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

end of thread, other threads:[~2021-12-16 10:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  9:26 [PATCH v2] drm/tilcdc: add const to of_device_id Xiang wangx
2021-12-16  9:44 ` Joe Perches
2021-12-16 10:20   ` Jyri Sarha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®