mmc: core: remove uselss memalloc_noio_save
PATCH 1/1 mmc: core: remove uselss memalloc_noio_save
mmc_sd_num_wr_blocks() is in the block error path. It needs to use GFP_NOIO. There is no need to complicate anything here.
Fixes 869d37475788 ("mmc: core: Use GFP_NOIO in ACMD22")
Signed-off-by Oliver Neukum <[email protected]>
--- drivers/mmc/core/block.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/core/block.c +1 -4
@@ -995,7 +995,6 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)u32 result;__be32 *blocks;u8 resp_sz =mmc_card_ult_capacity (card) ?8 :4 ; -unsigned int noio_flag;struct mmc_request mrq = {};struct mmc_command cmd = {};
@@ -1020,9 +1019,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks) mrq.cmd = &cmd; mrq.data = &data; - noio_flag =memalloc_noio_save (); - blocks =kmalloc (resp_sz,GFP_KERNEL ); -memalloc_noio_restore (noio_flag); + blocks =kmalloc (resp_sz,GFP_NOIO );if (!blocks)return -ENOMEM ;
Signature · 1 line
2.51.0
Quoted 6 lines · Oliver Neukum
mmc_sd_num_wr_blocks()is in the block error path. It needs to useGFP_NOIO. There is no need to complicate anything here.Fixes 869d37475788 ("mmc: core: Use GFP_NOIO in ACMD22")
Is this really something that should be considered as a fix? Is there something broken or we are just cleaning up the code?
Quoted 29 lines
Signed-off-by Oliver Neukum <[email protected]>--- drivers/mmc/core/block.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mmc/core/block.c +1
-5@@ -995,7 +995,6 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)u32 result;__be32 *blocks;u8 resp_sz =mmc_card_ult_capacity (card) ?8 :4 ; -unsigned int noio_flag;struct mmc_request mrq = {};struct mmc_command cmd = {};@@ -1020,9 +1019,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks) mrq.cmd = &cmd; mrq.data = &data; - noio_flag =memalloc_noio_save (); - blocks =kmalloc (resp_sz,GFP_KERNEL ); -memalloc_noio_restore (noio_flag); + blocks =kmalloc (resp_sz,GFP_NOIO );if (!blocks)return -ENOMEM ; --
Quoted 2 lines
2.51.0
Kind regards
Uffe
Quoted 7 lines · Oliver Neukum
mmc_sd_num_wr_blocks()is in the block error path. It needs to useGFP_NOIO. There is no need to complicate anything here.Fixes 869d37475788 ("mmc: core: Use GFP_NOIO in ACMD22")Signed-off-by Oliver Neukum <[email protected]>
Applied for next and I also decided to drop the fixes tag, thanks!
Kind regards
Uffe
Quoted 30 lines
--- drivers/mmc/core/block.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mmc/core/block.c +1
-5@@ -995,7 +995,6 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)u32 result;__be32 *blocks;u8 resp_sz =mmc_card_ult_capacity (card) ?8 :4 ; -unsigned int noio_flag;struct mmc_request mrq = {};struct mmc_command cmd = {};@@ -1020,9 +1019,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks) mrq.cmd = &cmd; mrq.data = &data; - noio_flag =memalloc_noio_save (); - blocks =kmalloc (resp_sz,GFP_KERNEL ); -memalloc_noio_restore (noio_flag); + blocks =kmalloc (resp_sz,GFP_NOIO );if (!blocks)return -ENOMEM ; --2.51.0