Skip to content

Commit

Permalink
Fix build error with message: invalid initializer on < 4.10.0 version
Browse files Browse the repository at this point in the history
kernel

See torvalds/linux@2456e85

Signed-off-by: iysheng <[email protected]>
  • Loading branch information
iysheng committed Sep 28, 2024
1 parent 1ed0185 commit 0bc63b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/tty0tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ static int tty0tty_write(struct tty_struct *tty, const unsigned char *buffer,
int retval = 0;
struct tty_struct *ttyx = NULL;
u64 elapsed, delay;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
ktime_t start_time = ktime_get_ns();
#else
u64 start_time = ktime_get_ns();
#endif

if (!tty0tty)
return -ENODEV;
Expand Down

0 comments on commit 0bc63b7

Please sign in to comment.