Re: [git patches] libata fixes

From: Sergei Shtylyov
Date: Fri Jan 16 2009 - 13:44:44 EST


Hello.

Andrew Morton wrote:

+static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs)
+{
+ unsigned int val;
+
+ /*
+ * Compute # of eclock periods to get desired duration in
+ * nanoseconds.
+ */
+ val = DIV_ROUND_UP(nsecs * (octeon_get_clock_rate() / 1000000),
+ 1000 * tim_mult);
+
+ return val;
+}

There's great potential for overflows here, but I couldn't be bothered
picking through it. Are we sure that it's watertight?

There's a 64-bit divide in there. Will it link on 32-bit platforms?

Or is this all 64-bit-only code?

wtf is an octeon anyway? (greps). Some MIPS thing. I guess it's
64-bit-only.

Yes, it's multicore MIPS64. AFAIK, it should be able to run 32-bit kernel (don't think that it's really worth it).

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/