Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic some style changes - g/c redundant cast, simplify...



details:   https://anonhg.NetBSD.org/src/rev/4e2b43b31cee
branches:  trunk
changeset: 558257:4e2b43b31cee
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Feb 03 18:54:59 2004 +0000

description:
some style changes - g/c redundant cast, simplify code in atppc_read_ivar()

diffstat:

 sys/dev/ic/atppc.c |  18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diffs (52 lines):

diff -r 8d70cfe784e3 -r 4e2b43b31cee sys/dev/ic/atppc.c
--- a/sys/dev/ic/atppc.c        Tue Feb 03 18:48:39 2004 +0000
+++ b/sys/dev/ic/atppc.c        Tue Feb 03 18:54:59 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atppc.c,v 1.10 2004/01/28 20:08:35 jdolecek Exp $ */
+/* $NetBSD: atppc.c,v 1.11 2004/02/03 18:54:59 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2001 Alcove - Nicolas Souchu
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.10 2004/01/28 20:08:35 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.11 2004/02/03 18:54:59 jdolecek Exp $");
 
 #include "opt_atppc.h"
 
@@ -942,7 +942,7 @@
        /* If ECP capable, configure ecr register */
        if (atppc->sc_has & ATPPC_HAS_ECP) {
                /* Read ECR with mode masked out */
-               ecr = (atppc_r_ecr(atppc) & (unsigned)0x1f);
+               ecr = (atppc_r_ecr(atppc) & 0x1f);
                atppc_barrier_r(atppc);
 
                switch (mode) {
@@ -1514,21 +1514,15 @@
                        *val = PPBUS_EPP_1_9;
                else if (atppc->sc_epp == ATPPC_EPP_1_7)
                        *val = PPBUS_EPP_1_7;
+               /* XXX what if not using EPP ? */
                break;
 
        case PPBUS_IVAR_INTR:
-               if (atppc->sc_use & ATPPC_USE_INTR)
-                       *val = 1;
-               else
-                       *val = 0;
+               *val = ((atppc->sc_use & ATPPC_USE_INTR) != 0);
                break;
 
        case PPBUS_IVAR_DMA:
-               if (atppc->sc_use & ATPPC_USE_DMA)
-                       *val = 1;
-               else
-                       *val = 0;
-               break;
+               *val = ((atppc->sc_use & ATPPC_USE_DMA) != 0);
                break;
 
        default:



Home | Main Index | Thread Index | Old Index