linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about drivers/atm/iphase.c
@ 2020-04-03 13:55 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2020-04-03 13:55 UTC (permalink / raw)
  To: 3chas3, linux-atm-general, netdev; +Cc: linux-kernel, joe

Hello,

The function ia_frontend_intr in iphase.c contains the following code:

        if (iadev->phy_type & FE_25MBIT_PHY) {
                status = ia_phy_read32(iadev, MB25_INTR_STATUS);
                iadev->carrier_detect = (status & MB25_IS_GSB) ? 1 : 0;
        } else if (iadev->phy_type & FE_DS3_PHY) {
                ia_phy_read32(iadev, SUNI_DS3_FRM_INTR_STAT);
                status = ia_phy_read32(iadev, SUNI_DS3_FRM_STAT);
                iadev->carrier_detect = (status & SUNI_DS3_LOSV) ? 0 : 1;
        } else if (iadev->phy_type & FE_E3_PHY) {
                ia_phy_read32(iadev, SUNI_E3_FRM_MAINT_INTR_IND);
                status = ia_phy_read32(iadev, SUNI_E3_FRM_FRAM_INTR_IND_STAT);
                iadev->carrier_detect = (status & SUNI_E3_LOS) ? 0 : 1;
        } else {
                status = ia_phy_read32(iadev, SUNI_RSOP_STATUS);
                iadev->carrier_detect = (status & SUNI_LOSV) ? 0 : 1;
        }

Specifically, the second if does a bit and with FE_DS3_PHY and the third
if does a bit and with FE_E3_PHY.  According to drivers/atm/iphase.h, the
former is 0x0080 and the latter is 0x0090.  Therefore, if the third test
would be true, it will never be reached.  How should the code be changed?

thanks,
julia

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-03 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 13:55 question about drivers/atm/iphase.c Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).