Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v3] staging: nvec: Use x instead of x != NULL to improve readability.
@ 2024-06-29 17:47 Tom Mounet
  2024-07-01 19:31 ` Philipp Hortmann
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Mounet @ 2024-06-29 17:47 UTC (permalink / raw)
  To: Marc Dietrich, Greg Kroah-Hartman, ac100, linux-tegra,
	linux-staging, linux-kernel, outreachy

Use x instead of x != NULL to improve readability.
Issue identified by checkpatch.

Signed-off-by: Tom Mounet <tommounet@gmail.com>
---
v3: Add change history and proper description
v2: Make commit title clearer

 drivers/staging/nvec/nvec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index e5ca78e57..814eb121c 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -300,7 +300,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
 {
 	mutex_lock(&nvec->sync_write_mutex);
 
-	if (msg != NULL)
+	if (msg)
 		*msg = NULL;
 
 	nvec->sync_write_pending = (data[1] << 8) + data[0];
@@ -322,7 +322,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
 
 	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
 
-	if (msg != NULL)
+	if (msg)
 		*msg = nvec->last_sync_msg;
 	else
 		nvec_msg_free(nvec, nvec->last_sync_msg);
-- 
2.39.2


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

* Re: [PATCH v3] staging: nvec: Use x instead of x != NULL to improve readability.
  2024-06-29 17:47 [PATCH v3] staging: nvec: Use x instead of x != NULL to improve readability Tom Mounet
@ 2024-07-01 19:31 ` Philipp Hortmann
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Hortmann @ 2024-07-01 19:31 UTC (permalink / raw)
  To: Tom Mounet, Marc Dietrich, Greg Kroah-Hartman, ac100, linux-tegra,
	linux-staging, linux-kernel, outreachy

On 6/29/24 19:47, Tom Mounet wrote:
> Use x instead of x != NULL to improve readability.
> Issue identified by checkpatch.
> 
> Signed-off-by: Tom Mounet <tommounet@gmail.com>
> ---
> v3: Add change history and proper description
> v2: Make commit title clearer
> 
>   drivers/staging/nvec/nvec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index e5ca78e57..814eb121c 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -300,7 +300,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
>   {
>   	mutex_lock(&nvec->sync_write_mutex);
>   
> -	if (msg != NULL)
> +	if (msg)
>   		*msg = NULL;
>   
>   	nvec->sync_write_pending = (data[1] << 8) + data[0];
> @@ -322,7 +322,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
>   
>   	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
>   
> -	if (msg != NULL)
> +	if (msg)
>   		*msg = nvec->last_sync_msg;
>   	else
>   		nvec_msg_free(nvec, nvec->last_sync_msg);

Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>

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

end of thread, other threads:[~2024-07-01 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-29 17:47 [PATCH v3] staging: nvec: Use x instead of x != NULL to improve readability Tom Mounet
2024-07-01 19:31 ` Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox