int
snd_seq_oss_midi_lookup_ports(int client)
{
- struct snd_seq_client_info *clinfo __free(kfree) = NULL;
- struct snd_seq_port_info *pinfo __free(kfree) = NULL;
+ struct snd_seq_client_info *clinfo __free(kfree) =
+ kzalloc(sizeof(*clinfo), GFP_KERNEL);
+ struct snd_seq_port_info *pinfo __free(kfree) =
+ kzalloc(sizeof(*pinfo), GFP_KERNEL);
- clinfo = kzalloc(sizeof(*clinfo), GFP_KERNEL);
- pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
if (!clinfo || !pinfo)
return -ENOMEM;
clinfo->client = -1;
snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode)
{
int perm;
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
struct snd_seq_port_subscribe subs;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return -ENODEV;
int
snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
struct snd_seq_port_subscribe subs;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return -ENODEV;
guard(mutex)(&mdev->open_mutex);
int
snd_seq_oss_midi_filemode(struct seq_oss_devinfo *dp, int dev)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
int mode;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return 0;
void
snd_seq_oss_midi_reset(struct seq_oss_devinfo *dp, int dev)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return;
if (!mdev->opened)
void
snd_seq_oss_midi_get_addr(struct seq_oss_devinfo *dp, int dev, struct snd_seq_addr *addr)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return;
addr->client = mdev->client;
snd_seq_oss_midi_input(struct snd_seq_event *ev, int direct, void *private_data)
{
struct seq_oss_devinfo *dp = (struct seq_oss_devinfo *)private_data;
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
if (dp->readq == NULL)
return 0;
- mdev = find_slot(ev->source.client, ev->source.port);
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ find_slot(ev->source.client, ev->source.port);
if (!mdev)
return 0;
if (!(mdev->opened & PERM_READ))
int
snd_seq_oss_midi_putc(struct seq_oss_devinfo *dp, int dev, unsigned char c, struct snd_seq_event *ev)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return -ENODEV;
if (snd_midi_event_encode_byte(mdev->coder, c, ev)) {
int
snd_seq_oss_midi_make_info(struct seq_oss_devinfo *dp, int dev, struct midi_info *inf)
{
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mididev(dp, dev);
- mdev = get_mididev(dp, dev);
if (!mdev)
return -ENXIO;
inf->device = dev;
snd_iprintf(buf, "\nNumber of MIDI devices: %d\n", max_midi_devs);
for (i = 0; i < max_midi_devs; i++) {
- struct seq_oss_midi *mdev __free(seq_oss_midi) = NULL;
-
snd_iprintf(buf, "\nmidi %d: ", i);
- mdev = get_mdev(i);
+ struct seq_oss_midi *mdev __free(seq_oss_midi) =
+ get_mdev(i);
if (mdev == NULL) {
snd_iprintf(buf, "*empty*\n");
continue;
void
snd_seq_oss_synth_reset(struct seq_oss_devinfo *dp, int dev)
{
- struct seq_oss_synth *rec __free(seq_oss_synth) = NULL;
struct seq_oss_synthinfo *info;
info = get_synthinfo_nospec(dp, dev);
return;
}
- rec = get_sdev(dev);
+ struct seq_oss_synth *rec __free(seq_oss_synth) =
+ get_sdev(dev);
if (rec == NULL)
return;
if (rec->oper.reset) {
snd_seq_oss_synth_load_patch(struct seq_oss_devinfo *dp, int dev, int fmt,
const char __user *buf, int p, int c)
{
- struct seq_oss_synth *rec __free(seq_oss_synth) = NULL;
struct seq_oss_synthinfo *info;
info = get_synthinfo_nospec(dp, dev);
if (info->is_midi)
return 0;
- rec = get_synthdev(dp, dev);
+
+ struct seq_oss_synth *rec __free(seq_oss_synth) =
+ get_synthdev(dp, dev);
if (!rec)
return -ENXIO;
struct seq_oss_synthinfo *
snd_seq_oss_synth_info(struct seq_oss_devinfo *dp, int dev)
{
- struct seq_oss_synth *rec __free(seq_oss_synth) = NULL;
+ struct seq_oss_synth *rec __free(seq_oss_synth) =
+ get_synthdev(dp, dev);
- rec = get_synthdev(dp, dev);
if (rec)
return get_synthinfo_nospec(dp, dev);
return NULL;
int
snd_seq_oss_synth_ioctl(struct seq_oss_devinfo *dp, int dev, unsigned int cmd, unsigned long addr)
{
- struct seq_oss_synth *rec __free(seq_oss_synth) = NULL;
struct seq_oss_synthinfo *info;
info = get_synthinfo_nospec(dp, dev);
if (!info || info->is_midi)
return -ENXIO;
- rec = get_synthdev(dp, dev);
+
+ struct seq_oss_synth *rec __free(seq_oss_synth) =
+ get_synthdev(dp, dev);
if (!rec)
return -ENXIO;
if (rec->oper.ioctl == NULL)
snd_iprintf(buf, "\nNumber of synth devices: %d\n", max_synth_devs);
for (i = 0; i < max_synth_devs; i++) {
- struct seq_oss_synth *rec __free(seq_oss_synth) = NULL;
-
snd_iprintf(buf, "\nsynth %d: ", i);
- rec = get_sdev(i);
+ struct seq_oss_synth *rec __free(seq_oss_synth) =
+ get_sdev(i);
if (rec == NULL) {
snd_iprintf(buf, "*empty*\n");
continue;