lkml.org 
[lkml]   [2021]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] powerpc/mpic: Use bitmap_zalloc() when applicable
Date
'mpic->protected' is a bitmap. So use 'bitmap_zalloc()' to simplify
code and improve the semantic, instead of hand writing it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/s390/cio/idset.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
index 45f9c0736be4..7e5550230c0f 100644
--- a/drivers/s390/cio/idset.c
+++ b/drivers/s390/cio/idset.c
@@ -25,11 +25,10 @@ static struct idset *idset_new(int num_ssid, int num_id)
{
struct idset *set;

- set = vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id));
+ set = vzalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id));
if (set) {
set->num_ssid = num_ssid;
set->num_id = num_id;
- memset(set->bitmap, 0, bitmap_size(num_ssid, num_id));
}
return set;
}
--
2.30.2
\
 
 \ /
  Last update: 2021-12-17 22:38    [W:0.072 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site