]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bnx2x: use prandom_bytes()
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 29 Nov 2012 03:19:12 +0000 (14:19 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:54 +0000 (16:23 +1100)
Use prandom_bytes() to fill rss key with pseudo-random bytes.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Laight <david.laight@aculab.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Robert Love <robert.w.love@intel.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

index 8ab1492cedd1ccc27ab6355dec2dd46bed26d360..1611f6857069acedda2aa94e29f7dae6bb3b0c38 100644 (file)
@@ -1813,7 +1813,6 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
                        bool config_hash)
 {
        struct bnx2x_config_rss_params params = {NULL};
-       int i;
 
        /* Although RSS is meaningless when there is a single HW queue we
         * still need it enabled in order to have HW Rx hash generated.
@@ -1845,9 +1844,7 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
 
        if (config_hash) {
                /* RSS keys */
-               for (i = 0; i < sizeof(params.rss_key) / 4; i++)
-                       params.rss_key[i] = random32();
-
+               prandom_bytes(params.rss_key, sizeof(params.rss_key));
                __set_bit(BNX2X_RSS_SET_SRCH, &params.rss_flags);
        }