Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ramoops: fix types, remove typecasts

Cc: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
264b795f 6f772fe6

+4 -4
+4 -4
drivers/char/ramoops.c
··· 30 30 31 31 #define RAMOOPS_KERNMSG_HDR "====" 32 32 33 - #define RECORD_SIZE 4096 33 + #define RECORD_SIZE 4096UL 34 34 35 35 static ulong mem_address; 36 36 module_param(mem_address, ulong, 0400); ··· 77 77 if (reason == KMSG_DUMP_OOPS && !dump_oops) 78 78 return; 79 79 80 - buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE)); 80 + buf = cxt->virt_addr + (cxt->count * RECORD_SIZE); 81 81 buf_orig = buf; 82 82 83 83 memset(buf, '\0', RECORD_SIZE); ··· 88 88 buf += res; 89 89 90 90 hdr_size = buf - buf_orig; 91 - l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - hdr_size)); 92 - l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - hdr_size) - l2_cpy); 91 + l2_cpy = min(l2, RECORD_SIZE - hdr_size); 92 + l1_cpy = min(l1, RECORD_SIZE - hdr_size - l2_cpy); 93 93 94 94 s2_start = l2 - l2_cpy; 95 95 s1_start = l1 - l1_cpy;