Skip to content

Commit

Permalink
use revamped rng starting kernel 6.1
Browse files Browse the repository at this point in the history
The random number generator in Linux has been revamped to use new functions, and prandom_u32() was turned into a wrapper for the new function, get_random_u32(), in 5.19:
torvalds/linux@d415077

This wrapper function was also removed in 6.1:
torvalds/linux@de492c8
  • Loading branch information
akay authored Feb 6, 2023
1 parent cada654 commit 1538986
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/uvesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#include <linux/slab.h>
#include <video/edid.h>
#include <video/uvesafb.h>
#include <linux/version.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
#define RANDOM_FUNC get_random_u32
#else
#define RANDOM_FUNC prandom_u32
#endif

#ifdef CONFIG_X86
#include <video/vga.h>
#endif
Expand Down Expand Up @@ -320,7 +328,7 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
memcpy(&m->id, &uvesafb_cn_id, sizeof(m->id));
m->seq = seq;
m->len = len;
m->ack = prandom_u32();
m->ack = RANDOM_FUNC();

/* uvesafb_task structure */
memcpy(m + 1, &task->t, sizeof(task->t));
Expand Down

0 comments on commit 1538986

Please sign in to comment.