Author: mav
Date: Tue Jan 22 17:18:34 2013
New Revision: 245800
URL: http://svnweb.freebsd.org/changeset/base/245800

Log:
  MFC r241402:
  Add checks for ata_sata_scr_read() return statuses. It is mostly to silence
  Clang Static Analyzer warnings as errors there are usually unlikely.

Modified:
  stable/8/sys/dev/ata/ata-sata.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ata/   (props changed)

Modified: stable/8/sys/dev/ata/ata-sata.c
==============================================================================
--- stable/8/sys/dev/ata/ata-sata.c     Tue Jan 22 17:15:56 2013        
(r245799)
+++ stable/8/sys/dev/ata/ata-sata.c     Tue Jan 22 17:18:34 2013        
(r245800)
@@ -53,7 +53,8 @@ ata_sata_phy_check_events(device_t dev, 
     struct ata_channel *ch = device_get_softc(dev);
     u_int32_t error, status;
 
-    ata_sata_scr_read(ch, port, ATA_SERROR, &error);
+    if (ata_sata_scr_read(ch, port, ATA_SERROR, &error))
+       return;
 
     /* Check that SError value is sane. */
     if (error == 0xffffffff)
@@ -66,8 +67,9 @@ ata_sata_phy_check_events(device_t dev, 
     /* if we have a connection event deal with it */
     if ((error & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) {
        if (bootverbose) {
-           ata_sata_scr_read(ch, port, ATA_SSTATUS, &status);
-           if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) &&
+           if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status)) {
+                   device_printf(dev, "PHYRDY change\n");
+           } else if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) &&
                ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) &&
                ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) {
                    device_printf(dev, "CONNECT requested\n");
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to