From: Simon Horman <horms@kernel.org>
To: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Cc: anthony.l.nguyen@intel.com, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
Date: Fri, 19 Jan 2024 16:02:19 +0000 [thread overview]
Message-ID: <20240119160219.GE89683@kernel.org> (raw)
In-Reply-To: <20240118134332.470907-3-jedrzej.jagielski@intel.com>
On Thu, Jan 18, 2024 at 02:43:32PM +0100, Jedrzej Jagielski wrote:
> Clean up code where touched during type convertion by the patch
> 8035560dbfaf. Rearrange to fix reverse Christmas tree.
>
> Suggested-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
...
> @@ -771,12 +771,12 @@ static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
> ixgbe_link_speed speed,
> bool autoneg_wait_to_complete)
> {
> - bool autoneg = false;
> - int status;
> - u32 pma_pmd_1g, link_mode, links_reg, i;
> - u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
> u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
> ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
> + u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
> + u32 pma_pmd_1g, link_mode, links_reg, i;
> + bool autoneg = false;
> + int status;
Hi Jedrzej,
In the new arrangement above autoc2 is used before it is declared.
Perhaps this could be:
ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
u32 pma_pmd_1g, link_mode, links_reg, i;
u32 pma_pmd_10g_serial;
bool autoneg = false;
int status;
...
pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
>
> /* holds the value of AUTOC register at this current point in time */
> u32 current_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
...
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,
netdev@vger.kernel.org
Subject: Re: [PATCH iwl-next v3 3/3] ixgbe: Cleanup after type convertion
Date: Fri, 19 Jan 2024 16:02:19 +0000 [thread overview]
Message-ID: <20240119160219.GE89683@kernel.org> (raw)
In-Reply-To: <20240118134332.470907-3-jedrzej.jagielski@intel.com>
On Thu, Jan 18, 2024 at 02:43:32PM +0100, Jedrzej Jagielski wrote:
> Clean up code where touched during type convertion by the patch
> 8035560dbfaf. Rearrange to fix reverse Christmas tree.
>
> Suggested-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
...
> @@ -771,12 +771,12 @@ static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
> ixgbe_link_speed speed,
> bool autoneg_wait_to_complete)
> {
> - bool autoneg = false;
> - int status;
> - u32 pma_pmd_1g, link_mode, links_reg, i;
> - u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
> u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
> ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
> + u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
> + u32 pma_pmd_1g, link_mode, links_reg, i;
> + bool autoneg = false;
> + int status;
Hi Jedrzej,
In the new arrangement above autoc2 is used before it is declared.
Perhaps this could be:
ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
u32 pma_pmd_1g, link_mode, links_reg, i;
u32 pma_pmd_10g_serial;
bool autoneg = false;
int status;
...
pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
>
> /* holds the value of AUTOC register at this current point in time */
> u32 current_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
...
next prev parent reply other threads:[~2024-01-19 16:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 13:43 [Intel-wired-lan] [PATCH iwl-next v3 1/3] ixgbe: Convert ret val type from s32 to int Jedrzej Jagielski
2024-01-18 13:43 ` Jedrzej Jagielski
2024-01-18 13:43 ` [Intel-wired-lan] [PATCH iwl-next v3 2/3] ixgbe: Fix smatch warnings after type convertion Jedrzej Jagielski
2024-01-18 13:43 ` Jedrzej Jagielski
2024-01-18 14:02 ` [Intel-wired-lan] " Dan Carpenter
2024-01-18 14:02 ` Dan Carpenter
2024-01-18 13:43 ` [Intel-wired-lan] [PATCH iwl-next v3 3/3] ixgbe: Cleanup " Jedrzej Jagielski
2024-01-18 13:43 ` Jedrzej Jagielski
2024-01-18 14:28 ` [Intel-wired-lan] " Paul Menzel
2024-01-18 14:28 ` Paul Menzel
2024-01-18 14:33 ` Przemek Kitszel
2024-01-18 14:33 ` Przemek Kitszel
2024-01-24 12:34 ` [Intel-wired-lan] " Jagielski, Jedrzej
2024-01-24 12:34 ` Jagielski, Jedrzej
2024-01-19 16:02 ` Simon Horman [this message]
2024-01-19 16:02 ` Simon Horman
2024-01-20 6:06 ` [Intel-wired-lan] " kernel test robot
2024-01-20 6:06 ` kernel test robot
2024-01-20 8:16 ` [Intel-wired-lan] " kernel test robot
2024-01-20 8:16 ` kernel test robot
2024-01-22 21:18 ` [Intel-wired-lan] [PATCH iwl-next v3 1/3] ixgbe: Convert ret val type from s32 to int Tony Nguyen
2024-01-22 21:18 ` Tony Nguyen
2024-01-25 10:16 ` [Intel-wired-lan] " Jagielski, Jedrzej
2024-01-25 10:16 ` Jagielski, Jedrzej
2024-01-25 19:31 ` [Intel-wired-lan] " Tony Nguyen
2024-01-25 19:31 ` Tony Nguyen
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=20240119160219.GE89683@kernel.org \
--to=horms@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jedrzej.jagielski@intel.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.