linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/1] bsr: do not use assignment in if condition
@ 2019-05-15 16:17 parna.naveenkumar
  2019-05-16  7:58 ` Mukesh Ojha
  0 siblings, 1 reply; 2+ messages in thread
From: parna.naveenkumar @ 2019-05-15 16:17 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Naveen Kumar Parna

From: Naveen Kumar Parna <parna.naveenkumar@gmail.com>

checkpatch.pl does not like assignment in if condition

Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
---
Changes in v3:
The first patch has an extra space in if statement, so fixed it in v2 but 
forgot add what changed from the previous version. In v3 added the
complete change history.

 drivers/char/bsr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index a6cef548e01e..70de334554a8 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -322,7 +322,8 @@ static int __init bsr_init(void)
 		goto out_err_2;
 	}
 
-	if ((ret = bsr_create_devs(np)) < 0) {
+	ret = bsr_create_devs(np);
+	if (ret < 0) {
 		np = NULL;
 		goto out_err_3;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 1/1] bsr: do not use assignment in if condition
  2019-05-15 16:17 [PATCH v3 1/1] bsr: do not use assignment in if condition parna.naveenkumar
@ 2019-05-16  7:58 ` Mukesh Ojha
  0 siblings, 0 replies; 2+ messages in thread
From: Mukesh Ojha @ 2019-05-16  7:58 UTC (permalink / raw)
  To: parna.naveenkumar, arnd, gregkh; +Cc: linux-kernel


On 5/15/2019 9:47 PM, parna.naveenkumar@gmail.com wrote:
> From: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
>
> checkpatch.pl does not like assignment in if condition
>
> Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> ---
> Changes in v3:
> The first patch has an extra space in if statement, so fixed it in v2 but
> forgot add what changed from the previous version. In v3 added the
> complete change history.
>
>   drivers/char/bsr.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
> index a6cef548e01e..70de334554a8 100644
> --- a/drivers/char/bsr.c
> +++ b/drivers/char/bsr.c
> @@ -322,7 +322,8 @@ static int __init bsr_init(void)
>   		goto out_err_2;
>   	}
>   
> -	if ((ret = bsr_create_devs(np)) < 0) {
> +	ret = bsr_create_devs(np);
> +	if (ret < 0) {
>   		np = NULL;
>   		goto out_err_3;
>   	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-16  7:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 16:17 [PATCH v3 1/1] bsr: do not use assignment in if condition parna.naveenkumar
2019-05-16  7:58 ` Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).