Skip to content

Commit d4f00a5

Browse files
author
Mikulas Patocka
committed
dm-ima: drop a useless argument
The "gfp_t flags" is always GFP_KERNEL, so it can be removed. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent c379717 commit d4f00a5

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

drivers/md/dm-ima.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ static void fix_separator_chars(char **buf)
4545
/*
4646
* Internal function to allocate memory for IMA measurements.
4747
*/
48-
static void *dm_ima_alloc(size_t len, gfp_t flags, bool noio)
48+
static void *dm_ima_alloc(size_t len, bool noio)
4949
{
5050
unsigned int noio_flag;
5151
void *ptr;
5252

5353
if (noio)
5454
noio_flag = memalloc_noio_save();
5555

56-
ptr = kzalloc(len, flags);
56+
ptr = kzalloc(len, GFP_KERNEL);
5757

5858
if (noio)
5959
memalloc_noio_restore(noio_flag);
@@ -68,13 +68,13 @@ static int dm_ima_alloc_and_copy_name_uuid(struct mapped_device *md, char **dev_
6868
char **dev_uuid, bool noio)
6969
{
7070
int r;
71-
*dev_name = dm_ima_alloc(DM_NAME_LEN*2, GFP_KERNEL, noio);
71+
*dev_name = dm_ima_alloc(DM_NAME_LEN*2, noio);
7272
if (!(*dev_name)) {
7373
r = -ENOMEM;
7474
goto error;
7575
}
7676

77-
*dev_uuid = dm_ima_alloc(DM_UUID_LEN*2, GFP_KERNEL, noio);
77+
*dev_uuid = dm_ima_alloc(DM_UUID_LEN*2, noio);
7878
if (!(*dev_uuid)) {
7979
r = -ENOMEM;
8080
goto error;
@@ -109,7 +109,7 @@ static int dm_ima_alloc_and_copy_device_data(struct mapped_device *md, char **de
109109
if (r)
110110
return r;
111111

112-
*device_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, GFP_KERNEL, noio);
112+
*device_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, noio);
113113
if (!(*device_data)) {
114114
r = -ENOMEM;
115115
goto error;
@@ -153,7 +153,7 @@ static int dm_ima_alloc_and_copy_capacity_str(struct mapped_device *md, char **c
153153

154154
capacity = get_capacity(md->disk);
155155

156-
*capacity_str = dm_ima_alloc(DM_IMA_DEVICE_CAPACITY_BUF_LEN, GFP_KERNEL, noio);
156+
*capacity_str = dm_ima_alloc(DM_IMA_DEVICE_CAPACITY_BUF_LEN, noio);
157157
if (!(*capacity_str))
158158
return -ENOMEM;
159159

@@ -193,15 +193,15 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
193193
const size_t hash_alg_prefix_len = strlen(DM_IMA_TABLE_HASH_ALG) + 1;
194194
char table_load_event_name[] = "dm_table_load";
195195

196-
ima_buf = dm_ima_alloc(DM_IMA_MEASUREMENT_BUF_LEN, GFP_KERNEL, noio);
196+
ima_buf = dm_ima_alloc(DM_IMA_MEASUREMENT_BUF_LEN, noio);
197197
if (!ima_buf)
198198
return;
199199

200-
target_metadata_buf = dm_ima_alloc(DM_IMA_TARGET_METADATA_BUF_LEN, GFP_KERNEL, noio);
200+
target_metadata_buf = dm_ima_alloc(DM_IMA_TARGET_METADATA_BUF_LEN, noio);
201201
if (!target_metadata_buf)
202202
goto error;
203203

204-
target_data_buf = dm_ima_alloc(DM_IMA_TARGET_DATA_BUF_LEN, GFP_KERNEL, noio);
204+
target_data_buf = dm_ima_alloc(DM_IMA_TARGET_DATA_BUF_LEN, noio);
205205
if (!target_data_buf)
206206
goto error;
207207

@@ -216,7 +216,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
216216

217217
shash->tfm = tfm;
218218
digest_size = crypto_shash_digestsize(tfm);
219-
digest = dm_ima_alloc(digest_size, GFP_KERNEL, noio);
219+
digest = dm_ima_alloc(digest_size, noio);
220220
if (!digest)
221221
goto error;
222222

@@ -325,7 +325,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
325325
if (r < 0)
326326
goto error;
327327

328-
digest_buf = dm_ima_alloc((digest_size*2) + hash_alg_prefix_len + 1, GFP_KERNEL, noio);
328+
digest_buf = dm_ima_alloc((digest_size*2) + hash_alg_prefix_len + 1, noio);
329329

330330
if (!digest_buf)
331331
goto error;
@@ -375,7 +375,7 @@ void dm_ima_measure_on_device_resume(struct mapped_device *md, bool swap)
375375
bool nodata = true;
376376
int capacity_len;
377377

378-
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, GFP_KERNEL, noio);
378+
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, noio);
379379
if (!device_table_data)
380380
return;
381381

@@ -484,7 +484,7 @@ void dm_ima_measure_on_device_remove(struct mapped_device *md, bool remove_all)
484484
bool nodata = true;
485485
int capacity_len;
486486

487-
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN*2, GFP_KERNEL, noio);
487+
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN*2, noio);
488488
if (!device_table_data)
489489
goto exit;
490490

@@ -604,7 +604,7 @@ void dm_ima_measure_on_table_clear(struct mapped_device *md, bool new_map)
604604
bool nodata = true;
605605
int capacity_len;
606606

607-
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, GFP_KERNEL, noio);
607+
device_table_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN, noio);
608608
if (!device_table_data)
609609
return;
610610

@@ -705,7 +705,7 @@ void dm_ima_measure_on_device_rename(struct mapped_device *md)
705705
if (dm_ima_alloc_and_copy_name_uuid(md, &new_dev_name, &new_dev_uuid, noio))
706706
goto error;
707707

708-
combined_device_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN * 2, GFP_KERNEL, noio);
708+
combined_device_data = dm_ima_alloc(DM_IMA_DEVICE_BUF_LEN * 2, noio);
709709
if (!combined_device_data)
710710
goto error;
711711

0 commit comments

Comments
 (0)