• Julia Lawall's avatar
    powerpc/macintosh: constify wf_sensor_ops structures · de854e54
    Julia Lawall authored
    The wf_sensor_ops structures are only stored in the ops field of a
    wf_sensor structure, which is declared as const.  Thus the
    wf_sensor_ops structures themselves can be const.
    Done with the help of Coccinelle.
    // <smpl>
    @r disable optional_qualifier@
    identifier i;
    position p;
    static struct wf_sensor_ops i@p = { ... };
    identifier r.i;
    struct wf_sensor s;
    position p;
    s.ops = &i@p
    identifier r.i;
    struct wf_sat_sensor s;
    position p;
    s.sens.ops = &i@p
    position p != {r.p,ok1.p,ok2.p};
    identifier r.i;
    struct wf_sensor_ops e;
    @depends on !bad disable optional_qualifier@
    identifier r.i;
     struct wf_sensor_ops i = { ... };
    // </smpl>
    Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
windfarm_lm75_sensor.c 4 KB