Netdev List
 help / color / mirror / Atom feed
From: "Neftin, Sasha" <sasha.neftin@intel.com>
To: YueHaibing <yuehaibing@huawei.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, "Neftin,
	Sasha" <sasha.neftin@intel.com>
Subject: Re: [PATCH net-next] igc: Remove set but not used variables 'ctrl_ext, link_mode'
Date: Wed, 24 Oct 2018 13:20:02 +0300	[thread overview]
Message-ID: <8bb1076e-fc8a-0b8e-b6d2-0a14d13db8d3@intel.com> (raw)
In-Reply-To: <1539952830-187358-1-git-send-email-yuehaibing@huawei.com>

On 10/19/2018 15:40, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/ethernet/intel/igc/igc_base.c: In function 'igc_init_phy_params_base':
> drivers/net/ethernet/intel/igc/igc_base.c:240:6: warning:
>   variable 'ctrl_ext' set but not used [-Wunused-but-set-variable]
>    u32 ctrl_ext;
>    
> drivers/net/ethernet/intel/igc/igc_base.c: In function 'igc_get_invariants_base':
> drivers/net/ethernet/intel/igc/igc_base.c:290:6: warning:
>   variable 'link_mode' set but not used [-Wunused-but-set-variable]
>    u32 link_mode = 0;
> 
> It never used since introduction in
> commit c0071c7aa5fe ("igc: Add HW initialization code")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> I'm not sure that reading IGC_CTRL_EXT is necessary.
> ---
>   drivers/net/ethernet/intel/igc/igc_base.c | 8 --------
>   1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
> index 832da609..df40af7 100644
> --- a/drivers/net/ethernet/intel/igc/igc_base.c
> +++ b/drivers/net/ethernet/intel/igc/igc_base.c
> @@ -237,7 +237,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
>   {
>   	struct igc_phy_info *phy = &hw->phy;
>   	s32 ret_val = 0;
> -	u32 ctrl_ext;
>   
>   	if (hw->phy.media_type != igc_media_type_copper) {
>   		phy->type = igc_phy_none;
> @@ -247,8 +246,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
>   	phy->autoneg_mask	= AUTONEG_ADVERTISE_SPEED_DEFAULT_2500;
>   	phy->reset_delay_us	= 100;
>   
> -	ctrl_ext = rd32(IGC_CTRL_EXT);
> -
>   	/* set lan id */
>   	hw->bus.func = (rd32(IGC_STATUS) & IGC_STATUS_FUNC_MASK) >>
>   			IGC_STATUS_FUNC_SHIFT;
> @@ -287,8 +284,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
>   static s32 igc_get_invariants_base(struct igc_hw *hw)
>   {
>   	struct igc_mac_info *mac = &hw->mac;
> -	u32 link_mode = 0;
> -	u32 ctrl_ext = 0;
>   	s32 ret_val = 0;
>   
>   	switch (hw->device_id) {
> @@ -302,9 +297,6 @@ static s32 igc_get_invariants_base(struct igc_hw *hw)
>   
>   	hw->phy.media_type = igc_media_type_copper;
>   
> -	ctrl_ext = rd32(IGC_CTRL_EXT);
> -	link_mode = ctrl_ext & IGC_CTRL_EXT_LINK_MODE_MASK;
> -
>   	/* mac initialization and operations */
>   	ret_val = igc_init_mac_params_base(hw);
>   	if (ret_val)
> 
Thanks for the patch. Good.

Acked-by: Sasha Neftin <sasha.neftin@intel.com>

  reply	other threads:[~2018-10-24 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 12:40 [PATCH net-next] igc: Remove set but not used variables 'ctrl_ext, link_mode' YueHaibing
2018-10-24 10:20 ` Neftin, Sasha [this message]
2018-11-01 19:24 ` Brown, Aaron F

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=8bb1076e-fc8a-0b8e-b6d2-0a14d13db8d3@intel.com \
    --to=sasha.neftin@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox