Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2009 22:17:14 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197419 - head/sbin/camcontrol
Message-ID:  <200909222217.n8MMHErX034006@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Sep 22 22:17:14 2009
New Revision: 197419
URL: http://svn.freebsd.org/changeset/base/197419

Log:
  MFp4:
  Reduce code duplication.

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Tue Sep 22 20:56:38 2009	(r197418)
+++ head/sbin/camcontrol/camcontrol.c	Tue Sep 22 22:17:14 2009	(r197419)
@@ -1055,23 +1055,22 @@ atacapprint(struct ata_params *parm)
 		printf("\n");
 
 	printf("PIO supported         PIO");
-	if (parm->atavalid & ATA_FLAG_64_70) {
-		if (parm->apiomodes & 0x02)
-			printf("4");
-		else if (parm->apiomodes & 0x01)
-			printf("3");
-	} else if (parm->mwdmamodes & 0x04)
+	switch (ata_max_pmode(parm)) {
+	case ATA_PIO4:
 		printf("4");
-	else if (parm->mwdmamodes & 0x02)
+		break;
+	case ATA_PIO3:
 		printf("3");
-	else if (parm->mwdmamodes & 0x01)
+		break;
+	case ATA_PIO2:
 		printf("2");
-	else if ((parm->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x200)
-		printf("2");
-	else if ((parm->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x100)
+		break;
+	case ATA_PIO1:
 		printf("1");
-	else
+		break;
+	default:
 		printf("0");
+	}
 	printf("\n");
 
 	printf("DMA%ssupported         ",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909222217.n8MMHErX034006>