Skip to content

Commit 264b795

Browse files
akpm00torvalds
authored andcommitted
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>
1 parent 6f772fe commit 264b795

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/char/ramoops.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#define RAMOOPS_KERNMSG_HDR "===="
3232

33-
#define RECORD_SIZE 4096
33+
#define RECORD_SIZE 4096UL
3434

3535
static ulong mem_address;
3636
module_param(mem_address, ulong, 0400);
@@ -77,7 +77,7 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
7777
if (reason == KMSG_DUMP_OOPS && !dump_oops)
7878
return;
7979

80-
buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE));
80+
buf = cxt->virt_addr + (cxt->count * RECORD_SIZE);
8181
buf_orig = buf;
8282

8383
memset(buf, '\0', RECORD_SIZE);
@@ -88,8 +88,8 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
8888
buf += res;
8989

9090
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);
9393

9494
s2_start = l2 - l2_cpy;
9595
s1_start = l1 - l1_cpy;

0 commit comments

Comments
 (0)