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]
Message-Id: <20080310142405.e8b92156.akpm@linux-foundation.org>
Date:	Mon, 10 Mar 2008 14:24:05 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Andres Salomon <dilinger@...ued.net>
Cc:	adaplas@...il.com, linux-kernel@...r.kernel.org,
	linux-fbdev-devel@...ts.sourceforge.net, info-linux@...de.amd.com,
	jordan.crouse@....com
Subject: Re: [PATCH 1/6] gxfb: create DC/VP/FP-specific handlers rather than
 using readl/writel

On Sat, 8 Mar 2008 20:48:26 -0500
Andres Salomon <dilinger@...ued.net> wrote:

> +#define read_dc(reg)		readl(par->dc_regs + (reg))
> +#define write_dc(reg, val)	writel((val), par->dc_regs + (reg))
> +
> +#define read_vp(reg)		readl(par->vid_regs + (reg))
> +#define write_vp(reg, val)	writel((uint32_t) (val), \
> +					par->vid_regs + (reg))
> +
> +#define read_fp(reg)		readl(par->vid_regs + (reg))
> +#define write_fp(reg, val)	writel((uint32_t) (val), \
> +					par->vid_regs + (reg))
> +

Not very nice, sorry.  They're macros, and macros rather suck.  And they
implicitly rely upon the caller having some variable called "par" in scope.

It would be much nicer to do

/*
 * documentation goes here
 */
static inline u32 read_dc(struct geodefb_par *par, int reg)
{
	return readl(par->dc_regs, reg);
}

no?
--
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