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: <20081108215537.12cdf5f6@mjolnir.drzeus.cx>
Date:	Sat, 8 Nov 2008 21:55:37 +0100
From:	Pierre Ossman <drzeus-mmc@...eus.cx>
To:	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Grant Likely <grant.likely@...retlab.ca>
Subject: Re: [PATCH 2/3] mmc: Add mmc_vddrange_to_ocrmask() helper function

On Thu, 30 Oct 2008 22:56:32 +0300
Anton Vorontsov <avorontsov@...mvista.com> wrote:

> +/**
> + * mmc_vddrange_to_ocrmask - Convert a voltage range to the OCR mask
> + * @vdd_min:	minimum voltage value (mV)
> + * @vdd_max:	maximum voltage value (mV)
> + * @mask:	pointer to the mask
> + *

Why the pointer? Why not let the caller handle the aggregation? That
would be a lot safer.

> +	/* fill the mask, from max bit to min bit */
> +	while (vdd_max >= vdd_min)
> +		*mask |= 1 << vdd_max--;
> +	return 0;

Many cards get a bit uppity with a single bit set. If possible, try to
make this function set two bits when the voltage is right on the
boundary (e.g. 3.3V).

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.
--
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