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] [day] [month] [year] [list]
Message-ID: <20080924050809.GA6722@linux-sh.org>
Date:	Wed, 24 Sep 2008 14:08:09 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	Alexey Kopytko <alexey@...ytko.ru>
Cc:	Alessandro Zummo <a.zummo@...ertech.it>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RTC: Add platform data structure to Ricoh RS5C372 driver

On Wed, Sep 24, 2008 at 11:45:49AM +0900, Alexey Kopytko wrote:
> From: Alexey Kopytko <alexey@...ytko.ru>
> 
> This patch enables a platform developer to choose which alarm register to use.
> It adds and properly initializes platform data structure.
> 
> ---
> RS5C_REG_ALARM_B_MIN is used to store power state in
> Buffalo Linkstation Mini and some other Linkstations.
> Tested with and without platform data.
> 
> Signed-off-by: Alexey Kopytko <alexey@...ytko.ru>
> 
[snip]

> +#ifndef _LINUX_RTC_RS5C372_H_
> +#define _LINUX_RTC_RS5C372_H_
> +
> +#define RS5C_REG_ALARM_A_MIN	8			/* or ALARM_W */
> +#define RS5C_REG_ALARM_A_HOURS	9
> +#define RS5C_REG_ALARM_A_WDAY	10
> +
> +#define RS5C_REG_ALARM_B_MIN	11			/* or ALARM_D */
> +#define RS5C_REG_ALARM_B_HOURS	12
> +#define RS5C_REG_ALARM_B_WDAY	13			/* (ALARM_B only) */
> +
> +struct rs5c_plat_data {
> +	/* What alarm regs to use */
> +	int alarm_min;
> +	int alarm_hours;
> +};

I don't think this is a meaningful abstraction. Pushing this sort of
knowledge in to the platform code is pretty ugly, especially when the
only distinction you need is whether to use the A set or the B set.

Given that, you could simply have a flags field in the platform data and
use one bit to test in the driver for using the B set of registers (A is
always the default otherwise).
--
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