From patchwork Mon Mar 4 12:58:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 2212621 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A1AB84006E for ; Mon, 4 Mar 2013 13:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757781Ab3CDM70 (ORCPT ); Mon, 4 Mar 2013 07:59:26 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:39369 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757760Ab3CDM7Y (ORCPT ); Mon, 4 Mar 2013 07:59:24 -0500 Received: by mail-pb0-f45.google.com with SMTP id ro8so3076423pbb.18 for ; Mon, 04 Mar 2013 04:59:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=b0t/AAPPZI8j9PSgb5OXJNwdk2vIF6dMIjTj8Eqp3Yg=; b=P9zrilJ6pYTS86rZNr9MoQM2jbLymMiPhG7Ynh2bNXRJIdXyfjeSjJxof9Eiu4YlMH Kb6N4DykMW/A5XN5Y3HZsOr/grhQfI0iM0UegOLWtkbh0IW6lv33EgFIJBbnTOzMpFNn 922oNPwvO7KbCB3GoWL6sKeueZJ/z9d+X6x1JA3/iPZkwggr7X+qcAGzYzDgCFb3qWJr MpF9aifvZnCDCIkao1UiWBPwXmAyvQ2Q9VP9q6R/IkRWgP+u0jAsuyCljpkF1aUViTyP XSPHU5OxyTxnBP7Q8m9w5XuDCZwVp0uA7SGEDhdppYtLkMxIvV02mG2dy+jlTs8BUO71 3MpQ== X-Received: by 10.66.97.50 with SMTP id dx18mr31781359pab.78.1362401963467; Mon, 04 Mar 2013 04:59:23 -0800 (PST) Received: from localhost.localdomain (p2126-ipbf3106hodogaya.kanagawa.ocn.ne.jp. [114.149.157.126]) by mx.google.com with ESMTPS id t6sm23836060paz.11.2013.03.04.04.59.20 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 04:59:21 -0800 (PST) From: Akinobu Mita To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: Akinobu Mita , Roland Dreier , Sean Hefty , Hal Rosenstock , Steve Wise , linux-rdma@vger.kernel.org Subject: [PATCH -v3 09/23] infiniband: rename random32() to prandom_u32() Date: Mon, 4 Mar 2013 21:58:17 +0900 Message-Id: <1362401911-14074-10-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com> References: <1362401911-14074-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Use more preferable function name which implies using a pseudo-random number generator. Signed-off-by: Akinobu Mita Reviewed-by: Steve Wise Cc: Roland Dreier Cc: Sean Hefty Cc: Hal Rosenstock Cc: Steve Wise Cc: linux-rdma@vger.kernel.org Reviewed-by: Steve Wise --- * Change from v2 - add Reviewed-by: line drivers/infiniband/hw/cxgb3/cxio_resource.c | 4 ++-- drivers/infiniband/hw/cxgb4/id_table.c | 4 ++-- drivers/infiniband/hw/mlx4/mad.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/cxgb3/cxio_resource.c b/drivers/infiniband/hw/cxgb3/cxio_resource.c index 31f9201..c40088e 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_resource.c +++ b/drivers/infiniband/hw/cxgb3/cxio_resource.c @@ -62,13 +62,13 @@ static int __cxio_init_resource_fifo(struct kfifo *fifo, kfifo_in(fifo, (unsigned char *) &entry, sizeof(u32)); if (random) { j = 0; - random_bytes = random32(); + random_bytes = prandom_u32(); for (i = 0; i < RANDOM_SIZE; i++) rarray[i] = i + skip_low; for (i = skip_low + RANDOM_SIZE; i < nr - skip_high; i++) { if (j >= RANDOM_SIZE) { j = 0; - random_bytes = random32(); + random_bytes = prandom_u32(); } idx = (random_bytes >> (j * 2)) & 0xF; kfifo_in(fifo, diff --git a/drivers/infiniband/hw/cxgb4/id_table.c b/drivers/infiniband/hw/cxgb4/id_table.c index f95e5df..0161ae6 100644 --- a/drivers/infiniband/hw/cxgb4/id_table.c +++ b/drivers/infiniband/hw/cxgb4/id_table.c @@ -54,7 +54,7 @@ u32 c4iw_id_alloc(struct c4iw_id_table *alloc) if (obj < alloc->max) { if (alloc->flags & C4IW_ID_TABLE_F_RANDOM) - alloc->last += random32() % RANDOM_SKIP; + alloc->last += prandom_u32() % RANDOM_SKIP; else alloc->last = obj + 1; if (alloc->last >= alloc->max) @@ -88,7 +88,7 @@ int c4iw_id_table_alloc(struct c4iw_id_table *alloc, u32 start, u32 num, alloc->start = start; alloc->flags = flags; if (flags & C4IW_ID_TABLE_F_RANDOM) - alloc->last = random32() % RANDOM_SKIP; + alloc->last = prandom_u32() % RANDOM_SKIP; else alloc->last = 0; alloc->max = num; diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 934792c..4d599ce 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -93,7 +93,7 @@ static void __propagate_pkey_ev(struct mlx4_ib_dev *dev, int port_num, __be64 mlx4_ib_gen_node_guid(void) { #define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40)) - return cpu_to_be64(NODE_GUID_HI | random32()); + return cpu_to_be64(NODE_GUID_HI | prandom_u32()); } __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 67b0c1d..249976c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -460,7 +460,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even goto err_qp; } - psn = random32() & 0xffffff; + psn = prandom_u32() & 0xffffff; ret = ipoib_cm_modify_rx_qp(dev, cm_id, p->qp, psn); if (ret) goto err_modify;