mirror of https://github.com/thesofproject/sof.git
buffer.h: silences warning "flags may be used uninitialized"
buffer_unlock() does not use flags. Silences this gcc 8.1.0 (and valid) warning in src/audio/pipeline.c#pipeline_for_each_comp(). For some strange reason it shows up only with CONFIG_OPTIMIZE_FOR_DEBUG=y. Heuristics? In file included from sof/src/include/sof/audio/pipeline.h:16, from sof/src/include/sof/audio/buffer.h:12, from sof/src/audio/pipeline.c:8: src/audio/pipeline.c: In function 'pipeline_for_each_comp': src/include/sof/spinlock.h:200:38: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized] src/audio/pipeline.c:182:11: note: 'flags' was declared here uint32_t flags; ^~~~~ Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
parent
1f9c91d174
commit
69985365c6
|
@ -197,9 +197,15 @@ static inline void buffer_writeback(struct comp_buffer *buffer, uint32_t bytes)
|
|||
*/
|
||||
static inline void buffer_lock(struct comp_buffer *buffer, uint32_t *flags)
|
||||
{
|
||||
if (!buffer->inter_core)
|
||||
if (!buffer->inter_core) {
|
||||
/* Ignored by buffer_unlock() below, silences "may be
|
||||
* used uninitialized" warning.
|
||||
*/
|
||||
*flags = 0xffffffff;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Expands to: *flags = ... */
|
||||
spin_lock_irq(buffer->lock, *flags);
|
||||
|
||||
/* invalidate in case something has changed during our wait */
|
||||
|
|
Loading…
Reference in New Issue