'struct mmp_overlay_ops' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increase overall security.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
11798 555 16 12369 3051 drivers/video/fbdev/mmp/hw/mmp_ctrl.o
After:
=====
text data bss dec hex filename
11834 507 16 12357 3045 drivers/video/fbdev/mmp/hw/mmp_ctrl.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Helge Deller <deller@gmx.de>
mutex_unlock(&path->access_ok);
}
-static struct mmp_overlay_ops mmphw_overlay_ops = {
+static const struct mmp_overlay_ops mmphw_overlay_ops = {
.set_fetch = overlay_set_fetch,
.set_onoff = overlay_set_onoff,
.set_win = overlay_set_win,
int status;
struct mutex access_ok;
- struct mmp_overlay_ops *ops;
+ const struct mmp_overlay_ops *ops;
};
/* panel type */
int overlay_num;
void (*set_mode)(struct mmp_path *path, struct mmp_mode *mode);
void (*set_onoff)(struct mmp_path *path, int status);
- struct mmp_overlay_ops *overlay_ops;
+ const struct mmp_overlay_ops *overlay_ops;
void *plat_data;
};