diff mbox series

iio: Be consistent with allocation result tests.

Message ID 20220718020348.32047-1-joetalbott@gmail.com (mailing list archive)
State Accepted
Headers show
Series iio: Be consistent with allocation result tests. | expand

Commit Message

Joe Simmons-Talbott July 18, 2022, 2:03 a.m. UTC
Make both allocation result tests use the same format

    if (!ptr)

Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>
---
 drivers/iio/industrialio-trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron July 18, 2022, 4:44 p.m. UTC | #1
On Sun, 17 Jul 2022 22:03:48 -0400
Joe Simmons-Talbott <joetalbott@gmail.com> wrote:

> Make both allocation result tests use the same format
> 
>     if (!ptr)
> 
> Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>
If you post two patches to the list that will cause each other to not
apply, please base one on top of the other and say so in the
patch description.

Anyhow, fixed up and applied by hand.

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-trigger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index f504ed351b3e..e22c47f20b4d 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -369,7 +369,7 @@ struct iio_poll_func
>  	struct iio_poll_func *pf;
>  
>  	pf = kmalloc(sizeof *pf, GFP_KERNEL);
> -	if (pf == NULL)
> +	if (!pf)
>  		return NULL;
>  	va_start(vargs, fmt);
>  	pf->name = kvasprintf(GFP_KERNEL, fmt, vargs);
Joe Simmons-Talbott July 31, 2022, 2:19 p.m. UTC | #2
On Mon, Jul 18, 2022 at 05:44:41PM +0100, Jonathan Cameron wrote:
> On Sun, 17 Jul 2022 22:03:48 -0400
> Joe Simmons-Talbott <joetalbott@gmail.com> wrote:
> 
> > Make both allocation result tests use the same format
> > 
> >     if (!ptr)
> > 
> > Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>
> If you post two patches to the list that will cause each other to not
> apply, please base one on top of the other and say so in the
> patch description.
> 
> Anyhow, fixed up and applied by hand.

I'm sorry for neglecting that and for creating extra work.  Thank you
for fixing it.

Thanks,
Joe
diff mbox series

Patch

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index f504ed351b3e..e22c47f20b4d 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -369,7 +369,7 @@  struct iio_poll_func
 	struct iio_poll_func *pf;
 
 	pf = kmalloc(sizeof *pf, GFP_KERNEL);
-	if (pf == NULL)
+	if (!pf)
 		return NULL;
 	va_start(vargs, fmt);
 	pf->name = kvasprintf(GFP_KERNEL, fmt, vargs);