Re: [PATCH] ALSA: pcm_native: remove unused label

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Marcin Slusarz
Date: Sunday, August 3, 2008 - 11:07 am

On Sun, Aug 03, 2008 at 07:33:19PM +0200, Sven Wegener wrote:

Brown paper bag for me, please.
But for my defense, here's the code:

static int snd_pcm_fasync(int fd, struct file * file, int on)
{
	struct snd_pcm_file * pcm_file;
	struct snd_pcm_substream *substream;
	struct snd_pcm_runtime *runtime;
	int err = -ENXIO;

	lock_kernel();
	pcm_file = file->private_data;
	substream = pcm_file->substream;
	snd_assert(substream != NULL, goto out);
	runtime = substream->runtime;

	err = fasync_helper(fd, file, on, &runtime->fasync);
out:
	unlock_kernel();
	if (err < 0)
		return err;
	return 0;
}

It's a bit weird to have constructs like snd_assert which look
like function call, but actually changes program flow...


I would say this whole snd_assert macro is broken...

$ git grep snd_assert|wc -l
829
$ git grep snd_assert|grep return|wc -l
722
$ git grep snd_assert|grep return|grep NULL|wc -l
381

Marcin

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] ALSA: pcm_native: remove unused label, Marcin Slusarz, (Sun Aug 3, 9:47 am)
Re: [PATCH] ALSA: pcm_native: remove unused label, Sven Wegener, (Sun Aug 3, 10:27 am)
Re: [PATCH] ALSA: pcm_native: remove unused label, Sven Wegener, (Sun Aug 3, 10:33 am)
Re: [PATCH] ALSA: pcm_native: remove unused label, Marcin Slusarz, (Sun Aug 3, 11:07 am)