Re: [PATCH] drm/amdgpu: Constify some tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24 April 2016 at 18:31, Christian König <deathsimple@xxxxxxxxxxx> wrote:
> Am 24.04.2016 um 13:55 schrieb Nils Wallménius:
>>
>> Some more tables with constant data were added with the polaris support
>>
>> Signed-off-by: Nils Wallménius <nils.wallmenius@xxxxxxxxx>
>
>
> Acked-by: Christian König <christian.koenig@xxxxxxx>
>
> BTW: Do you find those with some kind of automated tool? Would be nice to
> fix those before we make the patches public as well.
>
For symbols already declared static one can use the following:

$ git grep "static .*\[.*\] *= *{"  | grep -v -w const

For ones that are not - the compiler should give you a nice warning
already (-Wimplicit) if it doesn't you can use the following

$ git grep "\[.*\] *= *{"  | egrep -v -w "const|static"
$ grep + filecount == 1 -> declare static. use the top rule.

If your code does not use trailing {, just replace with with $.

In either case human interaction is needed, as the compiler will
kindly warn when someone (struct which parents these or function that
uses them) discards the const qualifier.

-Emil
P.S. Cool thing is that most drivers are almost OK (nouveau does stand
out with ~600 non static & non const symbols)
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux