Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1893
b: refs/heads/master
c: 97d26b8
h: refs/heads/master
i:
  1891: 34c522b
v: v3
  • Loading branch information
Linus Torvalds committed Jun 8, 2005
1 parent f2a30ba commit 730dcc7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dcef1f634657dabe7905af3ccda12cf7f0b6fcc1
refs/heads/master: 97d26b8042a6f14cc4a19e84e911a953363e3d69
28 changes: 22 additions & 6 deletions trunk/arch/ppc64/boot/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@
#include <linux/string.h>
#include <linux/ctype.h>

extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor);

/* The unnecessary pointer compare is there
* to check for type safety (n must be 64bit)
*/
# define do_div(n,base) ({ \
__u32 __base = (base); \
__u32 __rem; \
(void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
if (((n) >> 32) == 0) { \
__rem = (__u32)(n) % __base; \
(n) = (__u32)(n) / __base; \
} else \
__rem = __div64_32(&(n), __base); \
__rem; \
})

int (*prom)(void *);

void *chosen_handle;
Expand Down Expand Up @@ -352,7 +369,7 @@ static int skip_atoi(const char **s)
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */

static char * number(char * str, long num, int base, int size, int precision, int type)
static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
Expand All @@ -367,9 +384,9 @@ static char * number(char * str, long num, int base, int size, int precision, in
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
if ((signed long long)num < 0) {
sign = '-';
num = -num;
num = - (signed long long)num;
size--;
} else if (type & PLUS) {
sign = '+';
Expand All @@ -389,8 +406,7 @@ static char * number(char * str, long num, int base, int size, int precision, in
if (num == 0)
tmp[i++]='0';
else while (num != 0) {
tmp[i++] = digits[num % base];
num /= base;
tmp[i++] = digits[do_div(num, base)];
}
if (i > precision)
precision = i;
Expand Down Expand Up @@ -426,7 +442,7 @@ int sprintf(char * buf, const char *fmt, ...);
int vsprintf(char *buf, const char *fmt, va_list args)
{
int len;
unsigned long num;
unsigned long long num;
int i, base;
char * str;
const char *s;
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/ppc64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
*/
preempt_disable();
switch (val) {
case DIE_IABR_MATCH:
case DIE_DABR_MATCH:
case DIE_BPT:
if (kprobe_handler(args->regs))
ret = NOTIFY_STOP;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/serial/sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void
sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
{
struct tty_struct *tty = sport->port.info->tty;
unsigned int status, ch, flg, ignored = 0;
unsigned int status, ch, flg;

status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
UTSR0_TO_SM(UART_GET_UTSR0(sport));
Expand Down

0 comments on commit 730dcc7

Please sign in to comment.