Commit 786369ee authored by Alessandro Rubini's avatar Alessandro Rubini

kernel: fix a warning like spec-sw does it

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 40a3d8a6
......@@ -113,6 +113,17 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
}
#endif
/* This is somehow generic, but I find no better place at this time */
#ifndef SET_HI32
# if BITS_PER_LONG > 32
# define SET_HI32(var, value) ((var) |= (value) << 32)
# define GET_HI32(var) ((var) >> 32)
# else
# define SET_HI32(var, value) ((var) |= 0)
# define GET_HI32(var) 0
# endif
#endif
struct fd_calib {
int64_t frr_poly[3]; /* SY89295 delay/temp poly coeffs */
uint32_t magic; /* magic ID: 0xf19ede1a */
......
......@@ -38,10 +38,7 @@ int fd_time_set(struct spec_fd *fd, struct fd_time *t, struct timespec *ts)
ts = &localts;
getnstimeofday(ts);
}
if (BITS_PER_LONG > 32)
fd_writel(fd, ts->tv_sec >> 32, FD_REG_TM_SECH);
else
fd_writel(fd, 0, FD_REG_TM_SECH);
fd_writel(fd, GET_HI32(ts->tv_sec), FD_REG_TM_SECH);
fd_writel(fd, (int32_t)ts->tv_sec, FD_REG_TM_SECL);
fd_writel(fd, ts->tv_nsec >> 3, FD_REG_TM_CYCLES);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment