lkml.org 
[lkml]   [2018]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 03/25] ASoC: qcom: qdsp6: Add common qdsp6 helper functions
On Tue, Feb 13, 2018 at 04:58:15PM +0000, srinivas.kandagatla@linaro.org wrote:

> +config SND_SOC_QDSP6_COMMON
> + tristate
> + default n
> +

Ah, the other default n that had snuck in was actually in an earlier
patch in the series! I'm fairly sure this has come up with earlier
drivers you've submitted...

> +int q6dsp_map_channels(u8 ch_map[PCM_FORMAT_MAX_NUM_CHANNEL], int ch)
> +{
> + memset(ch_map, 0, PCM_FORMAT_MAX_NUM_CHANNEL);
> +
> + switch (ch) {
> + case 1:
> + ch_map[0] = PCM_CHANNEL_FC;
> + break;
> + case 2:
> + ch_map[0] = PCM_CHANNEL_FL;
> + ch_map[1] = PCM_CHANNEL_FR;
> + break;

That's some really funky indentation there...

> +static inline int q6dsp_errno(u32 error)
> +{
> + int ret = -EINVAL;
> +
> + if (error <= ARRAY_SIZE(q6dsp_err_codes))
> + ret = q6dsp_err_codes[error].lnx_err_code;
> +
> + return ret;
> +}

Is the error handling such a hot path that we need to make the lookup
functions (and the data table with the lookups) static inlines in a
header or could we just move the functions and the data into a C file?
Especially given the string lookups for the errors (which are really
nice to have) it seems wasteful.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-03-01 22:05    [W:0.385 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site