linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] powercap/drivers/dtpm: Constify static ops structs
@ 2021-12-02 14:37 Rikard Falkeborn
  2021-12-02 14:37 ` [PATCH 1/2] powercap/drivers/dtpm: Constify powercap_zone_{,constraint_}ops Rikard Falkeborn
  2021-12-02 14:37 ` [PATCH 2/2] powercap/drivers/dtpm: Constify dtpm_ops Rikard Falkeborn
  0 siblings, 2 replies; 3+ messages in thread
From: Rikard Falkeborn @ 2021-12-02 14:37 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J. Wysocki
  Cc: linux-pm, linux-kernel, Rikard Falkeborn

Constify a couple of static ops structs that are never modified, to allow
the compiler to put them in read-only memory.

The first patch constifies one powercap_zone_constraint_ops and one
powercap_zone_ops. These are only passed to powercap_register_zone()
which accepts const pointers.

The second patch constifies dtpm_ops. In order to do that, we need to add
const to an init function and in the dtpm struct, which is ok since noone
modifies the struct.

Rikard Falkeborn (2):
  powercap/drivers/dtpm: Constify powercap_zone_{,constraint_}ops
  powercap/drivers/dtpm: Constify dtpm_ops

 drivers/powercap/dtpm.c     | 6 +++---
 drivers/powercap/dtpm_cpu.c | 2 +-
 include/linux/dtpm.h        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-02 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 14:37 [PATCH 0/2] powercap/drivers/dtpm: Constify static ops structs Rikard Falkeborn
2021-12-02 14:37 ` [PATCH 1/2] powercap/drivers/dtpm: Constify powercap_zone_{,constraint_}ops Rikard Falkeborn
2021-12-02 14:37 ` [PATCH 2/2] powercap/drivers/dtpm: Constify dtpm_ops Rikard Falkeborn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).