Skip to content

Commit 3c57fa1

Browse files
Christoph Hellwigpalmer-dabbelt
authored andcommitted
asm-generic: make the set_fs implementation optional
Put all the set_fs related code under CONFIG_SET_FS so that asm-generic/uaccess.h can be used for set_fs-less builds. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent 2d2d255 commit 3c57fa1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

include/asm-generic/uaccess.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
9494
#define INLINE_COPY_TO_USER
9595
#endif /* CONFIG_UACCESS_MEMCPY */
9696

97+
#ifdef CONFIG_SET_FS
9798
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
9899

99100
#ifndef KERNEL_DS
@@ -116,6 +117,7 @@ static inline void set_fs(mm_segment_t fs)
116117
#ifndef uaccess_kernel
117118
#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
118119
#endif
120+
#endif /* CONFIG_SET_FS */
119121

120122
#define access_ok(addr, size) __access_ok((unsigned long)(addr),(size))
121123

0 commit comments

Comments
 (0)