Re: [PATCH] sba_iommu update (2.6 version)

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2004-01-13 08:26:50
>>>>> On Mon, 12 Jan 2004 13:16:29 -0700, Alex Williamson <alex.williamson@hp.com> said:

  Alex> +static SBA_INLINE int
  Alex> +get_iovp_order (unsigned long size)
  Alex> +{
  Alex> +	double d = size - 1;
  Alex> +	long order;
  Alex> +
  Alex> +	__asm__ ("getf.exp %0=%1" : "=r"(order) : "f"(d));
  Alex> +	order = order - iovp_shift - 0xffff + 1;
  Alex> +	if (order < 0)
  Alex> +		order = 0;
  Alex> +	return order;
  Alex> +}

Please avoid inline-asm and use the corresponding intrinsic instead
(ia64_getf_exp(), in this particular case) so that the Intel compiler
remains usable.

Also, looking at it, I suspect we'd be better off using "long double"
instead of "double" to avoid problems with huge values (yeah, probably
doesn't make a difference in practice, but we should avoid propagating
potentially-buggy code; I see get_order() has the same
problem---apparently only ia64_fls() got fixed).

  Alex> +sba_page_override(char *str)

Wouldn't it be cleaner to use lib/cmdline.c:memparse() here?

	--david
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Jan 12 16:32:04 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:21 EST