Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Ingyu Jang <ingyujang25@korea.ac.kr>
Cc: <anthony.l.nguyen@intel.com>, <intel-wired-lan@lists.osuosl.org>,
	<andrew+netdev@lunn.ch>
Subject: Re: [Intel-wired-lan] [Question] Dead code in ixgbe_init_eeprom_params_generic()?
Date: Tue, 3 Feb 2026 11:54:23 +0100	[thread overview]
Message-ID: <8524c812-b659-4670-b370-35682aba2d2f@intel.com> (raw)
In-Reply-To: <20260131162128.3334803-1-ingyujang25@korea.ac.kr>

On 1/31/26 17:21, Ingyu Jang wrote:
> Hi,
> 
> I noticed that in drivers/net/ethernet/intel/ixgbe/ixgbe_common.c,
> the function ixgbe_init_eeprom_params_generic() always returns 0.
> 
> The function (at line 860) performs EEPROM initialization and
> always ends with:
>    return 0;
> 
> However, in drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c, there
> are multiple places where the return value is checked through the
> function pointer hw->eeprom.ops.init_params(hw):
> 
> 1. ixgbe_read_ee_e610() at line 3627:
>     err = hw->eeprom.ops.init_params(hw);
>     if (err)
>         return err;
> 
> 2. ixgbe_write_ee_e610() at line 3660:
>     err = hw->eeprom.ops.init_params(hw);
>     if (err)
>         return err;
> 
> 3. ixgbe_validate_ee_e610() at line 3693:
>     err = hw->eeprom.ops.init_params(hw);
>     if (err)
>         return err;
> 
> The init_params function pointer points to
> ixgbe_init_eeprom_params_generic for 82598 and 82599 chips
> (ixgbe_82598.c:1164, ixgbe_82599.c:2225).
> 
> Since ixgbe_init_eeprom_params_generic() never fails, these error
> checks appear to be dead code for those chip types.
> 
> Is this intentional defensive coding for potential future changes,
> or could this be cleaned up?
> 
> Thanks,
> Ingyu Jang

thank you

this originates from our OOT implementation which is over 20 years old
by now

feel free to send patch that cleans this up (and similar stuff if you
find more)

      reply	other threads:[~2026-02-03 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-31 16:21 [Intel-wired-lan] [Question] Dead code in ixgbe_init_eeprom_params_generic()? Ingyu Jang
2026-02-03 10:54 ` Przemek Kitszel [this message]

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=8524c812-b659-4670-b370-35682aba2d2f@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ingyujang25@korea.ac.kr \
    --cc=intel-wired-lan@lists.osuosl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox