summaryrefslogtreecommitdiffstats
path: root/scripts/const_structs.checkpatch
Commit message (Collapse)AuthorAgeFilesLines
* const_structs.checkpatch: add device_typeRicardo B. Marliere2024-03-061-0/+1
| | | | | | | | | | | | Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Make sure that new usages of the struct already enter the tree as const. Link: https://lkml.kernel.org/r/20240218-device_cleanup-checkpatch-v1-1-8b0b89c4f6b1@marliere.net Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* const_structs.checkpatch: add bus_typeRicardo B. Marliere2024-02-221-0/+1
| | | | | | | | | | | | | | | | | Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type. Make sure that new usages of the struct already enter the tree as const. Link: https://lkml.kernel.org/r/20240204-bus_cleanup-checkpatch-v1-1-8d51dcecda20@marliere.net Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Suggested-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* const_structs.checkpatch: add xattr_handlerThomas Weißschuh2023-10-121-0/+1
| | | | | | | | | | Now that the vfs can handle "const struct xattr_handler" make sure that new usages of the struct already enter the tree as const. Link: https://lore.kernel.org/lkml/20230930050033.41174-1-wedsonaf@gmail.com/ Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20231012-vfs-xattr_const-v1-1-6c21e82d4d5e@weissschuh.net Signed-off-by: Christian Brauner <brauner@kernel.org>
* const_structs.checkpatch.pl: add kobj_typeThomas Weißschuh2023-02-081-0/+1
| | | | | | | | | Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230204-kobj_type-checkpatch-v1-1-9a94b04adbb2@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* const_structs.checkpatch: add frequently used ops structsRikard Falkeborn2022-01-201-0/+23
| | | | | | | | | | | Add commonly used structs (>50 instances) which are always or almost always const. Link: https://lkml.kernel.org/r/20211127101134.33101-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const_structs.checkpatch: add a few sound ops structsRikard Falkeborn2021-11-091-0/+4
| | | | | | | | | | | | | | | Add a couple of commonly used (>50 instances) sound ops structs that are typically const. Link: https://lkml.kernel.org/r/20210922211042.38017-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const_structs.checkpatch: add pinctrl_ops and pinmux_opsRikard Falkeborn2020-10-161-0/+2
| | | | | | | | | | | | | | | | All usages of include/linux of these are const pointers, and all instances in the kernel except one, that are not const can be made const (patches have been posted for those separately). Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Cc: Joe Perches <joe@perches.com> Cc: Andreas Färber <afaerber@suse.de> Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lkml.kernel.org/r/20200830224352.37114-1-rikard.falkeborn@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const_structs.checkpatch: add phy_opsRikard Falkeborn2020-10-161-0/+1
| | | | | | | | | | | | | | All usages of phy_ops in include/linux uses const phy_ops * and all instances of phy_ops in the kernel that are not const already can be made const (patches have been posted for those separately). Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Vinod Koul <vkoul@kernel.org> Link: https://lkml.kernel.org/r/20200824214132.9072-1-rikard.falkeborn@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const_structs.checkpatch: add regulator_opsJoe Perches2020-08-071-0/+1
| | | | | | | | | | | | | | | | Add regulator_ops to expected to be const list. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Pi-Hsun Shih <pihsun@chromium.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Benson Leung <bleung@chromium.org> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Cc: Guenter Roeck <groeck@chromium.org> Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: http://lkml.kernel.org/r/dab1ba1aa03a8236933cfb7a28937efb0b808f13.camel@perches.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const_structs.checkpatch: add frequently used from Julia Lawall's listJoe Perches2016-10-111-0/+25
| | | | | | | | | | | | | | | | | | | | Using const is generally a good idea. Julia Lawall has created a list of always const and almost always const structs in the kernel sources. Link: https://lkml.org/lkml/2016/8/28/95 Add the most frequently used (> 50 cases) that are almost always or always const. Link: http://lkml.kernel.org/r/1e16020f8027654db0095bbfbcc11da51025365c.1472664220.git.joe@perches.com Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Kees Cook <keescook@chromium.org> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* checkpatch: externalize the structs that should be constJoe Perches2016-10-111-0/+39
Make it easier to add new structs that should be const. Link: http://lkml.kernel.org/r/e5a8da43e7c11525bafbda1ca69a8323614dd942.1472664220.git.joe@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: Kees Cook <keescook@chromium.org> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>