asm-generic cleanups for v5.11
These are a couple of compiler warning fixes to make 'make W=2' less noisy, as well as some fixes to code comments in asm-generic. Signed-off-by: Arnd Bergmann <arnd@arndb.de> -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAl/Y10UACgkQmmx57+YA GNmJ8A/6A5iIFTJu48fEb4aVDXkW3WLsgRJ+pPt+sFqNhLJu6yi+HftNPhvfaXuJ 1/S2uqAc2VA8WbHn+KTqPk5SsBh5urI6c4DXxTDHihMT6lIqjRbhKIoIaFx7Vl8d 1CERQTqgJMmGNjrZkOnD3qsud9tbUh/dJZl3UuDYmYmgPw/p+y79mGIwAzvHYsU9 QdazdV6v22ceagp2QSLYTr7LN6pShijyXqcJ4ko9Zhzpj1TNsBF97nKIww/vMm3k XRLBDbPfTcGrUtQmDQ+lVWPNpFbiR2iZuC/CBy4e0MbpQP5l9zoVG7d60Imvi/17 9+vWmvng9ehFiyM5fRYG67L+cKVbPhVMW1TmUpxg88KvznudHKgV0jwXRZV2EO10 /RpVQIJ0rLODx2myEZd8Rqhv2UVmjJmViPq7Hr/D8C+JcwdtfcPnziQteBOB0piz QI1h0me+0Yj90nLpjWBGCwUnFh+8/SAoKkwViCxA+Jmn6/34hh0/5w9ExoI+4Frr 8KlHu5wZ6O0mqWT0INrbeb0nmktFOL9tGwTrHa8Z723osB1nuVtTAvHxWCOSlVDd XkuViDLkcJn4B+7EcUoR1YY9wCwK5eHcvA/h/44Y7xU5k4OEJP5hFhXy4ew2CCbE OpazsuCABkpno/WbLoJSdEA+2Dv/uiN5ChNjACgWBN2M4LlKBGs= =c2xf -----END PGP SIGNATURE----- Merge tag 'asm-generic-cleanup-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic cleanups from Arnd Bergmann: "These are a couple of compiler warning fixes to make 'make W=2' less noisy, as well as some fixes to code comments in asm-generic" * tag 'asm-generic-cleanup-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: syscalls: Fix file comments for syscalls implemented in kernel/sys.c ctype.h: remove duplicate isdigit() helper qspinlock: use signed temporaries for cmpxchg asm-generic: fix ffs -Wshadow warning asm-generic: percpu: avoid Wshadow warning asm-generic/sembuf: Update architecture related information in comment
This commit is contained in:
commit
e2dc495734
include
asm-generic
linux
uapi/asm-generic
@ -10,9 +10,6 @@
|
||||
* the libc and compiler builtin ffs routines, therefore
|
||||
* differs in spirit from the above ffz (man ffs).
|
||||
*/
|
||||
static __always_inline int ffs(int x)
|
||||
{
|
||||
return __builtin_ffs(x);
|
||||
}
|
||||
#define ffs(x) __builtin_ffs(x)
|
||||
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@ extern void queued_write_lock_slowpath(struct qrwlock *lock);
|
||||
*/
|
||||
static inline int queued_read_trylock(struct qrwlock *lock)
|
||||
{
|
||||
u32 cnts;
|
||||
int cnts;
|
||||
|
||||
cnts = atomic_read(&lock->cnts);
|
||||
if (likely(!(cnts & _QW_WMASK))) {
|
||||
@ -56,7 +56,7 @@ static inline int queued_read_trylock(struct qrwlock *lock)
|
||||
*/
|
||||
static inline int queued_write_trylock(struct qrwlock *lock)
|
||||
{
|
||||
u32 cnts;
|
||||
int cnts;
|
||||
|
||||
cnts = atomic_read(&lock->cnts);
|
||||
if (unlikely(cnts))
|
||||
@ -71,7 +71,7 @@ static inline int queued_write_trylock(struct qrwlock *lock)
|
||||
*/
|
||||
static inline void queued_read_lock(struct qrwlock *lock)
|
||||
{
|
||||
u32 cnts;
|
||||
int cnts;
|
||||
|
||||
cnts = atomic_add_return_acquire(_QR_BIAS, &lock->cnts);
|
||||
if (likely(!(cnts & _QW_WMASK)))
|
||||
@ -87,7 +87,7 @@ static inline void queued_read_lock(struct qrwlock *lock)
|
||||
*/
|
||||
static inline void queued_write_lock(struct qrwlock *lock)
|
||||
{
|
||||
u32 cnts = 0;
|
||||
int cnts = 0;
|
||||
/* Optimize for the unfair lock case where the fair flag is 0. */
|
||||
if (likely(atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED)))
|
||||
return;
|
||||
|
@ -60,7 +60,7 @@ static __always_inline int queued_spin_is_contended(struct qspinlock *lock)
|
||||
*/
|
||||
static __always_inline int queued_spin_trylock(struct qspinlock *lock)
|
||||
{
|
||||
u32 val = atomic_read(&lock->val);
|
||||
int val = atomic_read(&lock->val);
|
||||
|
||||
if (unlikely(val))
|
||||
return 0;
|
||||
@ -77,7 +77,7 @@ extern void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);
|
||||
*/
|
||||
static __always_inline void queued_spin_lock(struct qspinlock *lock)
|
||||
{
|
||||
u32 val = 0;
|
||||
int val = 0;
|
||||
|
||||
if (likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL)))
|
||||
return;
|
||||
|
@ -64,6 +64,17 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
|
||||
/* Attributes */
|
||||
#include <linux/compiler_attributes.h>
|
||||
|
||||
/* Builtins */
|
||||
|
||||
/*
|
||||
* __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21.
|
||||
* In the meantime, to support gcc < 10, we implement __has_builtin
|
||||
* by hand.
|
||||
*/
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) (0)
|
||||
#endif
|
||||
|
||||
/* Compiler specific macros. */
|
||||
#ifdef __clang__
|
||||
#include <linux/compiler-clang.h>
|
||||
|
@ -2,6 +2,8 @@
|
||||
#ifndef _LINUX_CTYPE_H
|
||||
#define _LINUX_CTYPE_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/*
|
||||
* NOTE! This ctype does not handle EOF like the standard C
|
||||
* library is required to.
|
||||
@ -23,10 +25,6 @@ extern const unsigned char _ctype[];
|
||||
#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0)
|
||||
#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0)
|
||||
#define iscntrl(c) ((__ismask(c)&(_C)) != 0)
|
||||
static inline int isdigit(int c)
|
||||
{
|
||||
return '0' <= c && c <= '9';
|
||||
}
|
||||
#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0)
|
||||
#define islower(c) ((__ismask(c)&(_L)) != 0)
|
||||
#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
|
||||
@ -39,6 +37,15 @@ static inline int isdigit(int c)
|
||||
#define isascii(c) (((unsigned char)(c))<=0x7f)
|
||||
#define toascii(c) (((unsigned char)(c))&0x7f)
|
||||
|
||||
#if __has_builtin(__builtin_isdigit)
|
||||
#define isdigit(c) __builtin_isdigit(c)
|
||||
#else
|
||||
static inline int isdigit(int c)
|
||||
{
|
||||
return '0' <= c && c <= '9';
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline unsigned char __tolower(unsigned char c)
|
||||
{
|
||||
if (isupper(c))
|
||||
|
@ -744,7 +744,7 @@ asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv,
|
||||
asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p);
|
||||
asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p);
|
||||
|
||||
/* kernel/timer.c */
|
||||
/* kernel/sys.c */
|
||||
asmlinkage long sys_getpid(void);
|
||||
asmlinkage long sys_getppid(void);
|
||||
asmlinkage long sys_getuid(void);
|
||||
|
@ -6,9 +6,9 @@
|
||||
#include <asm/ipcbuf.h>
|
||||
|
||||
/*
|
||||
* The semid64_ds structure for x86 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
* The semid64_ds structure for most architectures (though it came from x86_32
|
||||
* originally). Note extra padding because this structure is passed back and
|
||||
* forth between kernel and user space.
|
||||
*
|
||||
* semid64_ds was originally meant to be architecture specific, but
|
||||
* everyone just ended up making identical copies without specific
|
||||
|
@ -517,7 +517,7 @@ __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
|
||||
__SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex)
|
||||
#endif
|
||||
|
||||
/* kernel/timer.c */
|
||||
/* kernel/sys.c */
|
||||
#define __NR_getpid 172
|
||||
__SYSCALL(__NR_getpid, sys_getpid)
|
||||
#define __NR_getppid 173
|
||||
|
Loading…
Reference in New Issue
Block a user