lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1513323522-15021-7-git-send-email-sagar.a.kamble@intel.com>
Date:   Fri, 15 Dec 2017 13:08:21 +0530
From:   Sagar Arun Kamble <sagar.a.kamble@...el.com>
To:     linux-kernel@...r.kernel.org
Cc:     Sagar Arun Kamble <sagar.a.kamble@...el.com>,
        Richard Cochran <richardcochran@...il.com>,
        Ariel Elior <ariel.elior@...ium.com>,
        everest-linux-l2@...ium.com, netdev@...r.kernel.org
Subject: [PATCH 06/27] bnx2x: Use timecounter_initialize interface

With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update bnx2x timecounter
init with this new function.

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@...el.com>
Cc: Richard Cochran <richardcochran@...il.com>
Cc: Ariel Elior <ariel.elior@...ium.com>
Cc: everest-linux-l2@...ium.com
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 83624ad..1e10a81 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -15269,15 +15269,6 @@ static u64 bnx2x_cyclecounter_read(const struct cyclecounter *cc)
 	return phc_cycles;
 }
 
-static void bnx2x_init_cyclecounter(struct cyclecounter *cc)
-{
-	memset(cc, 0, sizeof(*cc));
-	cc->read = bnx2x_cyclecounter_read;
-	cc->mask = CYCLECOUNTER_MASK(64);
-	cc->shift = 0;
-	cc->mult = 1;
-}
-
 static int bnx2x_send_reset_timesync_ramrod(struct bnx2x *bp)
 {
 	struct bnx2x_func_state_params func_params = {NULL};
@@ -15511,9 +15502,12 @@ void bnx2x_init_ptp(struct bnx2x *bp)
 	 * unload / load (e.g. MTU change) while it is running.
 	 */
 	if (!bp->timecounter_init_done) {
-		bnx2x_init_cyclecounter(&bp->timecounter.cc);
-		timecounter_init(&bp->timecounter,
-				 ktime_to_ns(ktime_get_real()));
+		timecounter_initialize(&bp->timecounter,
+				       bnx2x_cyclecounter_read,
+				       CYCLECOUNTER_MASK(64),
+				       1,
+				       0,
+				       ktime_to_ns(ktime_get_real()));
 		bp->timecounter_init_done = 1;
 	}
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ