From owner-svn-src-stable@freebsd.org Mon Jan 4 09:47:22 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37193A61E33; Mon, 4 Jan 2016 09:47:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB00A1348; Mon, 4 Jan 2016 09:47:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049lKub030075; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049lKUk030074; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040947.u049lKUk030074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293153 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:47:22 -0000 Author: hselasky Date: Mon Jan 4 09:47:20 2016 New Revision: 293153 URL: https://svnweb.freebsd.org/changeset/base/293153 Log: MFC r292835: Make the eeprom dump function more readable and rename variables for better clarity. Submitted by: Daria Genzel Differential Revision: https://reviews.freebsd.org/D4551 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:38:33 2016 (r293152) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:47:20 2016 (r293153) @@ -319,34 +319,33 @@ mlx5e_get_eeprom(struct mlx5e_priv *priv static void mlx5e_print_eeprom(struct mlx5e_eeprom *eeprom) { - int i, j = 0; - int row = 0; + int row; + int index_in_row; + int byte_to_write = 0; + int line_length = 16; printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); - while (row < eeprom->len) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; - row++; + printf("------\t\t------"); + while (byte_to_write < eeprom->len) { + printf("\n0x%04X\t\t", byte_to_write); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; } - printf("\n"); } if (eeprom->page_valid) { row = MLX5E_EEPROM_HIGH_PAGE_OFFSET; - printf("\nUpper Page 0x03\n"); + printf("\n\nUpper Page 0x03\n"); printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); + printf("------\t\t------"); while (row < MLX5E_EEPROM_PAGE_LENGTH) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; + printf("\n0x%04X\t\t", row); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; row++; } - printf("\n"); } } }