mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
libc: audio: nxstyle fixes
This change is needed to be able to fix the warnings on the audio core and includes the propagation of the fix in the audio. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
+3
-3
@@ -556,8 +556,8 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
{
|
{
|
||||||
/* Perform a simple apb_free operation */
|
/* Perform a simple apb_free operation */
|
||||||
|
|
||||||
DEBUGASSERT(bufdesc->u.pBuffer != NULL);
|
DEBUGASSERT(bufdesc->u.buffer != NULL);
|
||||||
apb_free(bufdesc->u.pBuffer);
|
apb_free(bufdesc->u.buffer);
|
||||||
ret = sizeof(struct audio_buf_desc_s);
|
ret = sizeof(struct audio_buf_desc_s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -575,7 +575,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
DEBUGASSERT(lower->ops->enqueuebuffer != NULL);
|
DEBUGASSERT(lower->ops->enqueuebuffer != NULL);
|
||||||
|
|
||||||
bufdesc = (FAR struct audio_buf_desc_s *) arg;
|
bufdesc = (FAR struct audio_buf_desc_s *) arg;
|
||||||
ret = lower->ops->enqueuebuffer(lower, bufdesc->u.pBuffer);
|
ret = lower->ops->enqueuebuffer(lower, bufdesc->u.buffer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -597,7 +597,7 @@ static int audio_comp_freebuffer(FAR struct audio_lowerhalf_s *dev,
|
|||||||
|
|
||||||
if (ret == -ENOTTY)
|
if (ret == -ENOTTY)
|
||||||
{
|
{
|
||||||
apb_free(bufdesc->u.pBuffer);
|
apb_free(bufdesc->u.buffer);
|
||||||
ret = sizeof(*bufdesc);
|
ret = sizeof(*bufdesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -465,8 +465,8 @@ struct audio_buf_desc_s
|
|||||||
uint16_t numbytes; /* Number of bytes to allocate */
|
uint16_t numbytes; /* Number of bytes to allocate */
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
FAR struct ap_buffer_s *pBuffer; /* Buffer to free / enqueue */
|
FAR struct ap_buffer_s *buffer; /* Buffer to free / enqueue */
|
||||||
FAR struct ap_buffer_s **ppBuffer; /* Pointer to receive allocated buffer */
|
FAR struct ap_buffer_s **pbuffer; /* Pointer to receive allocated buffer */
|
||||||
} u;
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -104,17 +104,17 @@ int apb_alloc(FAR struct audio_buf_desc_s *bufdesc)
|
|||||||
int ret;
|
int ret;
|
||||||
struct ap_buffer_s *apb;
|
struct ap_buffer_s *apb;
|
||||||
|
|
||||||
DEBUGASSERT(bufdesc->u.ppBuffer != NULL);
|
DEBUGASSERT(bufdesc->u.pbuffer != NULL);
|
||||||
|
|
||||||
/* Perform a user mode allocation */
|
/* Perform a user mode allocation */
|
||||||
|
|
||||||
bufsize = sizeof(struct ap_buffer_s) + bufdesc->numbytes;
|
bufsize = sizeof(struct ap_buffer_s) + bufdesc->numbytes;
|
||||||
apb = lib_umalloc(bufsize);
|
apb = lib_umalloc(bufsize);
|
||||||
*bufdesc->u.ppBuffer = apb;
|
*bufdesc->u.pbuffer = apb;
|
||||||
|
|
||||||
/* Test if the allocation was successful or not */
|
/* Test if the allocation was successful or not */
|
||||||
|
|
||||||
if (*bufdesc->u.ppBuffer == NULL)
|
if (*bufdesc->u.pbuffer == NULL)
|
||||||
{
|
{
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user