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:	Sat, 4 Aug 2007 15:26:13 +0200
From:	Pierre Ossman <drzeus-list@...eus.cx>
To:	David Vrabel <david.vrabel@....com>
Cc:	linux-kernel@...r.kernel.org, David Vrabel <david.vrabel@....com>
Subject: Re: sdio: parameterize SDIO FBR register defines

On Tue, 31 Jul 2007 16:36:31 +0100
David Vrabel <david.vrabel@....com> wrote:

> Signed-off-by: David Vrabel <david.vrabel@....com>
> 
> ---
> commit 51755c3d59be1ba778bef45888f9f5e341dc4af4
> tree c7bbb562b2d801197eefb619a17c94467c1299cd
> parent 1cf0b6019aa3916197eecafe058bd2f3d700d24a
> author David Vrabel <david.vrabel@....com> Mon, 30 Jul 2007 19:20:59
> +0100 committer David Vrabel <dvrabel@...tab.net> Mon, 30 Jul 2007
> 19:28:30 +0100
> 
>  drivers/mmc/core/sdio.c     |    4 ++--
>  drivers/mmc/core/sdio_cis.c |    2 +-
>  include/linux/mmc/sdio.h    |   16 +++++++++-------
>  3 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index 6589fd6..08f579c 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -30,7 +30,7 @@ static int sdio_read_fbr(struct sdio_func *func)
>  	unsigned char data;
>  
>  	ret = mmc_io_rw_direct(func->card, 0, 0,
> -		func->num * 0x100 + SDIO_FBR_STD_IF, 0, &data);
> +		SDIO_FBR_STD_IF(func->num), 0, &data);
>  	if (ret != MMC_ERR_NONE)
>  		goto out;
>  

I am a bit sceptical about these macros. Most i/o code in the kernel is
in the form of "<base address> + <register offset>". For one thing,
that model keeps the register defines clean and means people don't have
to go reaching for specs all the time.

Would you be content with replacing "func->num * 0x100" with a macro so
that the code becomes something like:

	SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org
-
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