All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset
@ 2018-12-22 10:08 Marcos Paulo de Souza
  2019-01-11  2:17 ` Marcos Paulo de Souza
  2019-01-14  8:39 ` Artur Paszkiewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Marcos Paulo de Souza @ 2018-12-22 10:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: shli, marcos.souza.org, linux-raid

bio_alloc_bioset return a bio pointer or NULL, so we can avoid storing
the returned data into a new variable.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/md/md.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index fc488cb30a94..42e018f014cb 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -207,15 +207,10 @@ static bool create_on_open = true;
 struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
 			    struct mddev *mddev)
 {
-	struct bio *b;
-
 	if (!mddev || !bioset_initialized(&mddev->bio_set))
 		return bio_alloc(gfp_mask, nr_iovecs);
 
-	b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
-	if (!b)
-		return NULL;
-	return b;
+	return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
 }
 EXPORT_SYMBOL_GPL(bio_alloc_mddev);
 
-- 
2.16.4

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

* Re: [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset
  2018-12-22 10:08 [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset Marcos Paulo de Souza
@ 2019-01-11  2:17 ` Marcos Paulo de Souza
  2019-01-11  9:07   ` Guoqing Jiang
  2019-01-14 13:33   ` Jens Axboe
  2019-01-14  8:39 ` Artur Paszkiewicz
  1 sibling, 2 replies; 5+ messages in thread
From: Marcos Paulo de Souza @ 2019-01-11  2:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: shli, linux-raid

ping?

On Sat, Dec 22, 2018 at 08:08:45AM -0200, Marcos Paulo de Souza wrote:
> bio_alloc_bioset return a bio pointer or NULL, so we can avoid storing
> the returned data into a new variable.
> 
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> ---
>  drivers/md/md.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index fc488cb30a94..42e018f014cb 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -207,15 +207,10 @@ static bool create_on_open = true;
>  struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
>  			    struct mddev *mddev)
>  {
> -	struct bio *b;
> -
>  	if (!mddev || !bioset_initialized(&mddev->bio_set))
>  		return bio_alloc(gfp_mask, nr_iovecs);
>  
> -	b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
> -	if (!b)
> -		return NULL;
> -	return b;
> +	return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
>  }
>  EXPORT_SYMBOL_GPL(bio_alloc_mddev);
>  
> -- 
> 2.16.4
> 

-- 
Thanks,
Marcos

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

* Re: [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset
  2019-01-11  2:17 ` Marcos Paulo de Souza
@ 2019-01-11  9:07   ` Guoqing Jiang
  2019-01-14 13:33   ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: Guoqing Jiang @ 2019-01-11  9:07 UTC (permalink / raw)
  To: Marcos Paulo de Souza, Linux Kernel Mailing List; +Cc: shli, Jens Axboe



On 1/11/19 10:17 AM, Marcos Paulo de Souza wrote:
> ping?
>
> On Sat, Dec 22, 2018 at 08:08:45AM -0200, Marcos Paulo de Souza wrote:
>> bio_alloc_bioset return a bio pointer or NULL, so we can avoid storing
>> the returned data into a new variable.
>>
>> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>

Add Jens to cc list, anyway, Acked-by: Guoqing Jiang <gqjiang@suse.com>

Thanks,
Guoqing

>> ---
>>   drivers/md/md.c | 7 +------
>>   1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index fc488cb30a94..42e018f014cb 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -207,15 +207,10 @@ static bool create_on_open = true;
>>   struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
>>   			    struct mddev *mddev)
>>   {
>> -	struct bio *b;
>> -
>>   	if (!mddev || !bioset_initialized(&mddev->bio_set))
>>   		return bio_alloc(gfp_mask, nr_iovecs);
>>   
>> -	b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
>> -	if (!b)
>> -		return NULL;
>> -	return b;
>> +	return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
>>   }
>>   EXPORT_SYMBOL_GPL(bio_alloc_mddev);
>>   
>> -- 
>> 2.16.4
>>


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

* Re: [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset
  2018-12-22 10:08 [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset Marcos Paulo de Souza
  2019-01-11  2:17 ` Marcos Paulo de Souza
@ 2019-01-14  8:39 ` Artur Paszkiewicz
  1 sibling, 0 replies; 5+ messages in thread
From: Artur Paszkiewicz @ 2019-01-14  8:39 UTC (permalink / raw)
  To: Marcos Paulo de Souza, linux-kernel; +Cc: shli, linux-raid

On 12/22/18 11:08 AM, Marcos Paulo de Souza wrote:
> bio_alloc_bioset return a bio pointer or NULL, so we can avoid storing
> the returned data into a new variable.
> 
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>

Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>

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

* Re: [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset
  2019-01-11  2:17 ` Marcos Paulo de Souza
  2019-01-11  9:07   ` Guoqing Jiang
@ 2019-01-14 13:33   ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2019-01-14 13:33 UTC (permalink / raw)
  To: Marcos Paulo de Souza, linux-kernel; +Cc: shli, linux-raid

On 1/10/19 7:17 PM, Marcos Paulo de Souza wrote:
> ping?
> 
> On Sat, Dec 22, 2018 at 08:08:45AM -0200, Marcos Paulo de Souza wrote:
>> bio_alloc_bioset return a bio pointer or NULL, so we can avoid storing
>> the returned data into a new variable.
>>
>> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
>> ---
>>  drivers/md/md.c | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index fc488cb30a94..42e018f014cb 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -207,15 +207,10 @@ static bool create_on_open = true;
>>  struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
>>  			    struct mddev *mddev)
>>  {
>> -	struct bio *b;
>> -
>>  	if (!mddev || !bioset_initialized(&mddev->bio_set))
>>  		return bio_alloc(gfp_mask, nr_iovecs);
>>  
>> -	b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
>> -	if (!b)
>> -		return NULL;
>> -	return b;
>> +	return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
>>  }
>>  EXPORT_SYMBOL_GPL(bio_alloc_mddev);

Applied, thanks.

-- 
Jens Axboe

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

end of thread, other threads:[~2019-01-14 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-22 10:08 [PATCH] drivers/md.c: Make bio_alloc_mddev return bio_alloc_bioset Marcos Paulo de Souza
2019-01-11  2:17 ` Marcos Paulo de Souza
2019-01-11  9:07   ` Guoqing Jiang
2019-01-14 13:33   ` Jens Axboe
2019-01-14  8:39 ` Artur Paszkiewicz

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.