From owner-svn-src-all@FreeBSD.ORG Wed Oct 10 17:51:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 542E0DD6; Wed, 10 Oct 2012 17:51:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2608FC16; Wed, 10 Oct 2012 17:51:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9AHpOdi073286; Wed, 10 Oct 2012 17:51:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9AHpONG073284; Wed, 10 Oct 2012 17:51:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210101751.q9AHpONG073284@svn.freebsd.org> From: Alexander Motin Date: Wed, 10 Oct 2012 17:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241402 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 17:51:24 -0000 Author: mav Date: Wed Oct 10 17:51:23 2012 New Revision: 241402 URL: http://svn.freebsd.org/changeset/base/241402 Log: 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: head/sys/dev/ata/ata-sata.c Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Wed Oct 10 17:29:51 2012 (r241401) +++ head/sys/dev/ata/ata-sata.c Wed Oct 10 17:51:23 2012 (r241402) @@ -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");