public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v8 2/4] net: use common rand()/srand() functions
Date: Thu, 5 Jul 2012 23:37:43 +0200	[thread overview]
Message-ID: <201207052337.44092.michael@walle.cc> (raw)
In-Reply-To: <20120705131812.7dc0668c4c0fab08884e6198@freescale.com>

Am Donnerstag 05 Juli 2012, 20:18:12 schrieb Kim Phillips:
> On Mon, 4 Jun 2012 15:10:55 -0500
> 
> Joe Hershberger <joe.hershberger@gmail.com> wrote:
> > On Fri, Jun 1, 2012 at 3:39 PM, Michael Walle <michael@walle.cc> wrote:
> > > Replace rand() with the functions from lib/. The link-local network
> > > code stores its own seed, derived from the MAC address. Thus making it
> > > independent from calls to srand() in other modules.
> > > 
> > > Signed-off-by: Michael Walle <michael@walle.cc>
> > > Cc: Joe Hershberger <joe.hershberger@ni.com>
> > > ---
> > 
> > Acked-by: Joe Hershberger <joe.hershberger@ni.com>
> 
> build-testing mpc83xx on the current u-boot-arm tree
> (v1.3.4-10940-gb003588, which contains this patch) produces the
> following new warning:
> 
> $ ./MAKEALL MPC8313ERDB_66
> Configuring for MPC8313ERDB_66 - Board: MPC8313ERDB, Options: SYS_66MHZ
>    text	   data	    bss	    dec	    hex	filename
>  271988	  13976	  41768	 327732	  50034	./u-boot
> In file included from bootp.c:15:0:
> net_rand.h: In function 'srand_mac':
> net_rand.h:40:2: warning: implicit declaration of function 'srand'
> [-Wimplicit-function-declaration]
> 
> How do we fix this?

sth like that for example?

diff --git a/net/bootp.c b/net/bootp.c
index 0f0867b..87e30ab 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -12,12 +12,14 @@
 #include <command.h>
 #include <net.h>
 #include "bootp.h"
-#include "net_rand.h"
 #include "tftp.h"
 #include "nfs.h"
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
+#ifdef CONFIG_BOOTP_RANDOM_DELAY
+#include "net_rand.h"
+#endif
 

-- 
Michael

  reply	other threads:[~2012-07-05 21:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-01 20:39 [U-Boot] [PATCH v8 0/4] Kirkwood: add lschlv2 and lsxhl board support Michael Walle
2012-06-01 20:39 ` [U-Boot] [PATCH v8 1/4] lib: add rand() function Michael Walle
2012-06-01 20:39 ` [U-Boot] [PATCH v8 2/4] net: use common rand()/srand() functions Michael Walle
2012-06-04 20:10   ` Joe Hershberger
2012-07-05 18:18     ` Kim Phillips
2012-07-05 21:37       ` Michael Walle [this message]
2012-07-05 23:19         ` [U-Boot] [PATCH] net: make net_rand.h inclusion depend on BOOTP_RANDOM_DELAY Kim Phillips
2012-07-06  7:00           ` Michael Walle
2012-07-08 20:40           ` Wolfgang Denk
2012-06-01 20:39 ` [U-Boot] [PATCH v8 3/4] net: add helper to generate random mac address Michael Walle
2012-06-01 20:39 ` [U-Boot] [PATCH v8 4/4] Kirkwood: add lschlv2 and lsxhl board support Michael Walle
2012-06-05 11:09 ` [U-Boot] [PATCH v8 0/4] " Michael Walle
2012-06-05 14:10   ` Prafulla Wadaskar
2012-06-05 14:31     ` Joe Hershberger
2012-06-05 14:26   ` Prafulla Wadaskar

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=201207052337.44092.michael@walle.cc \
    --to=michael@walle.cc \
    --cc=u-boot@lists.denx.de \
    /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