On Thu, 30 Oct 2008 22:56:32 +0300
Anton Vorontsov <[EMAIL PROTECTED]> 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.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to