mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
mm: constify arguments in default pxdp_get()
Generic MM default pxdp_get() helpers fetch the values contained in pgtable entries via READ_ONCE() without modifying them. Just make their arguments explicitly 'const' for some additional protection. Link: https://lore.kernel.org/20260918064928.793742-1-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Suggested-by: David Hildenbrand <david@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> Reviewed-by: SJ Park <sj@kernel.org> Cc: Pedro Falcato <pfalcato@suse.de>
This commit is contained in:
parent
ebd1a08c19
commit
48bd5dc504
|
|
@ -490,35 +490,35 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
|
|||
#endif
|
||||
|
||||
#ifndef ptep_get
|
||||
static inline pte_t ptep_get(pte_t *ptep)
|
||||
static inline pte_t ptep_get(const pte_t *ptep)
|
||||
{
|
||||
return READ_ONCE(*ptep);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef pmdp_get
|
||||
static inline pmd_t pmdp_get(pmd_t *pmdp)
|
||||
static inline pmd_t pmdp_get(const pmd_t *pmdp)
|
||||
{
|
||||
return READ_ONCE(*pmdp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef pudp_get
|
||||
static inline pud_t pudp_get(pud_t *pudp)
|
||||
static inline pud_t pudp_get(const pud_t *pudp)
|
||||
{
|
||||
return READ_ONCE(*pudp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef p4dp_get
|
||||
static inline p4d_t p4dp_get(p4d_t *p4dp)
|
||||
static inline p4d_t p4dp_get(const p4d_t *p4dp)
|
||||
{
|
||||
return READ_ONCE(*p4dp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef pgdp_get
|
||||
static inline pgd_t pgdp_get(pgd_t *pgdp)
|
||||
static inline pgd_t pgdp_get(const pgd_t *pgdp)
|
||||
{
|
||||
return READ_ONCE(*pgdp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user