diff mbox series

dmaengine: dmatest: Restore default for channel

Message ID 20200429071522.58148-1-vladimir.murzin@arm.com (mailing list archive)
State Accepted
Headers show
Series dmaengine: dmatest: Restore default for channel | expand

Commit Message

Vladimir Murzin April 29, 2020, 7:15 a.m. UTC
In case of dmatest is built-in and no channel was configured test
doesn't run with:

dmatest: Could not start test, no channels configured

Even though description to "channel" parameter claims that default is
any.

Add default channel back as it used to be rather than reject test with
no channel configuration.

Fixes: d53513d5dc285d9a95a534fc41c5c08af6b60eac ("dmaengine: dmatest: Add support for multi channel testing)

Reported-by: Dijil Mohan <Dijil.Mohan@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 drivers/dma/dmatest.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Vinod Koul May 13, 2020, 11:30 a.m. UTC | #1
On 29-04-20, 08:15, Vladimir Murzin wrote:
> In case of dmatest is built-in and no channel was configured test
> doesn't run with:
> 
> dmatest: Could not start test, no channels configured
> 
> Even though description to "channel" parameter claims that default is
> any.
> 
> Add default channel back as it used to be rather than reject test with
> no channel configuration.
> 
> Fixes: d53513d5dc285d9a95a534fc41c5c08af6b60eac ("dmaengine: dmatest: Add support for multi channel testing)
> 

no need for blank line here

> Reported-by: Dijil Mohan <Dijil.Mohan@arm.com>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  drivers/dma/dmatest.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
> index a2cadfa..5e1fff9 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -1166,10 +1166,11 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp)
>  		mutex_unlock(&info->lock);
>  		return ret;
>  	} else if (dmatest_run) {
> -		if (is_threaded_test_pending(info))
> -			start_threaded_tests(info);
> -		else
> -			pr_info("Could not start test, no channels configured\n");
> +		if (!is_threaded_test_pending(info)){

We need space before {

That is why we need to run checkpatch before sending patches.

I have fixed that up and applied this
diff mbox series

Patch

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index a2cadfa..5e1fff9 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -1166,10 +1166,11 @@  static int dmatest_run_set(const char *val, const struct kernel_param *kp)
 		mutex_unlock(&info->lock);
 		return ret;
 	} else if (dmatest_run) {
-		if (is_threaded_test_pending(info))
-			start_threaded_tests(info);
-		else
-			pr_info("Could not start test, no channels configured\n");
+		if (!is_threaded_test_pending(info)){
+			pr_info("No channels configured, continue with any\n");
+			add_threaded_test(info);
+		}
+		start_threaded_tests(info);
 	} else {
 		stop_threaded_test(info);
 	}