All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ying.huang@intel.com
Cc: linux-pci@vger.kernel.org
Subject: [bug report] ACPI, APEI, Add PCIe AER error information printing support
Date: Thu, 13 Oct 2016 09:58:47 +0300	[thread overview]
Message-ID: <20161013065847.GA30382@mwanda> (raw)

Hello Huang Ying,

The patch c413d7682020: "ACPI, APEI, Add PCIe AER error information
printing support" from Feb 21, 2011, leads to the following static
checker warning:

	drivers/pci/pcie/aer/aerdrv_errprint.c:229 cper_print_aer()
	warn: bool comparison is always 'false'

drivers/pci/pcie/aer/aerdrv_errprint.c
   222  void cper_print_aer(struct pci_dev *dev, int aer_severity,
   223                      struct aer_capability_regs *aer)
   224  {
   225          int layer, agent, status_strs_size, tlp_header_valid = 0;
   226          u32 status, mask;
   227          const char **status_strs;
   228  
   229          if (aer_severity == AER_CORRECTABLE) {
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In the current code, aer_severity can only be AER_NONFATAL or AER_FATAL
so this condition can never be true.  This seems like it a confusing
thing.

   230                  status = aer->cor_status;
   231                  mask = aer->cor_mask;
   232                  status_strs = aer_correctable_error_string;
   233                  status_strs_size = ARRAY_SIZE(aer_correctable_error_string);
   234          } else {
   235                  status = aer->uncor_status;
   236                  mask = aer->uncor_mask;
   237                  status_strs = aer_uncorrectable_error_string;
   238                  status_strs_size = ARRAY_SIZE(aer_uncorrectable_error_string);
   239                  tlp_header_valid = status & AER_LOG_TLP_MASKS;
   240          }
   241  
   242          layer = AER_GET_LAYER_ERROR(aer_severity, status);
   243          agent = AER_GET_AGENT(aer_severity, status);
   244  

regards,
dan carpenter

             reply	other threads:[~2016-10-13  7:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  6:58 Dan Carpenter [this message]
2016-10-13 17:55 ` [bug report] ACPI, APEI, Add PCIe AER error information printing support Bjorn Helgaas
2016-10-14  8:31   ` Dan Carpenter
2016-10-14  8:43 ` Huang, Ying

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=20161013065847.GA30382@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=ying.huang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.