Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Use __SHIFTOUT to simplify an expression.



details:   https://anonhg.NetBSD.org/src/rev/4f460f34db6d
branches:  trunk
changeset: 784574:4f460f34db6d
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Feb 02 14:11:37 2013 +0000

description:
Use __SHIFTOUT to simplify an expression.

diffstat:

 sys/dev/ic/ahcisata_core.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 6223e84b2023 -r 4f460f34db6d sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Sat Feb 02 14:06:58 2013 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Sat Feb 02 14:11:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_core.c,v 1.45 2012/10/26 09:59:11 bouyer Exp $        */
+/*     $NetBSD: ahcisata_core.c,v 1.46 2013/02/02 14:11:37 matt Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.45 2012/10/26 09:59:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.46 2013/02/02 14:11:37 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -716,10 +716,9 @@
         * This should not be needed, but some controllers clear the
         * command slot before receiving the D2H FIS ...
         */
-       for (i = 0; i <AHCI_RST_WAIT; i++) {
+       for (i = 0; i < AHCI_RST_WAIT; i++) {
                sig = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel));
-               if ((((sig & AHCI_P_TFD_ST) >> AHCI_P_TFD_ST_SHIFT)
-                   & WDCS_BSY) == 0)
+               if ((__SHIFTOUT(sig, AHCI_P_TFD_ST) & WDCS_BSY) == 0)
                        break;
                if (flags & AT_WAIT)
                        tsleep(&sc, PRIBIO, "ahcid2h", mstohz(10));



Home | Main Index | Thread Index | Old Index