Skip to content
Commit 52cf25d0 authored by Emese Revfy's avatar Emese Revfy Committed by Greg Kroah-Hartman
Browse files

Driver core: Constify struct sysfs_ops in struct kobj_type



Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

 * prevents modification of data that is shared
   (referenced) by many other structure instances
   at runtime

 * detects/prevents accidental (but not intentional)
   modification attempts on archs that enforce
   read-only kernel data at runtime

 * potentially better optimized code as the compiler
   can assume that the const data cannot be changed

 * the compiler/linker move const data into .rodata
   and therefore exclude them from false sharing

Signed-off-by: default avatarEmese Revfy <re.emese@gmail.com>
Acked-by: default avatarDavid Teigland <teigland@redhat.com>
Acked-by: default avatarMatt Domsch <Matt_Domsch@dell.com>
Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: default avatarHans J. Koch <hjk@linutronix.de>
Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
Acked-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6c1733ac
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment