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>
This commit is contained in:
Linus Torvalds 2026-02-21 16:37:42 -08:00
parent e19e1b480a
commit bf4afc53b7
6673 changed files with 13013 additions and 13013 deletions

View file

@ -104,7 +104,7 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx,
struct ac97_codec_device *codec;
int ret;
codec = kzalloc_obj(*codec, GFP_KERNEL);
codec = kzalloc_obj(*codec);
if (!codec)
return -ENOMEM;
ac97_ctrl->codecs[idx] = codec;
@ -351,7 +351,7 @@ struct ac97_controller *snd_ac97_controller_register(
struct ac97_controller *ac97_ctrl;
int ret, i;
ac97_ctrl = kzalloc_obj(*ac97_ctrl, GFP_KERNEL);
ac97_ctrl = kzalloc_obj(*ac97_ctrl);
if (!ac97_ctrl)
return ERR_PTR(-ENOMEM);

View file

@ -69,7 +69,7 @@ struct snd_ac97 *snd_ac97_compat_alloc(struct ac97_codec_device *adev)
struct snd_ac97 *ac97;
int ret;
ac97 = kzalloc_obj(struct snd_ac97, GFP_KERNEL);
ac97 = kzalloc_obj(struct snd_ac97);
if (ac97 == NULL)
return ERR_PTR(-ENOMEM);

View file

@ -959,7 +959,7 @@ static int onyx_i2c_probe(struct i2c_client *client)
struct onyx *onyx;
u8 dummy;
onyx = kzalloc_obj(struct onyx, GFP_KERNEL);
onyx = kzalloc_obj(struct onyx);
if (!onyx)
return -ENOMEM;

View file

@ -845,7 +845,7 @@ static int tas_i2c_probe(struct i2c_client *client)
struct device_node *node = client->dev.of_node;
struct tas *tas;
tas = kzalloc_obj(struct tas, GFP_KERNEL);
tas = kzalloc_obj(struct tas);
if (!tas)
return -ENOMEM;

View file

@ -121,7 +121,7 @@ static struct toonie *toonie;
static int __init toonie_init(void)
{
toonie = kzalloc_obj(struct toonie, GFP_KERNEL);
toonie = kzalloc_obj(struct toonie);
if (!toonie)
return -ENOMEM;

View file

@ -173,7 +173,7 @@ static int pmf_set_notify(struct gpio_runtime *rt,
notif->gpio_private = NULL;
}
if (!old && notify) {
irq_client = kzalloc_obj(struct pmf_irq_client, GFP_KERNEL);
irq_client = kzalloc_obj(struct pmf_irq_client);
if (!irq_client)
return -ENOMEM;
irq_client->data = notif;

View file

@ -1025,7 +1025,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
goto outnodev;
}
ldev = kzalloc_obj(struct layout_dev, GFP_KERNEL);
ldev = kzalloc_obj(struct layout_dev);
if (!ldev)
goto outnodev;

View file

@ -19,7 +19,7 @@
int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c)
{
*c = kzalloc_obj(struct i2sbus_control, GFP_KERNEL);
*c = kzalloc_obj(struct i2sbus_control);
if (!*c)
return -ENOMEM;

View file

@ -171,7 +171,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
if (strncmp(node_name, "i2s-", 4))
return 0;
dev = kzalloc_obj(struct i2sbus_dev, GFP_KERNEL);
dev = kzalloc_obj(struct i2sbus_dev);
if (!dev)
return 0;

View file

@ -879,7 +879,7 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
tmp++;
}
cii = kzalloc_obj(struct codec_info_item, GFP_KERNEL);
cii = kzalloc_obj(struct codec_info_item);
if (!cii)
return -ENOMEM;

View file

@ -519,7 +519,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
return -ENXIO;
struct snd_compr_codec_caps *caps __free(kfree) =
kzalloc_obj(*caps, GFP_KERNEL);
kzalloc_obj(*caps);
if (!caps)
return -ENOMEM;
@ -539,7 +539,7 @@ int snd_compr_malloc_pages(struct snd_compr_stream *stream, size_t size)
if (snd_BUG_ON(!(stream) || !(stream)->runtime))
return -EINVAL;
dmab = kzalloc_obj(*dmab, GFP_KERNEL);
dmab = kzalloc_obj(*dmab);
if (!dmab)
return -ENOMEM;
dmab->dev = stream->dma_buffer.dev;
@ -694,7 +694,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg)
return -EBADFD;
struct snd_codec *params __free(kfree) =
kzalloc_obj(*params, GFP_KERNEL);
kzalloc_obj(*params);
if (!params)
return -ENOMEM;
retval = stream->ops->get_params(stream, params);
@ -1066,7 +1066,7 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
return -EBUSY;
if (utask->origin_seqno != 0 || utask->input_size != 0)
return -EINVAL;
task = kzalloc_obj(*task, GFP_KERNEL);
task = kzalloc_obj(*task);
if (task == NULL)
return -ENOMEM;
task->seqno = utask->seqno = snd_compr_seqno_next(stream);

View file

@ -2057,7 +2057,7 @@ static int _snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn, struct list_head *
{
struct snd_kctl_ioctl *pn;
pn = kzalloc_obj(struct snd_kctl_ioctl, GFP_KERNEL);
pn = kzalloc_obj(struct snd_kctl_ioctl);
if (pn == NULL)
return -ENOMEM;
pn->fioctl = fcn;

View file

@ -82,7 +82,7 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl,
struct snd_card *card = ctl->card;
int err;
struct snd_ctl_elem_info *data __free(kfree) =
kzalloc_obj(*data, GFP_KERNEL);
kzalloc_obj(*data);
if (! data)
return -ENOMEM;
@ -177,7 +177,7 @@ static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id,
return -ENOENT;
struct snd_ctl_elem_info *info __free(kfree) =
kzalloc_obj(*info, GFP_KERNEL);
kzalloc_obj(*info);
if (info == NULL)
return -ENOMEM;
info->id = *id;
@ -283,7 +283,7 @@ static int __ctl_elem_read_user(struct snd_card *card,
{
int err, type, count;
struct snd_ctl_elem_value *data __free(kfree) =
kzalloc_obj(*data, GFP_KERNEL);
kzalloc_obj(*data);
if (data == NULL)
return -ENOMEM;
@ -318,7 +318,7 @@ static int __ctl_elem_write_user(struct snd_ctl_file *file,
struct snd_card *card = file->card;
int err, type, count;
struct snd_ctl_elem_value *data __free(kfree) =
kzalloc_obj(*data, GFP_KERNEL);
kzalloc_obj(*data);
if (data == NULL)
return -ENOMEM;
@ -380,7 +380,7 @@ static int snd_ctl_elem_add_compat(struct snd_ctl_file *file,
int replace)
{
struct snd_ctl_elem_info *data __free(kfree) =
kzalloc_obj(*data, GFP_KERNEL);
kzalloc_obj(*data);
if (! data)
return -ENOMEM;

View file

@ -653,7 +653,7 @@ static void snd_ctl_led_sysfs_add(struct snd_card *card)
for (group = 0; group < MAX_LED; group++) {
led = &snd_ctl_leds[group];
led_card = kzalloc_obj(*led_card, GFP_KERNEL);
led_card = kzalloc_obj(*led_card);
if (!led_card)
goto cerr2;
led_card->number = card->number;

View file

@ -34,7 +34,7 @@ int snd_device_new(struct snd_card *card, enum snd_device_type type,
if (snd_BUG_ON(!card || !device_data || !ops))
return -ENXIO;
dev = kzalloc_obj(*dev, GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
INIT_LIST_HEAD(&dev->list);

View file

@ -64,7 +64,7 @@ static int snd_hrtimer_open(struct snd_timer *t)
{
struct snd_hrtimer *stime;
stime = kzalloc_obj(*stime, GFP_KERNEL);
stime = kzalloc_obj(*stime);
if (!stime)
return -ENOMEM;
stime->timer = t;

View file

@ -375,7 +375,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device,
return -ENXIO;
if (rhwdep)
*rhwdep = NULL;
hwdep = kzalloc_obj(*hwdep, GFP_KERNEL);
hwdep = kzalloc_obj(*hwdep);
if (!hwdep)
return -ENOMEM;

View file

@ -79,7 +79,7 @@ static int alloc_info_private(struct snd_info_entry *entry,
return -ENODEV;
if (!try_module_get(entry->module))
return -EFAULT;
data = kzalloc_obj(*data, GFP_KERNEL);
data = kzalloc_obj(*data);
if (!data) {
module_put(entry->module);
return -ENOMEM;
@ -311,7 +311,7 @@ static ssize_t snd_info_text_entry_write(struct file *file,
guard(mutex)(&entry->access);
buf = data->wbuffer;
if (!buf) {
data->wbuffer = buf = kzalloc_obj(*buf, GFP_KERNEL);
data->wbuffer = buf = kzalloc_obj(*buf);
if (!buf)
return -ENOMEM;
}
@ -355,7 +355,7 @@ static int snd_info_text_entry_open(struct inode *inode, struct file *file)
if (err < 0)
return err;
data->rbuffer = kzalloc_obj(*data->rbuffer, GFP_KERNEL);
data->rbuffer = kzalloc_obj(*data->rbuffer);
if (!data->rbuffer) {
err = -ENOMEM;
goto error;
@ -663,7 +663,7 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent,
struct module *module)
{
struct snd_info_entry *entry;
entry = kzalloc_obj(*entry, GFP_KERNEL);
entry = kzalloc_obj(*entry);
if (entry == NULL)
return NULL;
entry->name = kstrdup(name, GFP_KERNEL);

View file

@ -129,7 +129,7 @@ int snd_device_alloc(struct device **dev_p, struct snd_card *card)
struct device *dev;
*dev_p = NULL;
dev = kzalloc_obj(*dev, GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
device_initialize(dev);
@ -1060,7 +1060,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file)
{
struct snd_monitor_file *mfile;
mfile = kmalloc_obj(*mfile, GFP_KERNEL);
mfile = kmalloc_obj(*mfile);
if (mfile == NULL)
return -ENOMEM;
mfile->file = file;

View file

@ -440,7 +440,7 @@ static struct snd_jack_kctl * snd_jack_kctl_new(struct snd_card *card, const cha
if (err < 0)
return NULL;
jack_kctl = kzalloc_obj(*jack_kctl, GFP_KERNEL);
jack_kctl = kzalloc_obj(*jack_kctl);
if (!jack_kctl)
goto error;
@ -516,7 +516,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
return -ENOMEM;
}
jack = kzalloc_obj(struct snd_jack, GFP_KERNEL);
jack = kzalloc_obj(struct snd_jack);
if (jack == NULL)
return -ENOMEM;

View file

@ -719,12 +719,12 @@ static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size)
unsigned int idx, npages;
void *p;
sgbuf = kzalloc_obj(*sgbuf, GFP_KERNEL);
sgbuf = kzalloc_obj(*sgbuf);
if (!sgbuf)
return NULL;
size = PAGE_ALIGN(size);
sgbuf->count = size >> PAGE_SHIFT;
sgbuf->pages = kvzalloc_objs(*sgbuf->pages, sgbuf->count, GFP_KERNEL);
sgbuf->pages = kvzalloc_objs(*sgbuf->pages, sgbuf->count);
sgbuf->npages = kvcalloc(sgbuf->count, sizeof(*sgbuf->npages), GFP_KERNEL);
if (!sgbuf->pages || !sgbuf->npages)
goto error;

View file

@ -47,7 +47,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
snd_card_unref(card);
return err;
}
fmixer = kzalloc_obj(*fmixer, GFP_KERNEL);
fmixer = kzalloc_obj(*fmixer);
if (fmixer == NULL) {
snd_card_file_remove(card, file);
snd_card_unref(card);
@ -530,9 +530,9 @@ static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer,
return;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
@ -566,9 +566,9 @@ static void snd_mixer_oss_get_volume1_sw(struct snd_mixer_oss_file *fmixer,
return;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
@ -629,9 +629,9 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer,
return;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
@ -669,9 +669,9 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer,
return;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return;
if (kctl->info(kctl, uinfo))
@ -798,9 +798,9 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
int err, idx;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return -ENOMEM;
guard(rwsem_read)(&card->controls_rwsem);
@ -843,9 +843,9 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
unsigned int idx;
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (uinfo == NULL || uctl == NULL)
return -ENOMEM;
guard(rwsem_read)(&card->controls_rwsem);
@ -1027,7 +1027,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
if (kctl) {
struct snd_ctl_elem_info *uinfo __free(kfree) =
kzalloc_obj(*uinfo, GFP_KERNEL);
kzalloc_obj(*uinfo);
if (!uinfo)
return -ENOMEM;
@ -1055,7 +1055,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
}
}
if (slot.present != 0) {
pslot = kmalloc_obj(slot, GFP_KERNEL);
pslot = kmalloc_obj(slot);
if (! pslot)
return -ENOMEM;
*pslot = slot;
@ -1315,7 +1315,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd)
if (cmd == SND_MIXER_OSS_NOTIFY_REGISTER) {
int idx, err;
mixer = kzalloc_objs(*mixer, 2, GFP_KERNEL);
mixer = kzalloc_objs(*mixer, 2);
if (mixer == NULL)
return -ENOMEM;
mutex_init(&mixer->reg_mutex);

View file

@ -398,7 +398,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
}
struct snd_pcm_hw_params *save __free(kfree) =
kmalloc_obj(*save, GFP_KERNEL);
kmalloc_obj(*save);
if (save == NULL)
return -ENOMEM;
*save = *params;
@ -411,7 +411,7 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
goto _end;
struct snd_pcm_hw_params *params1 __free(kfree) =
kmalloc_obj(*params1, GFP_KERNEL);
kmalloc_obj(*params1);
if (params1 == NULL)
return -ENOMEM;
*params1 = *save;
@ -786,7 +786,7 @@ static int choose_rate(struct snd_pcm_substream *substream,
unsigned int rate, prev;
struct snd_pcm_hw_params *save __free(kfree) =
kmalloc_obj(*save, GFP_KERNEL);
kmalloc_obj(*save);
if (save == NULL)
return -ENOMEM;
*save = *params;
@ -861,9 +861,9 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
if (!runtime->oss.params)
return 0;
sw_params = kzalloc_obj(*sw_params, GFP_KERNEL);
params = kmalloc_obj(*params, GFP_KERNEL);
sparams = kmalloc_obj(*sparams, GFP_KERNEL);
sw_params = kzalloc_obj(*sw_params);
params = kmalloc_obj(*params);
sparams = kmalloc_obj(*sparams);
if (!sw_params || !params || !sparams) {
err = -ENOMEM;
goto failure;
@ -1859,7 +1859,7 @@ static int snd_pcm_oss_get_formats(struct snd_pcm_oss_file *pcm_oss_file)
AFMT_S24_PACKED;
struct snd_pcm_hw_params *params __free(kfree) =
kmalloc_obj(*params, GFP_KERNEL);
kmalloc_obj(*params);
if (!params)
return -ENOMEM;
_snd_pcm_hw_params_any(params);
@ -2418,7 +2418,7 @@ static int snd_pcm_oss_open_file(struct file *file,
if (rpcm_oss_file)
*rpcm_oss_file = NULL;
pcm_oss_file = kzalloc_obj(*pcm_oss_file, GFP_KERNEL);
pcm_oss_file = kzalloc_obj(*pcm_oss_file);
if (pcm_oss_file == NULL)
return -ENOMEM;
@ -3032,7 +3032,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,
}
} while (*str);
if (setup == NULL) {
setup = kmalloc_obj(*setup, GFP_KERNEL);
setup = kmalloc_obj(*setup);
if (! setup) {
buffer->error = -ENOMEM;
return;

View file

@ -334,7 +334,7 @@ static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
return;
struct snd_pcm_info *info __free(kfree) =
kmalloc_obj(*info, GFP_KERNEL);
kmalloc_obj(*info);
if (!info)
return;
@ -657,7 +657,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
}
prev = NULL;
for (idx = 0, prev = NULL; idx < substream_count; idx++) {
substream = kzalloc_obj(*substream, GFP_KERNEL);
substream = kzalloc_obj(*substream);
if (!substream)
return -ENOMEM;
substream->pcm = pcm;
@ -713,7 +713,7 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
return -ENXIO;
if (rpcm)
*rpcm = NULL;
pcm = kzalloc_obj(*pcm, GFP_KERNEL);
pcm = kzalloc_obj(*pcm);
if (!pcm)
return -ENOMEM;
pcm->card = card;
@ -935,7 +935,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
if (substream == NULL)
return -EAGAIN;
runtime = kzalloc_obj(*runtime, GFP_KERNEL);
runtime = kzalloc_obj(*runtime);
if (runtime == NULL)
return -ENOMEM;

View file

@ -243,7 +243,7 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
return -ENOTTY;
struct snd_pcm_hw_params *data __free(kfree) =
kmalloc_obj(*data, GFP_KERNEL);
kmalloc_obj(*data);
if (!data)
return -ENOMEM;

View file

@ -318,7 +318,7 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
prtd = kzalloc_obj(*prtd, GFP_KERNEL);
prtd = kzalloc_obj(*prtd);
if (!prtd)
return -ENOMEM;

View file

@ -2601,7 +2601,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
if (WARN_ON(pcm->streams[stream].chmap_kctl))
return -EBUSY;
info = kzalloc_obj(*info, GFP_KERNEL);
info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
info->pcm = pcm;

View file

@ -448,7 +448,7 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size)
/* dma_max=0 means the fixed size preallocation */
if (substream->dma_buffer.area && !substream->dma_max)
return -ENOMEM;
dmab = kzalloc_obj(*dmab, GFP_KERNEL);
dmab = kzalloc_obj(*dmab);
if (! dmab)
return -ENOMEM;
dmab->dev = substream->dma_buffer.dev;

View file

@ -244,7 +244,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,
{
int err;
struct snd_pcm_info *info __free(kfree) =
kmalloc_obj(*info, GFP_KERNEL);
kmalloc_obj(*info);
if (! info)
return -ENOMEM;
@ -2812,7 +2812,7 @@ static int snd_pcm_open_file(struct file *file,
if (err < 0)
return err;
pcm_file = kzalloc_obj(*pcm_file, GFP_KERNEL);
pcm_file = kzalloc_obj(*pcm_file);
if (pcm_file == NULL) {
snd_pcm_release_substream(substream);
return -ENOMEM;
@ -4111,7 +4111,7 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
int err;
struct snd_pcm_hw_params *params __free(kfree) =
kmalloc_obj(*params, GFP_KERNEL);
kmalloc_obj(*params);
if (!params)
return -ENOMEM;
@ -4140,7 +4140,7 @@ static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
int err;
struct snd_pcm_hw_params *params __free(kfree) =
kmalloc_obj(*params, GFP_KERNEL);
kmalloc_obj(*params);
if (!params)
return -ENOMEM;

View file

@ -159,7 +159,7 @@ static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream)
{
struct snd_rawmidi_runtime *runtime;
runtime = kzalloc_obj(*runtime, GFP_KERNEL);
runtime = kzalloc_obj(*runtime);
if (!runtime)
return -ENOMEM;
runtime->substream = substream;
@ -472,7 +472,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
fflags = snd_rawmidi_file_flags(file);
if ((file->f_flags & O_APPEND) || maj == SOUND_MAJOR) /* OSS emul? */
fflags |= SNDRV_RAWMIDI_LFLG_APPEND;
rawmidi_file = kmalloc_obj(*rawmidi_file, GFP_KERNEL);
rawmidi_file = kmalloc_obj(*rawmidi_file);
if (rawmidi_file == NULL) {
err = -ENOMEM;
goto __error;
@ -1803,7 +1803,7 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi,
int idx;
for (idx = 0; idx < count; idx++) {
substream = kzalloc_obj(*substream, GFP_KERNEL);
substream = kzalloc_obj(*substream);
if (!substream)
return -ENOMEM;
substream->stream = direction;
@ -1891,7 +1891,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device,
if (rrawmidi)
*rrawmidi = NULL;
rmidi = kzalloc_obj(*rmidi, GFP_KERNEL);
rmidi = kzalloc_obj(*rmidi);
if (!rmidi)
return -ENOMEM;
err = snd_rawmidi_init(rmidi, card, id, device,

View file

@ -65,7 +65,7 @@ snd_seq_oss_create_client(void)
int rc;
struct snd_seq_port_callback port_callback;
struct snd_seq_port_info *port __free(kfree) =
kzalloc_obj(*port, GFP_KERNEL);
kzalloc_obj(*port);
if (!port)
return -ENOMEM;
@ -168,7 +168,7 @@ snd_seq_oss_open(struct file *file, int level)
int i, rc;
struct seq_oss_devinfo *dp;
dp = kzalloc_obj(*dp, GFP_KERNEL);
dp = kzalloc_obj(*dp);
if (!dp)
return -ENOMEM;

View file

@ -66,9 +66,9 @@ int
snd_seq_oss_midi_lookup_ports(int client)
{
struct snd_seq_client_info *clinfo __free(kfree) =
kzalloc_obj(*clinfo, GFP_KERNEL);
kzalloc_obj(*clinfo);
struct snd_seq_port_info *pinfo __free(kfree) =
kzalloc_obj(*pinfo, GFP_KERNEL);
kzalloc_obj(*pinfo);
if (!clinfo || !pinfo)
return -ENOMEM;
@ -153,7 +153,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo)
/*
* allocate midi info record
*/
mdev = kzalloc_obj(*mdev, GFP_KERNEL);
mdev = kzalloc_obj(*mdev);
if (!mdev)
return -ENOMEM;

View file

@ -34,11 +34,11 @@ snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen)
{
struct seq_oss_readq *q;
q = kzalloc_obj(*q, GFP_KERNEL);
q = kzalloc_obj(*q);
if (!q)
return NULL;
q->q = kzalloc_objs(union evrec, maxlen, GFP_KERNEL);
q->q = kzalloc_objs(union evrec, maxlen);
if (!q->q) {
kfree(q);
return NULL;

View file

@ -34,7 +34,7 @@ snd_seq_oss_timer_new(struct seq_oss_devinfo *dp)
{
struct seq_oss_timer *rec;
rec = kzalloc_obj(*rec, GFP_KERNEL);
rec = kzalloc_obj(*rec);
if (rec == NULL)
return NULL;

View file

@ -27,7 +27,7 @@ snd_seq_oss_writeq_new(struct seq_oss_devinfo *dp, int maxlen)
struct seq_oss_writeq *q;
struct snd_seq_client_pool pool;
q = kzalloc_obj(*q, GFP_KERNEL);
q = kzalloc_obj(*q);
if (!q)
return NULL;
q->dp = dp;

View file

@ -33,7 +33,7 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
{
int err;
struct snd_seq_port_info *data __free(kfree) =
kmalloc_obj(*data, GFP_KERNEL);
kmalloc_obj(*data);
if (!data)
return -ENOMEM;

View file

@ -115,7 +115,7 @@ create_port(int idx, int type)
struct snd_seq_port_callback pcb;
struct snd_seq_dummy_port *rec;
rec = kzalloc_obj(*rec, GFP_KERNEL);
rec = kzalloc_obj(*rec);
if (!rec)
return NULL;

View file

@ -19,7 +19,7 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize)
{
struct snd_seq_fifo *f;
f = kzalloc_obj(*f, GFP_KERNEL);
f = kzalloc_obj(*f);
if (!f)
return NULL;

View file

@ -517,7 +517,7 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize)
struct snd_seq_pool *pool;
/* create pool block */
pool = kzalloc_obj(*pool, GFP_KERNEL);
pool = kzalloc_obj(*pool);
if (!pool)
return NULL;
spin_lock_init(&pool->lock);

View file

@ -281,7 +281,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev)
return -EINVAL;
struct snd_rawmidi_info *info __free(kfree) =
kmalloc_obj(*info, GFP_KERNEL);
kmalloc_obj(*info);
if (! info)
return -ENOMEM;
info->device = device;
@ -305,7 +305,7 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev)
client = synths[card->number];
if (client == NULL) {
newclient = 1;
client = kzalloc_obj(*client, GFP_KERNEL);
client = kzalloc_obj(*client);
if (client == NULL)
return -ENOMEM;
client->seq_client =
@ -318,10 +318,10 @@ snd_seq_midisynth_probe(struct snd_seq_device *dev)
}
}
msynth = kzalloc_objs(struct seq_midisynth, ports, GFP_KERNEL);
msynth = kzalloc_objs(struct seq_midisynth, ports);
struct snd_seq_port_info *port __free(kfree) =
kmalloc_obj(*port, GFP_KERNEL);
kmalloc_obj(*port);
if (msynth == NULL || port == NULL)
goto __nomem;

View file

@ -650,7 +650,7 @@ static struct snd_midi_channel *snd_midi_channel_init_set(int n)
struct snd_midi_channel *chan;
int i;
chan = kmalloc_objs(struct snd_midi_channel, n, GFP_KERNEL);
chan = kmalloc_objs(struct snd_midi_channel, n);
if (chan) {
for (i = 0; i < n; i++)
snd_midi_channel_init(chan+i, i);
@ -688,7 +688,7 @@ struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n)
{
struct snd_midi_channel_set *chset;
chset = kmalloc_obj(*chset, GFP_KERNEL);
chset = kmalloc_obj(*chset);
if (chset) {
chset->channels = snd_midi_channel_init_set(n);
chset->private_data = NULL;

View file

@ -104,7 +104,7 @@ int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev)
struct snd_midi_event *dev;
*rdev = NULL;
dev = kzalloc_obj(*dev, GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (dev == NULL)
return -ENOMEM;
if (bufsize > 0) {

View file

@ -129,7 +129,7 @@ int snd_seq_create_port(struct snd_seq_client *client, int port,
}
/* create a new port */
new_port = kzalloc_obj(*new_port, GFP_KERNEL);
new_port = kzalloc_obj(*new_port);
if (!new_port)
return -ENOMEM; /* failure, out of memory */
/* init port data */
@ -572,7 +572,7 @@ int snd_seq_port_connect(struct snd_seq_client *connector,
bool exclusive;
int err;
subs = kzalloc_obj(*subs, GFP_KERNEL);
subs = kzalloc_obj(*subs);
if (!subs)
return -ENOMEM;

View file

@ -43,7 +43,7 @@ struct snd_seq_prioq *snd_seq_prioq_new(void)
{
struct snd_seq_prioq *f;
f = kzalloc_obj(*f, GFP_KERNEL);
f = kzalloc_obj(*f);
if (!f)
return NULL;

View file

@ -89,7 +89,7 @@ static struct snd_seq_queue *queue_new(int owner, int locked)
{
struct snd_seq_queue *q;
q = kzalloc_obj(*q, GFP_KERNEL);
q = kzalloc_obj(*q);
if (!q)
return NULL;

View file

@ -130,7 +130,7 @@ int __init snd_seq_system_client_init(void)
struct snd_seq_port_info *port;
int err;
port = kzalloc_obj(*port, GFP_KERNEL);
port = kzalloc_obj(*port);
if (!port)
return -ENOMEM;

View file

@ -43,7 +43,7 @@ struct snd_seq_timer *snd_seq_timer_new(void)
{
struct snd_seq_timer *tmr;
tmr = kzalloc_obj(*tmr, GFP_KERNEL);
tmr = kzalloc_obj(*tmr);
if (!tmr)
return NULL;
spin_lock_init(&tmr->lock);

View file

@ -220,7 +220,7 @@ static int seq_ump_group_init(struct seq_ump_client *client, int group_index)
return 0;
struct snd_seq_port_info *port __free(kfree) =
kzalloc_obj(*port, GFP_KERNEL);
kzalloc_obj(*port);
if (!port)
return -ENOMEM;
@ -246,9 +246,9 @@ static void update_port_infos(struct seq_ump_client *client)
int i, err;
struct snd_seq_port_info *old __free(kfree) =
kzalloc_obj(*old, GFP_KERNEL);
kzalloc_obj(*old);
struct snd_seq_port_info *new __free(kfree) =
kzalloc_obj(*new, GFP_KERNEL);
kzalloc_obj(*new);
if (!old || !new)
return;
@ -283,7 +283,7 @@ static int create_ump_endpoint_port(struct seq_ump_client *client)
int err;
struct snd_seq_port_info *port __free(kfree) =
kzalloc_obj(*port, GFP_KERNEL);
kzalloc_obj(*port);
if (!port)
return -ENOMEM;
@ -461,7 +461,7 @@ static int snd_seq_ump_probe(struct snd_seq_device *dev)
struct snd_seq_client *cptr;
int p, err;
client = kzalloc_obj(*client, GFP_KERNEL);
client = kzalloc_obj(*client);
if (!client)
return -ENOMEM;

View file

@ -216,7 +216,7 @@ static int snd_virmidi_output_open(struct snd_rawmidi_substream *substream)
struct snd_rawmidi_runtime *runtime = substream->runtime;
struct snd_virmidi *vmidi;
vmidi = kzalloc_obj(*vmidi, GFP_KERNEL);
vmidi = kzalloc_obj(*vmidi);
if (vmidi == NULL)
return -ENOMEM;
vmidi->substream = substream;
@ -367,7 +367,7 @@ static int snd_virmidi_dev_attach_seq(struct snd_virmidi_dev *rdev)
return 0;
struct snd_seq_port_info *pinfo __free(kfree) =
kzalloc_obj(*pinfo, GFP_KERNEL);
kzalloc_obj(*pinfo);
if (!pinfo)
return -ENOMEM;
@ -498,7 +498,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi
if (err < 0)
return err;
strscpy(rmidi->name, rmidi->id);
rdev = kzalloc_obj(*rdev, GFP_KERNEL);
rdev = kzalloc_obj(*rdev);
if (rdev == NULL) {
snd_device_free(card, rmidi);
return -ENOMEM;

View file

@ -257,7 +257,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
if (snd_BUG_ON(!device))
return -EINVAL;
preg = kmalloc_obj(*preg, GFP_KERNEL);
preg = kmalloc_obj(*preg);
if (preg == NULL)
return -ENOMEM;
preg->type = type;

View file

@ -96,7 +96,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
return 0; /* ignore silently */
if (minor < 0)
return minor;
preg = kmalloc_obj(struct snd_minor, GFP_KERNEL);
preg = kmalloc_obj(struct snd_minor);
if (preg == NULL)
return -ENOMEM;
preg->type = type;

View file

@ -151,7 +151,7 @@ struct snd_timer_instance *snd_timer_instance_new(const char *owner)
{
struct snd_timer_instance *timeri;
timeri = kzalloc_obj(*timeri, GFP_KERNEL);
timeri = kzalloc_obj(*timeri);
if (timeri == NULL)
return NULL;
timeri->owner = kstrdup(owner, GFP_KERNEL);
@ -930,7 +930,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid,
}
if (rtimer)
*rtimer = NULL;
timer = kzalloc_obj(*timer, GFP_KERNEL);
timer = kzalloc_obj(*timer);
if (!timer)
return -ENOMEM;
timer->tmr_class = tid->dev_class;
@ -1197,7 +1197,7 @@ static int snd_timer_register_system(void)
return err;
strscpy(timer->name, "system timer");
timer->hw = snd_timer_system;
priv = kzalloc_obj(*priv, GFP_KERNEL);
priv = kzalloc_obj(*priv);
if (priv == NULL) {
snd_timer_free(timer);
return -ENOMEM;
@ -1432,11 +1432,11 @@ static int realloc_user_queue(struct snd_timer_user *tu, int size)
struct snd_timer_tread64 *tqueue = NULL;
if (tu->tread) {
tqueue = kzalloc_objs(*tqueue, size, GFP_KERNEL);
tqueue = kzalloc_objs(*tqueue, size);
if (!tqueue)
return -ENOMEM;
} else {
queue = kzalloc_objs(*queue, size, GFP_KERNEL);
queue = kzalloc_objs(*queue, size);
if (!queue)
return -ENOMEM;
}
@ -1461,7 +1461,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file)
if (err < 0)
return err;
tu = kzalloc_obj(*tu, GFP_KERNEL);
tu = kzalloc_obj(*tu);
if (tu == NULL)
return -ENOMEM;
spin_lock_init(&tu->qlock);
@ -2128,7 +2128,7 @@ static int snd_utimer_create(struct snd_timer_uinfo *utimer_info,
if (!utimer_info || utimer_info->resolution == 0)
return -EINVAL;
utimer = kzalloc_obj(*utimer, GFP_KERNEL);
utimer = kzalloc_obj(*utimer);
if (!utimer)
return -ENOMEM;

View file

@ -166,7 +166,7 @@ int snd_ump_endpoint_new(struct snd_card *card, char *id, int device,
if (input && output)
info_flags |= SNDRV_RAWMIDI_INFO_DUPLEX;
ump = kzalloc_obj(*ump, GFP_KERNEL);
ump = kzalloc_obj(*ump);
if (!ump)
return -ENOMEM;
INIT_LIST_HEAD(&ump->block_list);
@ -408,7 +408,7 @@ int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk,
if (snd_ump_get_block(ump, blk))
return -EBUSY;
fb = kzalloc_obj(*fb, GFP_KERNEL);
fb = kzalloc_obj(*fb);
if (!fb)
return -ENOMEM;

View file

@ -58,7 +58,7 @@ static int follower_update(struct link_follower *follower)
{
int err, ch;
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (!uctl)
return -ENOMEM;
@ -84,7 +84,7 @@ static int follower_init(struct link_follower *follower)
}
struct snd_ctl_elem_info *uinfo __free(kfree) =
kmalloc_obj(*uinfo, GFP_KERNEL);
kmalloc_obj(*uinfo);
if (!uinfo)
return -ENOMEM;
uinfo->id = follower->follower.id;
@ -341,7 +341,7 @@ static int sync_followers(struct link_master *master, int old_val, int new_val)
{
struct link_follower *follower;
struct snd_ctl_elem_value *uval __free(kfree) =
kmalloc_obj(*uval, GFP_KERNEL);
kmalloc_obj(*uval);
if (!uval)
return -ENOMEM;
@ -429,7 +429,7 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
knew.name = name;
knew.info = master_info;
master = kzalloc_obj(*master, GFP_KERNEL);
master = kzalloc_obj(*master);
if (!master)
return NULL;
INIT_LIST_HEAD(&master->followers);

View file

@ -329,7 +329,7 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream)
{
struct dummy_systimer_pcm *dpcm;
dpcm = kzalloc_obj(*dpcm, GFP_KERNEL);
dpcm = kzalloc_obj(*dpcm);
if (!dpcm)
return -ENOMEM;
substream->runtime->private_data = dpcm;
@ -450,7 +450,7 @@ static int dummy_hrtimer_create(struct snd_pcm_substream *substream)
{
struct dummy_hrtimer_pcm *dpcm;
dpcm = kzalloc_obj(*dpcm, GFP_KERNEL);
dpcm = kzalloc_obj(*dpcm);
if (!dpcm)
return -ENOMEM;
substream->runtime->private_data = dpcm;

View file

@ -518,7 +518,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
out_enable, in_enable, &rmidi);
if (err < 0)
return err;
mpu = kzalloc_obj(*mpu, GFP_KERNEL);
mpu = kzalloc_obj(*mpu);
if (!mpu) {
err = -ENOMEM;
goto free_device;

View file

@ -75,7 +75,7 @@ static int snd_mts64_create(struct snd_card *card,
*rchip = NULL;
mts = kzalloc_obj(struct mts64, GFP_KERNEL);
mts = kzalloc_obj(struct mts64);
if (mts == NULL)
return -ENOMEM;

View file

@ -324,7 +324,7 @@ int snd_opl3_new(struct snd_card *card,
int err;
*ropl3 = NULL;
opl3 = kzalloc_obj(*opl3, GFP_KERNEL);
opl3 = kzalloc_obj(*opl3);
if (!opl3)
return -ENOMEM;

View file

@ -313,7 +313,7 @@ struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
if (!create_patch)
return NULL;
patch = kzalloc_obj(*patch, GFP_KERNEL);
patch = kzalloc_obj(*patch);
if (!patch)
return NULL;
patch->prog = prog;

View file

@ -187,7 +187,7 @@ int snd_opl4_create(struct snd_card *card,
if (ropl4)
*ropl4 = NULL;
opl4 = kzalloc_obj(*opl4, GFP_KERNEL);
opl4 = kzalloc_obj(*opl4);
if (!opl4)
return -ENOMEM;

View file

@ -377,7 +377,7 @@ static int snd_pcmtst_pcm_open(struct snd_pcm_substream *substream)
if (inject_open_err)
return -EBUSY;
v_iter = kzalloc_obj(*v_iter, GFP_KERNEL);
v_iter = kzalloc_obj(*v_iter);
if (!v_iter)
return -ENOMEM;
@ -575,7 +575,7 @@ static int snd_pcmtst_create(struct snd_card *card, struct platform_device *pdev
.dev_free = snd_pcmtst_dev_free,
};
pcmtst = kzalloc_obj(*pcmtst, GFP_KERNEL);
pcmtst = kzalloc_obj(*pcmtst);
if (!pcmtst)
return -ENOMEM;
pcmtst->card = card;

View file

@ -88,7 +88,7 @@ static int portman_create(struct snd_card *card,
*rchip = NULL;
pm = kzalloc_obj(struct portman, GFP_KERNEL);
pm = kzalloc_obj(struct portman);
if (pm == NULL)
return -ENOMEM;

View file

@ -414,7 +414,7 @@ static int vx_alloc_pipe(struct vx_core *chip, int capture,
return err;
/* initialize the pipe record */
pipe = kzalloc_obj(*pipe, GFP_KERNEL);
pipe = kzalloc_obj(*pipe);
if (! pipe) {
/* release the pipe */
vx_init_rmh(&rmh, CMD_FREE_PIPE);

View file

@ -1783,7 +1783,7 @@ static int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed,
// for runtime of PCM substream in the interval equivalent to the size of PCM buffer. It
// could take a round over queue of AMDTP packet descriptors and small loss of history. For
// safe, keep more 8 elements for the queue, equivalent to 1 ms.
descs = kzalloc_objs(*descs, s->queue_size + 8, GFP_KERNEL);
descs = kzalloc_objs(*descs, s->queue_size + 8);
if (!descs) {
err = -ENOMEM;
goto err_context;

View file

@ -38,7 +38,7 @@ proc_read_hw_info(struct snd_info_entry *entry,
struct snd_bebob *bebob = entry->private_data;
struct hw_info *info;
info = kzalloc_obj(struct hw_info, GFP_KERNEL);
info = kzalloc_obj(struct hw_info);
if (info == NULL)
return;

View file

@ -76,7 +76,7 @@ get_hardware_info(struct snd_efw *efw)
char version[12] = {0};
int err;
hwinfo = kzalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL);
hwinfo = kzalloc_obj(struct snd_efw_hwinfo);
if (hwinfo == NULL)
return -ENOMEM;

View file

@ -31,7 +31,7 @@ proc_read_hwinfo(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
unsigned short i;
struct snd_efw_hwinfo *hwinfo;
hwinfo = kmalloc_obj(struct snd_efw_hwinfo, GFP_KERNEL);
hwinfo = kmalloc_obj(struct snd_efw_hwinfo);
if (hwinfo == NULL)
return;

View file

@ -185,7 +185,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file,
if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP))
return -ENXIO;
meter = kzalloc_obj(*meter, GFP_KERNEL);
meter = kzalloc_obj(*meter);
if (!meter)
return -ENOMEM;
@ -207,7 +207,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file,
if (!(motu->spec->flags & SND_MOTU_SPEC_COMMAND_DSP))
return -ENXIO;
meter = kzalloc_obj(*meter, GFP_KERNEL);
meter = kzalloc_obj(*meter);
if (!meter)
return -ENOMEM;
@ -229,7 +229,7 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file,
if (!(motu->spec->flags & SND_MOTU_SPEC_REGISTER_DSP))
return -ENXIO;
param = kzalloc_obj(*param, GFP_KERNEL);
param = kzalloc_obj(*param);
if (!param)
return -ENOMEM;

View file

@ -27,7 +27,7 @@ int iso_packets_buffer_init(struct iso_packets_buffer *b, struct fw_unit *unit,
void *p;
int err;
b->packets = kmalloc_objs(*b->packets, count, GFP_KERNEL);
b->packets = kmalloc_objs(*b->packets, count);
if (!b->packets) {
err = -ENOMEM;
goto error;

View file

@ -191,7 +191,7 @@ static int alloc_ad_spec(struct hda_codec *codec)
{
struct ad198x_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
codec->spec = spec;

View file

@ -35,7 +35,7 @@ static int ca0110_probe(struct hda_codec *codec, const struct hda_device_id *id)
struct hda_gen_spec *spec;
int err;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
snd_hda_gen_spec_init(spec);

View file

@ -3392,11 +3392,11 @@ static int dspxfr_image(struct hda_codec *codec,
if (fls_data == NULL)
return -EINVAL;
dma_engine = kzalloc_obj(*dma_engine, GFP_KERNEL);
dma_engine = kzalloc_obj(*dma_engine);
if (!dma_engine)
return -ENOMEM;
dma_engine->dmab = kzalloc_obj(*dma_engine->dmab, GFP_KERNEL);
dma_engine->dmab = kzalloc_obj(*dma_engine->dmab);
if (!dma_engine->dmab) {
kfree(dma_engine);
return -ENOMEM;
@ -9899,7 +9899,7 @@ static int ca0132_codec_probe(struct hda_codec *codec,
codec_dbg(codec, "%s\n", __func__);
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
codec->spec = spec;

View file

@ -524,7 +524,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid)
{
struct cs_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return NULL;
codec->spec = spec;

View file

@ -162,7 +162,7 @@ static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid)
{
struct cs_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return NULL;
codec->spec = spec;

View file

@ -61,7 +61,7 @@ static struct cs8409_spec *cs8409_alloc_spec(struct hda_codec *codec)
{
struct cs8409_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return NULL;
codec->spec = spec;

View file

@ -488,7 +488,7 @@ static int cm9825_probe(struct hda_codec *codec, const struct hda_device_id *id)
struct auto_pin_cfg *cfg;
int err = 0;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (spec == NULL)
return -ENOMEM;

View file

@ -24,7 +24,7 @@ static int cmedia_probe(struct hda_codec *codec, const struct hda_device_id *id)
bool is_cmi8888 = id->vendor_id == 0x13f68888;
int err;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (spec == NULL)
return -ENOMEM;

View file

@ -1187,7 +1187,7 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name);
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
snd_hda_gen_spec_init(&spec->gen);

View file

@ -1991,7 +1991,7 @@ static int parse_output_paths(struct hda_codec *codec)
bool best_wired = true, best_mio = true;
bool hp_spk_swapped = false;
struct auto_pin_cfg *best_cfg __free(kfree) =
kmalloc_obj(*best_cfg, GFP_KERNEL);
kmalloc_obj(*best_cfg);
if (!best_cfg)
return -ENOMEM;
@ -6095,7 +6095,7 @@ static int snd_hda_gen_probe(struct hda_codec *codec,
struct hda_gen_spec *spec;
int err;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
snd_hda_gen_spec_init(spec);

View file

@ -2105,7 +2105,7 @@ int snd_hda_hdmi_generic_alloc(struct hda_codec *codec)
{
struct hdmi_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;

View file

@ -175,7 +175,7 @@ int snd_hda_hdmi_simple_probe(struct hda_codec *codec,
struct hdmi_spec_per_cvt *per_cvt;
struct hdmi_spec_per_pin *per_pin;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;

View file

@ -221,7 +221,7 @@ void alc_update_knob_master(struct hda_codec *codec,
return;
struct snd_ctl_elem_value *uctl __free(kfree) =
kzalloc_obj(*uctl, GFP_KERNEL);
kzalloc_obj(*uctl);
if (!uctl)
return;
val = snd_hda_codec_read(codec, jack->nid, 0,
@ -1028,7 +1028,7 @@ EXPORT_SYMBOL_NS_GPL(alc_parse_auto_config, "SND_HDA_CODEC_REALTEK");
/* common preparation job for alc_spec */
int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
{
struct alc_spec *spec = kzalloc_obj(*spec, GFP_KERNEL);
struct alc_spec *spec = kzalloc_obj(*spec);
int err;
if (!spec)

View file

@ -170,7 +170,7 @@ static int senary_probe(struct hda_codec *codec, const struct hda_device_id *id)
codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name);
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
snd_hda_gen_spec_init(&spec->gen);

View file

@ -256,7 +256,7 @@ static void si3054_remove(struct hda_codec *codec)
static int si3054_probe(struct hda_codec *codec, const struct hda_device_id *id)
{
codec->spec = kzalloc_obj(struct si3054_spec, GFP_KERNEL);
codec->spec = kzalloc_obj(struct si3054_spec);
if (!codec->spec)
return -ENOMEM;
return 0;

View file

@ -4456,7 +4456,7 @@ static int alloc_stac_spec(struct hda_codec *codec)
{
struct sigmatel_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
snd_hda_gen_spec_init(&spec->gen);

View file

@ -102,7 +102,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec)
{
struct via_spec *spec;
spec = kzalloc_obj(*spec, GFP_KERNEL);
spec = kzalloc_obj(*spec);
if (spec == NULL)
return NULL;

View file

@ -220,7 +220,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
return 0; /* disabled by module option */
}
beep = kzalloc_obj(*beep, GFP_KERNEL);
beep = kzalloc_obj(*beep);
if (beep == NULL)
return -ENOMEM;
snprintf(beep->phys, sizeof(beep->phys),

View file

@ -147,7 +147,7 @@ static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid)
len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list));
if (len == -ENOSPC) {
len = snd_hda_get_num_raw_conns(codec, nid);
result = kmalloc_objs(hda_nid_t, len, GFP_KERNEL);
result = kmalloc_objs(hda_nid_t, len);
if (!result)
return -ENOMEM;
len = snd_hda_get_raw_connections(codec, nid, result, len);
@ -703,7 +703,7 @@ struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec,
struct hda_pcm *pcm;
va_list args;
pcm = kzalloc_obj(*pcm, GFP_KERNEL);
pcm = kzalloc_obj(*pcm);
if (!pcm)
return NULL;
@ -895,7 +895,7 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
return ERR_PTR(-EINVAL);
codec = kzalloc_obj(*codec, GFP_KERNEL);
codec = kzalloc_obj(*codec);
if (!codec)
return ERR_PTR(-ENOMEM);
@ -1855,7 +1855,7 @@ static int check_follower_present(struct hda_codec *codec,
static int put_kctl_with_value(struct snd_kcontrol *kctl, int val)
{
struct snd_ctl_elem_value *ucontrol __free(kfree) =
kzalloc_obj(*ucontrol, GFP_KERNEL);
kzalloc_obj(*ucontrol);
if (!ucontrol)
return -ENOMEM;

View file

@ -715,7 +715,7 @@ int snd_hda_attach_pcm_stream(struct hda_bus *_bus, struct hda_codec *codec,
if (err < 0)
return err;
strscpy(pcm->name, cpcm->name, sizeof(pcm->name));
apcm = kzalloc_obj(*apcm, GFP_KERNEL);
apcm = kzalloc_obj(*apcm);
if (apcm == NULL) {
snd_device_free(chip->card, pcm);
return -ENOMEM;
@ -1283,7 +1283,7 @@ int azx_init_streams(struct azx *chip)
* and initialize
*/
for (i = 0; i < chip->num_streams; i++) {
struct azx_dev *azx_dev = kzalloc_obj(*azx_dev, GFP_KERNEL);
struct azx_dev *azx_dev = kzalloc_obj(*azx_dev);
int dir, tag;
if (!azx_dev)

View file

@ -329,7 +329,7 @@ snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid,
callback = find_callback_from_list(jack, func);
if (func && !callback) {
callback = kzalloc_obj(*callback, GFP_KERNEL);
callback = kzalloc_obj(*callback);
if (!callback)
return ERR_PTR(-ENOMEM);
callback->func = func;

View file

@ -689,7 +689,7 @@ static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_c
if (conn_len <= 0)
return;
conn = kmalloc_objs(hda_nid_t, conn_len, GFP_KERNEL);
conn = kmalloc_objs(hda_nid_t, conn_len);
if (!conn)
return;

View file

@ -89,7 +89,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count);
for (idx = 0; idx < link_count; idx++) {
hlink = kzalloc_obj(*hlink, GFP_KERNEL);
hlink = kzalloc_obj(*hlink);
if (!hlink)
return -ENOMEM;
hlink->index = idx;

View file

@ -339,7 +339,7 @@ static int add_widget_node(struct kobject *parent, hda_nid_t nid,
const struct attribute_group *group,
struct kobject **res)
{
struct kobject *kobj = kzalloc_obj(*kobj, GFP_KERNEL);
struct kobject *kobj = kzalloc_obj(*kobj);
int err;
if (!kobj)
@ -366,7 +366,7 @@ static int widget_tree_create(struct hdac_device *codec)
int i, err;
hda_nid_t nid;
tree = codec->widgets = kzalloc_obj(*tree, GFP_KERNEL);
tree = codec->widgets = kzalloc_obj(*tree);
if (!tree)
return -ENOMEM;
@ -436,7 +436,7 @@ int hda_widget_sysfs_reinit(struct hdac_device *codec,
if (!tree)
return -ENOMEM;
tree->nodes = kzalloc_objs(*tree->nodes, num_nodes + 1, GFP_KERNEL);
tree->nodes = kzalloc_objs(*tree->nodes, num_nodes + 1);
if (!tree->nodes) {
kfree(tree);
return -ENOMEM;

View file

@ -269,7 +269,7 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
&device);
if (err < 0)
return err;
chip = device->private_data = kzalloc_obj(*chip, GFP_KERNEL);
chip = device->private_data = kzalloc_obj(*chip);
if (chip == NULL) {
snd_i2c_device_free(device);
return -ENOMEM;

View file

@ -72,7 +72,7 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name,
};
*ri2c = NULL;
bus = kzalloc_obj(*bus, GFP_KERNEL);
bus = kzalloc_obj(*bus);
if (bus == NULL)
return -ENOMEM;
mutex_init(&bus->lock_mutex);
@ -104,7 +104,7 @@ int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name,
*rdevice = NULL;
if (snd_BUG_ON(!bus))
return -EINVAL;
device = kzalloc_obj(*device, GFP_KERNEL);
device = kzalloc_obj(*device);
if (device == NULL)
return -ENOMEM;
device->addr = addr;

View file

@ -64,7 +64,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
.dev_free = snd_ak4113_dev_free,
};
chip = kzalloc_obj(*chip, GFP_KERNEL);
chip = kzalloc_obj(*chip);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->lock);

View file

@ -64,7 +64,7 @@ int snd_ak4114_create(struct snd_card *card,
.dev_free = snd_ak4114_dev_free,
};
chip = kzalloc_obj(*chip, GFP_KERNEL);
chip = kzalloc_obj(*chip);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->lock);

View file

@ -57,7 +57,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t
.dev_free = snd_ak4117_dev_free,
};
chip = kzalloc_obj(*chip, GFP_KERNEL);
chip = kzalloc_obj(*chip);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->lock);

View file

@ -285,7 +285,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card,
u8 default_treble, default_bass;
unsigned char bytes[7];
tea = kzalloc_obj(*tea, GFP_KERNEL);
tea = kzalloc_obj(*tea);
if (tea == NULL)
return -ENOMEM;
err = snd_i2c_device_create(bus, "TEA6330T", TEA6330T_ADDR, &device);

View file

@ -116,7 +116,7 @@ int snd_gus_create(struct snd_card *card,
};
*rgus = NULL;
gus = kzalloc_obj(*gus, GFP_KERNEL);
gus = kzalloc_obj(*gus);
if (gus == NULL)
return -ENOMEM;
spin_lock_init(&gus->reg_lock);

Some files were not shown because too many files have changed in this diff Show more