#define _GNU_SOURCE #include "main.h" #include #include #include #include #include #include #include #include #define SMP_CACHE_BYTES 64 #define cache_line_size() SMP_CACHE_BYTES #define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES))) #define unlikely(x) (__builtin_expect(!!(x), 0)) #define likely(x) (__builtin_expect(!!(x), 1)) #define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) typedef pthread_spinlock_t spinlock_t; typedef int gfp_t; static void *kmalloc(unsigned size, gfp_t gfp) { return memalign(64, size); } static void *kzalloc(unsigned size, gfp_t gfp) { void *p = memalign(64, size); if (!p) return p; memset(p, 0, size); return p; } static void kfree(void *p) { if (p) free(p); } static void spin_lock_init(spinlock_t *lock) { int r = pthread_spin_init(lock, 0); assert(!r); } static void spin_lock(spinlock_t *lock) { int ret = pthread_spin_lock(lock); assert(!ret); } static void spin_unlock(spinlock_t *lock) { int ret = pthread_spin_unlock(lock); assert(!ret); } static void spin_lock_bh(spinlock_t *lock) { spin_lock(lock); } static void spin_unlock_bh(spinlock_t *lock) { spin_unlock(lock); } static void spin_lock_irq(spinlock_t *lock) { spin_lock(lock); } static void spin_unlock_irq(spinlock_t *lock) { spin_unlock(lock); } static void spin_lock_irqsave(spinlock_t *lock, unsigned long f) { spin_lock(lock); } static void spin_unlock_irqrestore(spinlock_t *lock, unsigned long f) { spin_unlock(lock); } #include "../../../include/linux/ptr_ring.h" static unsigned long long headcnt, tailcnt; static struct ptr_ring array ____cacheline_aligned_in_smp; /* implemented by ring */ void alloc_ring(void) { int ret = ptr_ring_init(&array, ring_size, 0); assert(!ret); } /* guest side */ int add_inbuf(unsigned len, void *buf, void *datap) { int ret; ret = __ptr_ring_produce(&array, buf); if (ret >= 0) { ret = 0; headcnt++; } return ret; } /* * ptr_ring API provides no way for producer to find out whether a given * buffer was consumed. Our tests merely require that a successful get_buf * implies that add_inbuf succeed in the past, and that add_inbuf will succeed, * fake it accordingly. */ void *get_buf(unsigned *lenp, void **bufp) { void *datap; if (tailcnt == headcnt || __ptr_ring_full(&array)) datap = NULL; else { datap = "Buffer\n"; ++tailcnt; } return datap; } bool used_empty() { return (tailcnt == headcnt || __ptr_ring_full(&array)); } void disable_call() { assert(0); } bool enable_call() { assert(0); } void kick_available(void) { assert(0); } /* host side */ void disable_kick() { assert(0); } bool enable_kick() { assert(0); } bool avail_empty() { return !__ptr_ring_peek(&array); } bool use_buf(unsigned *lenp, void **bufp) { void *ptr; ptr = __ptr_ring_consume(&array); return ptr; } void call_used(void) { assert(0); } net-next.git/commit/sound/soc/soc-dapm.c?id=66115335fbb411365c23349b2fbe7e041eabbaf2'>soc-dapm.c
diff options
context:
space:
mode:
authorJohn Brooks <john@fastquake.com>2016-12-23 00:53:10 +0000
committerJonathan Corbet <corbet@lwn.net>2016-12-27 13:05:36 -0700
commit66115335fbb411365c23349b2fbe7e041eabbaf2 (patch)
tree4cd3d5d8c97cc5279754c605c5017dfaa6642f75 /sound/soc/soc-dapm.c
parent54ab6db0909061ab7ee07233d3cab86d29f86e6c (diff)
docs: Fix build failure
The 80211.tmpl DocBook file was removed in commit 819bf593767c ("docs-rst: sphinxify 802.11 documentation"), but the 80211.xml target was re-added to the Makefile by commit 7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document"), leading to a failure when building the documentation: *** No rule to make target 'Documentation/DocBook/80211.xml', needed by 'Documentation/DocBook/80211.aux.xml'. cc: stable@vger.kernel.org Signed-off-by: John Brooks <john@fastquake.com> Mea-culpa-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'sound/soc/soc-dapm.c')