On 2019/01/29 2:51, Christoph Badura wrote:
On Fri, Jan 25, 2019 at 08:04:07AM +0000, SAITOH Masanobu wrote:
Modified Files:
        src/sys/dev/pci: if_wm.c

Log Message:
  80003's SERDES is not the same as 82575's but the same as legacy devices.
Use the old methods on 80003.

XXX The reason why this bug existed is that our order of WM_T_* was little
different from FreeBSD's enum e1000_mac_type. From 80003 to PCH_CNP and from
82575 to I211 are swapped.

Wouldn't it be better to prevent this kind of bug in the future by putting
the decision which method to use into a switch-statement and have the
compiler worry about ordering? (And duplicates and omissions.)

I think so and I'm going to simplify such type of checks (I have unfinished code
in locally). The reason why I committed the above change only is to make
the change understandable by separating from other changes.

--chris


 Thanks.

--
-----------------------------------------------
                SAITOH Masanobu (msai...@execsw.org
                                 msai...@netbsd.org)

Reply via email to