kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: kexec@lists.infradead.org
Cc: Simon Horman <horms@verge.net.au>,
	Laurent Vivier <laurent@vivier.eu>,
	Jason@zx2c4.com
Subject: [PATCH] m68k: fix getrandom() use with uclibc
Date: Sat, 22 Apr 2023 11:59:04 +0200	[thread overview]
Message-ID: <20230422095904.1303434-1-laurent@vivier.eu> (raw)

With uclibc, getrandom() is only defined with _GNU_SOURCE, fix that:

kexec/arch/m68k/bootinfo.c: In function 'bootinfo_add_rng_seed':
kexec/arch/m68k/bootinfo.c:231:13: warning: implicit declaration of function 'getrandom'; did you mean 'srandom'? [-Wimplicit-function-declaration]
  231 |         if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
      |             ^~~~~~~~~
      |             srandom
kexec/arch/m68k/bootinfo.c:231:56: error: 'GRND_NONBLOCK' undeclared (first use in this function)
  231 |         if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
      |                                                        ^~~~~~~~~~~~~

Fixes:  b9de05184816 ("m68k: pass rng seed via BI_RNG_SEED")
Cc: Jason@zx2c4.com
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 kexec/arch/m68k/bootinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 086a34bdfdeb..5afd212d9d34 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>
-- 
2.40.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

             reply	other threads:[~2023-04-22  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22  9:59 Laurent Vivier [this message]
2023-11-27 13:46 ` [PATCH] m68k: fix getrandom() use with uclibc Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230422095904.1303434-1-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=Jason@zx2c4.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).