lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Oct 2010 08:35:07 -0700
From:	Joe Perches <joe@...ches.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Peter Hsiang <Peter.Hsiang@...im-ic.com>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Peter Ujfalusi <peter.ujfalusi@...ia.com>,
	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jesse Marroquin <Jesse.Marroquin@...im-ic.com>
Subject: Re: [PATCH] sound/soc: rename vol to volatile_register as
 appropriate

On Wed, 2010-10-13 at 16:29 +0100, Mark Brown wrote:
> On Wed, Oct 13, 2010 at 08:27:47AM -0700, Joe Perches wrote:
> > On Wed, 2010-10-13 at 16:11 +0100, Mark Brown wrote:
> > > If you check the code again you will notice that these functons are all
> > > used in ops structures which presents obvious issues when trying to
> > > replace with open coded checks.
> > > I hope their usefulness is clear given the above.
> > There is some value in using consistent
> > function styles for table driven and non-table
> > driven instances.
> I'm sorry, I don't understand what you are saying here.  What do you
> believe to be inconsistent?

I don't believe anything to be inconsistent about
the volatile uses and was agreeing with you.

Some codecs functions for volatile access use
a switch/case,

static int wm8994_volatile(unsigned int reg)
{
	if (reg >= WM8994_REG_CACHE_SIZE)
		return 1;

	switch (reg) {
	case WM8994_SOFTWARE_RESET:
	case WM8994_CHIP_REVISION:
	case WM8994_DC_SERVO_1:
	case WM8994_DC_SERVO_READBACK:
	case WM8994_RATE_STATUS:
	case WM8994_LDO_1:
	case WM8994_LDO_2:
		return 1;
	default:
		return 0;
	}
}

others use the register variable from the struct

static int wm8962_volatile_register(unsigned int reg)
{
	if (wm8962_reg_access[reg].volatile_register)
		return 1;
	else
		return 0;
}

so I'm agreeing that it's useful to keep the
same access style in multiple codecs instead
of using separate styles in each one.

It'd be even better to use a similarly consistent
function naming scheme.

cheers, Joe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ