Skip to content

Commit c91cf42

Browse files
bvanasschetsbogend
authored andcommitted
MIPS: sni: Fix the build
This patch fixes the following gcc 10 build error: arch/mips/sni/time.c: In function ‘a20r_set_periodic’: arch/mips/sni/time.c:15:26: error: unsigned conversion from ‘int’ to ‘u8’ {aka ‘volatile unsigned char’} changes value from ‘576’ to ‘64’ [-Werror=overflow] 15 | #define SNI_COUNTER0_DIV ((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ) | ^ arch/mips/sni/time.c:21:45: note: in expansion of macro ‘SNI_COUNTER0_DIV’ 21 | *(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV; | ^~~~~~~~~~~~~~~~ Cc: [email protected] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 67512a8 commit c91cf42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/mips/sni/time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ static int a20r_set_periodic(struct clock_event_device *evt)
1818
{
1919
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34;
2020
wmb();
21-
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV;
21+
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV & 0xff;
2222
wmb();
2323
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 0) = SNI_COUNTER0_DIV >> 8;
2424
wmb();
2525

2626
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4;
2727
wmb();
28-
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV;
28+
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV & 0xff;
2929
wmb();
3030
*(volatile u8 *)(A20R_PT_CLOCK_BASE + 8) = SNI_COUNTER2_DIV >> 8;
3131
wmb();

0 commit comments

Comments
 (0)