提交 be3f4e0f 编写于 作者: L Linus Torvalds

Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
 "A couple of ARM fixes from Linus for the ICST clock generator code"

[ "Linus" here is Linus Walleij.  Name-stealer.

       Linus "there can be only one" Torvalds ]

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8519/1: ICST: try other dividends than 1
  ARM: 8517/1: ICST: avoid arithmetic overflow in icst_hz()
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/div64.h>
#include <asm/hardware/icst.h> #include <asm/hardware/icst.h>
/* /*
...@@ -29,7 +29,11 @@ EXPORT_SYMBOL(icst525_s2div); ...@@ -29,7 +29,11 @@ EXPORT_SYMBOL(icst525_s2div);
unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco)
{ {
return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]); u64 dividend = p->ref * 2 * (u64)(vco.v + 8);
u32 divisor = (vco.r + 2) * p->s2div[vco.s];
do_div(dividend, divisor);
return (unsigned long)dividend;
} }
EXPORT_SYMBOL(icst_hz); EXPORT_SYMBOL(icst_hz);
...@@ -58,6 +62,7 @@ icst_hz_to_vco(const struct icst_params *p, unsigned long freq) ...@@ -58,6 +62,7 @@ icst_hz_to_vco(const struct icst_params *p, unsigned long freq)
if (f > p->vco_min && f <= p->vco_max) if (f > p->vco_min && f <= p->vco_max)
break; break;
i++;
} while (i < 8); } while (i < 8);
if (i >= 8) if (i >= 8)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册