mirror of
https://github.com/torvalds/linux.git
synced 2024-12-06 02:52:22 +00:00
177267a950
These videobuf_queue_ops structures are only passed as the second argument to videobuf_queue_vmalloc_init, which is declared as const. Thus the videobuf_queue_ops structures themselves can be const. Done with the help of Coccinelle. // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct videobuf_queue_ops i@p = { ... }; @ok1@ identifier r.i; expression e1; position p; @@ videobuf_queue_vmalloc_init(e1,&i@p,...) @bad@ position p != {r.p,ok1.p}; identifier r.i; struct videobuf_queue_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct videobuf_queue_ops i = { ... }; // </smpl> In the first case, there is a second commented call to videobuf_queue_sg_init with the structure as the second argument. If that code will be uncommented, the const will remain correct, because the second parameter of that function is also const. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> |
||
---|---|---|
.. | ||
cx231xx-417.c | ||
cx231xx-audio.c | ||
cx231xx-avcore.c | ||
cx231xx-cards.c | ||
cx231xx-conf-reg.h | ||
cx231xx-core.c | ||
cx231xx-dif.h | ||
cx231xx-dvb.c | ||
cx231xx-i2c.c | ||
cx231xx-input.c | ||
cx231xx-pcb-cfg.c | ||
cx231xx-pcb-cfg.h | ||
cx231xx-reg.h | ||
cx231xx-vbi.c | ||
cx231xx-vbi.h | ||
cx231xx-video.c | ||
cx231xx.h | ||
Kconfig | ||
Makefile |