Netdev List
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, joe@perches.com
Subject: question about drivers/atm/iphase.c
Date: Fri, 3 Apr 2020 15:55:04 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2004031549270.2694@hadrien> (raw)

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

                 reply	other threads:[~2020-04-03 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.DEB.2.21.2004031549270.2694@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=3chas3@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox