diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/mtd/nand | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mtd/nand')
24 files changed, 30 insertions, 30 deletions
diff --git a/drivers/mtd/nand/ecc-sw-bch.c b/drivers/mtd/nand/ecc-sw-bch.c index 8ed20f176521..26d5f3f10964 100644 --- a/drivers/mtd/nand/ecc-sw-bch.c +++ b/drivers/mtd/nand/ecc-sw-bch.c @@ -227,7 +227,7 @@ int nand_ecc_sw_bch_init_ctx(struct nand_device *nand) return -EINVAL; } - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/ecc-sw-hamming.c b/drivers/mtd/nand/ecc-sw-hamming.c index 65fe971a409d..460acc1029c3 100644 --- a/drivers/mtd/nand/ecc-sw-hamming.c +++ b/drivers/mtd/nand/ecc-sw-hamming.c @@ -496,7 +496,7 @@ int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand) if (conf->step_size != 256 && conf->step_size != 512) conf->step_size = 256; - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/generic.c b/drivers/mtd/nand/onenand/generic.c index 69ca617985c8..3191904ced14 100644 --- a/drivers/mtd/nand/onenand/generic.c +++ b/drivers/mtd/nand/onenand/generic.c @@ -37,7 +37,7 @@ static int generic_onenand_probe(struct platform_device *pdev) unsigned long size = resource_size(res); int err; - info = kzalloc_obj(struct onenand_info, GFP_KERNEL); + info = kzalloc_obj(struct onenand_info); if (!info) return -ENOMEM; diff --git a/drivers/mtd/nand/onenand/onenand_bbt.c b/drivers/mtd/nand/onenand/onenand_bbt.c index 380e5051595f..012163fb6add 100644 --- a/drivers/mtd/nand/onenand/onenand_bbt.c +++ b/drivers/mtd/nand/onenand/onenand_bbt.c @@ -231,7 +231,7 @@ int onenand_default_bbt(struct mtd_info *mtd) struct onenand_chip *this = mtd->priv; struct bbm_info *bbm; - this->bbm = kzalloc_obj(struct bbm_info, GFP_KERNEL); + this->bbm = kzalloc_obj(struct bbm_info); if (!this->bbm) return -ENOMEM; diff --git a/drivers/mtd/nand/qpic_common.c b/drivers/mtd/nand/qpic_common.c index 0acd6c65f326..4f3e4dd766da 100644 --- a/drivers/mtd/nand/qpic_common.c +++ b/drivers/mtd/nand/qpic_common.c @@ -156,7 +156,7 @@ int qcom_prepare_bam_async_desc(struct qcom_nand_controller *nandc, enum dma_transfer_direction dir_eng; struct dma_async_tx_descriptor *dma_desc; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; @@ -364,7 +364,7 @@ int qcom_prep_adm_dma_desc(struct qcom_nand_controller *nandc, bool read, struct scatterlist *sgl; int ret; - desc = kzalloc_obj(*desc, GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c index 6b09eb643ed2..f1e99197ab84 100644 --- a/drivers/mtd/nand/raw/au1550nd.c +++ b/drivers/mtd/nand/raw/au1550nd.c @@ -266,7 +266,7 @@ static int au1550nd_probe(struct platform_device *pdev) return -ENODEV; } - ctx = kzalloc_obj(*ctx, GFP_KERNEL); + ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/cafe_nand.c b/drivers/mtd/nand/raw/cafe_nand.c index b05a41ce2e35..65a36d5de742 100644 --- a/drivers/mtd/nand/raw/cafe_nand.c +++ b/drivers/mtd/nand/raw/cafe_nand.c @@ -678,7 +678,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, pci_set_master(pdev); - cafe = kzalloc_obj(*cafe, GFP_KERNEL); + cafe = kzalloc_obj(*cafe); if (!cafe) { err = -ENOMEM; goto out_disable_device; diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c index ca2a7e16b5d8..0b872b1e3b04 100644 --- a/drivers/mtd/nand/raw/cs553x_nand.c +++ b/drivers/mtd/nand/raw/cs553x_nand.c @@ -273,7 +273,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) } /* Allocate memory for MTD device structure and private data */ - controller = kzalloc_obj(*controller, GFP_KERNEL); + controller = kzalloc_obj(*controller); if (!controller) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c index fdca096d74ba..c655d27bc4cc 100644 --- a/drivers/mtd/nand/raw/fsl_elbc_nand.c +++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c @@ -895,13 +895,13 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev) return -ENODEV; } - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; mutex_lock(&fsl_elbc_nand_mutex); if (!fsl_lbc_ctrl_dev->nand) { - elbc_fcm_ctrl = kzalloc_obj(*elbc_fcm_ctrl, GFP_KERNEL); + elbc_fcm_ctrl = kzalloc_obj(*elbc_fcm_ctrl); if (!elbc_fcm_ctrl) { mutex_unlock(&fsl_elbc_nand_mutex); ret = -ENOMEM; diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c index 6eb507f6a204..dd88b22a91bd 100644 --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c @@ -1018,7 +1018,7 @@ static int fsl_ifc_nand_probe(struct platform_device *dev) mutex_lock(&fsl_ifc_nand_mutex); if (!fsl_ifc_ctrl_dev->nand) { - ifc_nand_ctrl = kzalloc_obj(*ifc_nand_ctrl, GFP_KERNEL); + ifc_nand_ctrl = kzalloc_obj(*ifc_nand_ctrl); if (!ifc_nand_ctrl) { mutex_unlock(&fsl_ifc_nand_mutex); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 29f603fb2d8f..770c26f9c6ce 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -1062,7 +1062,7 @@ static int nand_choose_interface_config(struct nand_chip *chip) if (!nand_controller_can_setup_interface(chip)) return 0; - iface = kzalloc_obj(*iface, GFP_KERNEL); + iface = kzalloc_obj(*iface); if (!iface) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_bbt.c b/drivers/mtd/nand/raw/nand_bbt.c index 5e500bf2a3c2..b0e7592a2ab7 100644 --- a/drivers/mtd/nand/raw/nand_bbt.c +++ b/drivers/mtd/nand/raw/nand_bbt.c @@ -1375,7 +1375,7 @@ static int nand_create_badblock_pattern(struct nand_chip *this) pr_warn("Bad block pattern already allocated; not replacing\n"); return -EINVAL; } - bd = kzalloc_obj(*bd, GFP_KERNEL); + bd = kzalloc_obj(*bd); if (!bd) return -ENOMEM; bd->options = this->bbt_options & BADBLOCK_SCAN_MASK; diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c index 12f4e5d1038e..0510ceff591d 100644 --- a/drivers/mtd/nand/raw/nand_hynix.c +++ b/drivers/mtd/nand/raw/nand_hynix.c @@ -705,7 +705,7 @@ static int hynix_nand_init(struct nand_chip *chip) else chip->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; - hynix = kzalloc_obj(*hynix, GFP_KERNEL); + hynix = kzalloc_obj(*hynix); if (!hynix) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c index 8b2725863fbf..b523bf65746b 100644 --- a/drivers/mtd/nand/raw/nand_jedec.c +++ b/drivers/mtd/nand/raw/nand_jedec.c @@ -42,7 +42,7 @@ int nand_jedec_detect(struct nand_chip *chip) return 0; /* JEDEC chip: allocate a buffer to hold its parameter page */ - p = kzalloc_obj(*p, GFP_KERNEL); + p = kzalloc_obj(*p); if (!p) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index b97a2bd606ae..8807b8aade41 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c @@ -484,7 +484,7 @@ static int micron_nand_init(struct nand_chip *chip) int ondie; int ret; - micron = kzalloc_obj(*micron, GFP_KERNEL); + micron = kzalloc_obj(*micron); if (!micron) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/nand_onfi.c b/drivers/mtd/nand/raw/nand_onfi.c index c4e7304372f1..cd3ad373883e 100644 --- a/drivers/mtd/nand/raw/nand_onfi.c +++ b/drivers/mtd/nand/raw/nand_onfi.c @@ -306,7 +306,7 @@ int nand_onfi_detect(struct nand_chip *chip) if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_READ_CACHE) chip->parameters.supports_read_cache = true; - onfi = kzalloc_obj(*onfi, GFP_KERNEL); + onfi = kzalloc_obj(*onfi); if (!onfi) { ret = -ENOMEM; goto free_model; diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c index 4e7ea6c11a15..fe968037f75a 100644 --- a/drivers/mtd/nand/raw/nandsim.c +++ b/drivers/mtd/nand/raw/nandsim.c @@ -851,7 +851,7 @@ static int ns_parse_weakblocks(void) } if (*w == ',') w += 1; - wb = kzalloc_obj(*wb, GFP_KERNEL); + wb = kzalloc_obj(*wb); if (!wb) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -902,7 +902,7 @@ static int ns_parse_weakpages(void) } if (*w == ',') w += 1; - wp = kzalloc_obj(*wp, GFP_KERNEL); + wp = kzalloc_obj(*wp); if (!wp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -953,7 +953,7 @@ static int ns_parse_gravepages(void) } if (*g == ',') g += 1; - gp = kzalloc_obj(*gp, GFP_KERNEL); + gp = kzalloc_obj(*gp); if (!gp) { NS_ERR("unable to allocate memory.\n"); return -ENOMEM; @@ -2268,7 +2268,7 @@ static int __init ns_init_module(void) return -EINVAL; } - ns = kzalloc_obj(struct nandsim, GFP_KERNEL); + ns = kzalloc_obj(struct nandsim); if (!ns) { NS_ERR("unable to allocate core structures.\n"); return -ENOMEM; diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c index 05d3e58c50dc..09409b703d93 100644 --- a/drivers/mtd/nand/raw/pasemi_nand.c +++ b/drivers/mtd/nand/raw/pasemi_nand.c @@ -113,7 +113,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) dev_dbg(dev, "pasemi_nand at %pR\n", &res); /* Allocate memory for MTD device structure and private data */ - ddata = kzalloc_obj(*ddata, GFP_KERNEL); + ddata = kzalloc_obj(*ddata); if (!ddata) { err = -ENOMEM; goto out; diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c index 24e702919b87..8a5572b30893 100644 --- a/drivers/mtd/nand/raw/r852.c +++ b/drivers/mtd/nand/raw/r852.c @@ -867,7 +867,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) error = -ENOMEM; /* init nand chip, but register it only on card insert */ - chip = kzalloc_obj(struct nand_chip, GFP_KERNEL); + chip = kzalloc_obj(struct nand_chip); if (!chip) goto error4; @@ -883,7 +883,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) chip->legacy.write_buf = r852_write_buf; /* init our device structure */ - dev = kzalloc_obj(struct r852_device, GFP_KERNEL); + dev = kzalloc_obj(struct r852_device); if (!dev) goto error5; diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c index d74097783036..4154ab74f169 100644 --- a/drivers/mtd/nand/raw/sharpsl.c +++ b/drivers/mtd/nand/raw/sharpsl.c @@ -132,7 +132,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) } /* Allocate memory for MTD device structure and private data */ - sharpsl = kzalloc_obj(struct sharpsl_nand, GFP_KERNEL); + sharpsl = kzalloc_obj(struct sharpsl_nand); if (!sharpsl) return -ENOMEM; diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c index e49c38abef68..4cc6e91dbc23 100644 --- a/drivers/mtd/nand/raw/txx9ndfmc.c +++ b/drivers/mtd/nand/raw/txx9ndfmc.c @@ -319,7 +319,7 @@ static int txx9ndfmc_probe(struct platform_device *dev) if (!(plat->ch_mask & (1 << i))) continue; - txx9_priv = kzalloc_obj(struct txx9ndfmc_priv, GFP_KERNEL); + txx9_priv = kzalloc_obj(struct txx9ndfmc_priv); if (!txx9_priv) continue; chip = &txx9_priv->chip; diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 86dee7d13a38..8aa3753aaaa1 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -350,7 +350,7 @@ static int spinand_ondie_ecc_init_ctx(struct nand_device *nand) nand->ecc.ctx.conf.step_size = nand->ecc.requirements.step_size; nand->ecc.ctx.conf.strength = nand->ecc.requirements.strength; - engine_conf = kzalloc_obj(*engine_conf, GFP_KERNEL); + engine_conf = kzalloc_obj(*engine_conf); if (!engine_conf) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index 137571093ec0..a6d6d6e0cc37 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -642,7 +642,7 @@ static int gd5fxgm9_spinand_init(struct spinand_device *spinand) { struct gigadevice_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index 2e6b9be9c58b..67cafa1bb8ef 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -499,7 +499,7 @@ static int macronix_spinand_init(struct spinand_device *spinand) { struct macronix_priv *priv; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; |
