Thread (2 messages) 2 messages, 2 authors, 2017-01-25

[PATCH] media: platform: constify vb2_ops structures

From: prabhakar.csengg@gmail.com (Lad, Prabhakar)
Date: 2017-01-25 10:09:20
Also in: linux-media, linux-mediatek, lkml

Hi,

Thanks for the patch.

On Sat, Jan 21, 2017 at 9:29 AM, Bhumika Goyal [off-list ref] wrote:
Declare vb2_ops structures as const as they are only stored in
the ops field of a vb2_queue structure. This field is of type
const, so vb2_ops structures having same properties can be made
const too.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct vb2_ops i at p={...};

@ok1@
identifier r1.i;
position p;
struct sta2x11_vip vip;
struct vb2_queue q;
@@
(
vip.vb_vidq.ops=&i at p
|
q.ops=&i at p
)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i at p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct vb2_ops i;

Cross compiled the media/platform/blackfin/bfin_capture.o file for
blackfin architecture.

File size before:
  text     data     bss     dec     hex filename
  6776      176       0    6952    1b28 platform/blackfin/bfin_capture.o
The description doesnt match the changes. Can you please split the
patches separately one for vpif_capture.c and vpif_display.c,
one for mtk_mdp_m2m.c and lastly for pxa_camera.c .


Cheers,
--Prabhakar Lad
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help