mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
c4610f6e1d
Check for attribute_group structures that are only passed as a second argument to the functions sysfs_remove_group and sysfs_create_group. As these arguments are constant so, attribute_group structures having this property can also be made constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; expression e1; @@ ( sysfs_remove_group(e1,&i@p) | sysfs_create_group(e1,&i@p) ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 7551 1440 16 9007 232f drivers/staging/speakup/kobjects.o File size after: text data bss dec hex filename 7671 1312 16 8999 2327 drivers/staging/speakup/kobjects.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
---|---|---|
.. | ||
buffers.c | ||
DefaultKeyAssignments | ||
devsynth.c | ||
fakekey.c | ||
i18n.c | ||
i18n.h | ||
Kconfig | ||
keyhelp.c | ||
kobjects.c | ||
main.c | ||
Makefile | ||
selection.c | ||
serialio.c | ||
serialio.h | ||
speakup_acnt.h | ||
speakup_acntpc.c | ||
speakup_acntsa.c | ||
speakup_apollo.c | ||
speakup_audptr.c | ||
speakup_bns.c | ||
speakup_decext.c | ||
speakup_decpc.c | ||
speakup_dectlk.c | ||
speakup_dtlk.c | ||
speakup_dtlk.h | ||
speakup_dummy.c | ||
speakup_keypc.c | ||
speakup_ltlk.c | ||
speakup_soft.c | ||
speakup_spkout.c | ||
speakup_txprt.c | ||
speakup.h | ||
speakupmap.h | ||
speakupmap.map | ||
spk_priv_keyinfo.h | ||
spk_priv.h | ||
spk_types.h | ||
spkguide.txt | ||
synth.c | ||
thread.c | ||
TODO | ||
varhandlers.c |