suspend: constify platform_suspend_ops
While at it, fix two checkpatch errors.
Several non-const struct instances constified by this patch were added after
the introduction of platform_suspend_ops in checkpatch.pl's list of "should
be const" structs (79404849e9
).
Patch against mainline.
Inspired by hunks of the grsecurity patch, updated for newer kernels.
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:

committed by
Jiri Kosina

parent
acc2472ed3
commit
2f55ac072f
@@ -30,13 +30,13 @@ const char *const pm_states[PM_SUSPEND_MAX] = {
|
||||
[PM_SUSPEND_MEM] = "mem",
|
||||
};
|
||||
|
||||
static struct platform_suspend_ops *suspend_ops;
|
||||
static const struct platform_suspend_ops *suspend_ops;
|
||||
|
||||
/**
|
||||
* suspend_set_ops - Set the global suspend method table.
|
||||
* @ops: Pointer to ops structure.
|
||||
*/
|
||||
void suspend_set_ops(struct platform_suspend_ops *ops)
|
||||
void suspend_set_ops(const struct platform_suspend_ops *ops)
|
||||
{
|
||||
mutex_lock(&pm_mutex);
|
||||
suspend_ops = ops;
|
||||
|
Reference in New Issue
Block a user