#ifndef LOCKING_H #define LOCKING_H #include struct spinlock { pthread_spinlock_t lock; }; struct mutexlock { pthread_mutex_t lock; }; #define MUTEXLOCK_INITIALIZER { .lock = PTHREAD_MUTEX_INITIALIZER } struct rwlock { pthread_rwlock_t lock; }; struct condlock { pthread_mutex_t lock; pthread_cond_t cond; }; static inline int spinlock_init(struct spinlock *l) { return -pthread_spin_init(&l->lock, 0); } static inline void spinlock_destroy(struct spinlock *l) { pthread_spin_destroy(&l->lock); } static inline void spinlock_lock(struct spinlock *l) { pthread_spin_lock(&l->lock); } static inline void spinlock_unlock(struct spinlock *l) { pthread_spin_unlock(&l->lock); } static inline int mutexlock_init(struct mutexlock *l) { return -pthread_mutex_init(&l->lock, 0); } static inline void mutexlock_destroy(struct mutexlock *l) { pthread_mutex_destroy(&l->lock); } static inline void mutexlock_lock(struct mutexlock *l) { pthread_mutex_lock(&l->lock); } static inline void mutexlock_unlock(struct mutexlock *l) { pthread_mutex_unlock(&l->lock); } static inline int rwlock_init(struct rwlock *l) { return -pthread_rwlock_init(&l->lock, 0); } static inline int rwlock_init2(struct rwlock *l, pthread_rwlockattr_t *attr) { return -pthread_rwlock_init(&l->lock, attr); } static inline void rwlock_destroy(struct rwlock *l) { pthread_rwlock_destroy(&l->lock); } static inline void rwlock_rd_lock(struct rwlock *l) { pthread_rwlock_rdlock(&l->lock); } static inline void rwlock_wr_lock(struct rwlock *l) { pthread_rwlock_wrlock(&l->lock); } static inline void rwlock_unlock(struct rwlock *l) { pthread_rwlock_unlock(&l->lock); } static inline void condlock_init(struct condlock *c) { pthread_mutex_init(&c->lock, NULL); pthread_cond_init(&c->cond, NULL); } static inline void condlock_signal(struct condlock *c) { pthread_mutex_lock(&c->lock); pthread_cond_signal(&c->cond); pthread_mutex_unlock(&c->lock); } static inline void condlock_wait(struct condlock *c) { pthread_mutex_lock(&c->lock); pthread_cond_wait(&c->cond, &c->lock); pthread_mutex_unlock(&c->lock); } static inline void condlock_destroy(struct condlock *c) { pthread_mutex_destroy(&c->lock); pthread_cond_destroy(&c->cond); } #endif /* LOCKING_H */ tion/input/gamepad.txt?h=nds-private-remove&id=c749c64f45fa07d20e11af2e3f3caa9d7650d341'>diff
path: root/Documentation/input/gamepad.txt
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-12 00:46:45 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-18 02:26:33 +0200
commitc749c64f45fa07d20e11af2e3f3caa9d7650d341 (patch)
tree30f717d86c06418d3f381329e21ecdd0d0f03e2d /Documentation/input/gamepad.txt
parent1aa7a6e2b8105f22a5f7d6def281f776459c95ba (diff)
intel_pstate: Simplify conditional in intel_pstate_set_policy()
One of the if () statements in intel_pstate_set_policy() causes another if () to be evaluated if the condition is true and it doesn't do anything else, so merge the two if () statements into one. No functional changes. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'Documentation/input/gamepad.txt')
eword what the port_vlan_filtering is about based on feedback from Vivien and Ido ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/input/gamepad.txt')