[PATCH 3/6] ASoC: SOF: Create client driver for IPC test

Mark Brown broonie at kernel.org
Thu Oct 1 15:59:07 CEST 2020


On Wed, Sep 30, 2020 at 03:50:48PM -0700, Dave Ertman wrote:

> +/* helper function to perform the flood test */
> +static int sof_debug_ipc_flood_test(struct sof_client_dev *cdev, bool flood_duration_test,
> +				    unsigned long ipc_duration_ms, unsigned long ipc_count)

Again, some word wrapping would be nice.

The flood_duration_test parameter is boolean which is often a warning
sign for uncler interfaces and...

> +	if (flood_duration_test) {
> +		dev_dbg(dev, "IPC Flood test duration: %lums\n", ipc_duration_ms);
> +		snprintf(ipc_client_data->buf, IPC_FLOOD_TEST_RESULT_LEN,
> +			 "IPC Flood test duration: %lums\n", ipc_duration_ms);
> +	}

...appears to only control this debug print which I'd never have guessed
from the name.

> +	/* set test completion criterion */
> +	ret = flood_duration_test ? kstrtoul(string, 0, &ipc_duration_ms) :
> +			kstrtoul(string, 0, &ipc_count);
> +	if (ret < 0)
> +		goto out;

Please write normal conditional statements for legibility.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20201001/ef54d0fc/attachment.sig>


More information about the Alsa-devel mailing list