* [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
@ 2017-10-05 18:09 Tim Hansen
2017-10-06 16:00 ` Kyle Fortin
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Tim Hansen @ 2017-10-05 18:09 UTC (permalink / raw)
To: axboe; +Cc: devtimhansen, linux-block, linux-kernel, alexander.levin
mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
block/bio-integrity.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 5df3290..23b42e8 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
void bioset_integrity_free(struct bio_set *bs)
{
- if (bs->bio_integrity_pool)
- mempool_destroy(bs->bio_integrity_pool);
-
- if (bs->bvec_integrity_pool)
- mempool_destroy(bs->bvec_integrity_pool);
+ mempool_destroy(bs->bio_integrity_pool);
+ mempool_destroy(bs->bvec_integrity_pool);
}
EXPORT_SYMBOL(bioset_integrity_free);
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
2017-10-05 18:09 [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free() Tim Hansen
@ 2017-10-06 16:00 ` Kyle Fortin
2017-10-06 18:40 ` Martin K. Petersen
2017-10-06 19:04 ` Jens Axboe
2 siblings, 0 replies; 8+ messages in thread
From: Kyle Fortin @ 2017-10-06 16:00 UTC (permalink / raw)
To: Tim Hansen; +Cc: axboe, linux-block, linux-kernel, alexander.levin
Hi Tim,
On Oct 5, 2017, at 2:09 PM, Tim Hansen <devtimhansen@gmail.com> wrote:
>=20
> mempool_destroy() already checks for a NULL value being passed in, =
this eliminates duplicate checks.
>=20
> This was caught by running make coccicheck M=3Dblock/ on linus' tree =
on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of =
this patch).
>=20
> Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
> ---
> block/bio-integrity.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>=20
> diff --git a/block/bio-integrity.c b/block/bio-integrity.c
> index 5df3290..23b42e8 100644
> --- a/block/bio-integrity.c
> +++ b/block/bio-integrity.c
> @@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
>=20
> void bioset_integrity_free(struct bio_set *bs)
> {
> - if (bs->bio_integrity_pool)
> - mempool_destroy(bs->bio_integrity_pool);
> -
> - if (bs->bvec_integrity_pool)
> - mempool_destroy(bs->bvec_integrity_pool);
> + mempool_destroy(bs->bio_integrity_pool);
> + mempool_destroy(bs->bvec_integrity_pool);
> }
> EXPORT_SYMBOL(bioset_integrity_free);
>=20
> --=20
> 2.1.4
Looks good.
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
@ 2017-10-06 16:00 ` Kyle Fortin
0 siblings, 0 replies; 8+ messages in thread
From: Kyle Fortin @ 2017-10-06 16:00 UTC (permalink / raw)
To: Tim Hansen; +Cc: axboe, linux-block, linux-kernel, alexander.levin
Hi Tim,
On Oct 5, 2017, at 2:09 PM, Tim Hansen <devtimhansen@gmail.com> wrote:
>
> mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
>
> This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
>
> Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
> ---
> block/bio-integrity.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/block/bio-integrity.c b/block/bio-integrity.c
> index 5df3290..23b42e8 100644
> --- a/block/bio-integrity.c
> +++ b/block/bio-integrity.c
> @@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
>
> void bioset_integrity_free(struct bio_set *bs)
> {
> - if (bs->bio_integrity_pool)
> - mempool_destroy(bs->bio_integrity_pool);
> -
> - if (bs->bvec_integrity_pool)
> - mempool_destroy(bs->bvec_integrity_pool);
> + mempool_destroy(bs->bio_integrity_pool);
> + mempool_destroy(bs->bvec_integrity_pool);
> }
> EXPORT_SYMBOL(bioset_integrity_free);
>
> --
> 2.1.4
Looks good.
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
2017-10-05 18:09 [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free() Tim Hansen
2017-10-06 16:00 ` Kyle Fortin
@ 2017-10-06 18:40 ` Martin K. Petersen
2017-10-06 19:04 ` Jens Axboe
2 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2017-10-06 18:40 UTC (permalink / raw)
To: Tim Hansen; +Cc: axboe, linux-block, linux-kernel, alexander.levin
Tim,
> mempool_destroy() already checks for a NULL value being passed in,
> this eliminates duplicate checks.
That's fine.
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
2017-10-05 18:09 [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free() Tim Hansen
2017-10-06 16:00 ` Kyle Fortin
2017-10-06 18:40 ` Martin K. Petersen
@ 2017-10-06 19:04 ` Jens Axboe
2017-10-06 22:26 ` Tim Hansen
2 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2017-10-06 19:04 UTC (permalink / raw)
To: Tim Hansen; +Cc: linux-block, linux-kernel, alexander.levin
On 10/05/2017 12:09 PM, Tim Hansen wrote:
> mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
>
> This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
Applied, but I had to fix up your commit message. Please line wrap at
72 chars, otherwise it turns into an unreadable mess when people
try to view them.
--
Jens Axboe
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
2017-10-06 19:04 ` Jens Axboe
@ 2017-10-06 22:26 ` Tim Hansen
2017-10-09 18:34 ` Kyle Fortin
0 siblings, 1 reply; 8+ messages in thread
From: Tim Hansen @ 2017-10-06 22:26 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, linux-kernel, alexander.levin
On Fri, Oct 06, 2017 at 01:04:25PM -0600, Jens Axboe wrote:
> On 10/05/2017 12:09 PM, Tim Hansen wrote:
> > mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
> >
> > This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
>
> Applied, but I had to fix up your commit message. Please line wrap at
> 72 chars, otherwise it turns into an unreadable mess when people
> try to view them.
>
> --
> Jens Axboe
>
Noted! Thanks for the heads up on the char limit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
2017-10-06 22:26 ` Tim Hansen
@ 2017-10-09 18:34 ` Kyle Fortin
0 siblings, 0 replies; 8+ messages in thread
From: Kyle Fortin @ 2017-10-09 18:34 UTC (permalink / raw)
To: Tim Hansen; +Cc: Jens Axboe, linux-block, linux-kernel, alexander.levin
On Oct 6, 2017, at 6:26 PM, Tim Hansen <devtimhansen@gmail.com> wrote:
> On Fri, Oct 06, 2017 at 01:04:25PM -0600, Jens Axboe wrote:
>> On 10/05/2017 12:09 PM, Tim Hansen wrote:
>>> mempool_destroy() already checks for a NULL value being passed in, =
this eliminates duplicate checks.
>>>=20
>>> This was caught by running make coccicheck M=3Dblock/ on linus' tree =
on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of =
this patch).
>>=20
>> Applied, but I had to fix up your commit message. Please line wrap at
>> 72 chars, otherwise it turns into an unreadable mess when people
>> try to view them.
>>=20
>> --=20
>> Jens Axboe
>>=20
>=20
> Noted! Thanks for the heads up on the char limit.
scripts/checkpatch.pl would have caught it too
--
Kyle Fortin - Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free()
@ 2017-10-09 18:34 ` Kyle Fortin
0 siblings, 0 replies; 8+ messages in thread
From: Kyle Fortin @ 2017-10-09 18:34 UTC (permalink / raw)
To: Tim Hansen; +Cc: Jens Axboe, linux-block, linux-kernel, alexander.levin
On Oct 6, 2017, at 6:26 PM, Tim Hansen <devtimhansen@gmail.com> wrote:
> On Fri, Oct 06, 2017 at 01:04:25PM -0600, Jens Axboe wrote:
>> On 10/05/2017 12:09 PM, Tim Hansen wrote:
>>> mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
>>>
>>> This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
>>
>> Applied, but I had to fix up your commit message. Please line wrap at
>> 72 chars, otherwise it turns into an unreadable mess when people
>> try to view them.
>>
>> --
>> Jens Axboe
>>
>
> Noted! Thanks for the heads up on the char limit.
scripts/checkpatch.pl would have caught it too
--
Kyle Fortin - Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-09 18:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 18:09 [PATCH] block: remove unnecessary NULL checks in bioset_integrity_free() Tim Hansen
2017-10-06 16:00 ` Kyle Fortin
2017-10-06 16:00 ` Kyle Fortin
2017-10-06 18:40 ` Martin K. Petersen
2017-10-06 19:04 ` Jens Axboe
2017-10-06 22:26 ` Tim Hansen
2017-10-09 18:34 ` Kyle Fortin
2017-10-09 18:34 ` Kyle Fortin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.