mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
c7e09a613b
'struct ccu_reset_map' are not modified in these drivers. 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 1533 2224 0 3757 ead drivers/clk/sunxi-ng/ccu-sun20i-d1-r.o After: ===== text data bss dec hex filename 1597 2160 0 3757 ead drivers/clk/sunxi-ng/ccu-sun20i-d1-r.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/44745f27034fa670605cd16966a39b7fe88fe5a6.1726863905.git.christophe.jaillet@wanadoo.fr Signed-off-by: Chen-Yu Tsai <wens@csie.org>
34 lines
639 B
C
34 lines
639 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2016 Maxime Ripard. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _CCU_RESET_H_
|
|
#define _CCU_RESET_H_
|
|
|
|
#include <linux/reset-controller.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
struct ccu_reset_map {
|
|
u16 reg;
|
|
u32 bit;
|
|
};
|
|
|
|
|
|
struct ccu_reset {
|
|
void __iomem *base;
|
|
const struct ccu_reset_map *reset_map;
|
|
spinlock_t *lock;
|
|
|
|
struct reset_controller_dev rcdev;
|
|
};
|
|
|
|
static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
|
|
{
|
|
return container_of(rcdev, struct ccu_reset, rcdev);
|
|
}
|
|
|
|
extern const struct reset_control_ops ccu_reset_ops;
|
|
|
|
#endif /* _CCU_RESET_H_ */
|