Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Sprinkle __UNCONST() and rename variables to quie...



details:   https://anonhg.NetBSD.org/src/rev/41d93a01ff9e
branches:  trunk
changeset: 581915:41d93a01ff9e
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Jun 10 02:35:34 2005 +0000

description:
Sprinkle __UNCONST() and rename variables to quiet uiet -Wcast-qual,
-Wshadow complaints.

diffstat:

 sys/dev/ic/rtw.c |  29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diffs (93 lines):

diff -r 46be931a4b1c -r 41d93a01ff9e sys/dev/ic/rtw.c
--- a/sys/dev/ic/rtw.c  Fri Jun 10 01:11:49 2005 +0000
+++ b/sys/dev/ic/rtw.c  Fri Jun 10 02:35:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtw.c,v 1.45 2005/03/02 05:20:43 dyoung Exp $ */
+/* $NetBSD: rtw.c,v 1.46 2005/06/10 02:35:34 dyoung Exp $ */
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
  *
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.45 2005/03/02 05:20:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.46 2005/06/10 02:35:34 dyoung Exp $");
 
 #include "bpfilter.h"
 
@@ -198,27 +198,29 @@
 static int
 rtw_sysctl_verify_rfprog(SYSCTLFN_ARGS)
 {
-       return rtw_sysctl_verify(SYSCTLFN_CALL(rnode), 0,
+       return rtw_sysctl_verify(SYSCTLFN_CALL(__UNCONST(rnode)), 0,
            MASK_AND_RSHIFT(RTW_CONFIG4_RFTYPE_MASK, RTW_CONFIG4_RFTYPE_MASK));
 }
 
 static int
 rtw_sysctl_verify_rfio(SYSCTLFN_ARGS)
 {
-       return rtw_sysctl_verify(SYSCTLFN_CALL(rnode), 0, 1);
+       return rtw_sysctl_verify(SYSCTLFN_CALL(__UNCONST(rnode)), 0, 1);
 }
 
 #ifdef RTW_DEBUG
 static int
 rtw_sysctl_verify_debug(SYSCTLFN_ARGS)
 {
-       return rtw_sysctl_verify(SYSCTLFN_CALL(rnode), 0, RTW_DEBUG_MAX);
+       return rtw_sysctl_verify(SYSCTLFN_CALL(__UNCONST(rnode)),
+           0, RTW_DEBUG_MAX);
 }
 
 static int
 rtw_sysctl_verify_rxbufs_limit(SYSCTLFN_ARGS)
 {
-       return rtw_sysctl_verify(SYSCTLFN_CALL(rnode), 0, RTW_RXQLEN);
+       return rtw_sysctl_verify(SYSCTLFN_CALL(__UNCONST(rnode)),
+           0, RTW_RXQLEN);
 }
 
 static void
@@ -703,16 +705,17 @@
        int i;
        const char *rfname, *paname;
        char scratch[sizeof("unknown 0xXX")];
-       uint16_t version;
+       uint16_t srom_version;
        uint8_t mac[IEEE80211_ADDR_LEN];
 
        *flags &= ~(RTW_F_DIGPHY|RTW_F_DFLANTB|RTW_F_ANTDIV);
        *rcr &= ~(RTW_RCR_ENCS1 | RTW_RCR_ENCS2);
 
-       version = RTW_SR_GET16(sr, RTW_SR_VERSION);
-       printf("%s: SROM version %d.%d", dvname, version >> 8, version & 0xff);
-
-       if (version <= 0x0101) {
+       srom_version = RTW_SR_GET16(sr, RTW_SR_VERSION);
+       printf("%s: SROM version %d.%d", dvname,
+           srom_version >> 8, srom_version & 0xff);
+
+       if (srom_version <= 0x0101) {
                printf(" is not understood, limping along with defaults\n");
                rtw_srom_defaults(sr, flags, cs_threshold, rfchipid, rcr);
                return 0;
@@ -3810,7 +3813,7 @@
  * revisions A and B.
  */
 static uint8_t
-rtw_check_phydelay(struct rtw_regs *regs, uint32_t rcr0)
+rtw_check_phydelay(struct rtw_regs *regs, uint32_t old_rcr)
 {
 #define REVAB (RTW_RCR_MXDMA_UNLIMITED | RTW_RCR_AICV)
 #define REVC (REVAB | RTW_RCR_RXFTH_WHOLE)
@@ -3825,7 +3828,7 @@
        if ((RTW_READ(regs, RTW_RCR) & REVC) == REVC)
                phydelay |= RTW_PHYDELAY_REVC_MAGIC;
 
-       RTW_WRITE(regs, RTW_RCR, rcr0); /* restore RCR */
+       RTW_WRITE(regs, RTW_RCR, old_rcr);      /* restore RCR */
        RTW_SYNC(regs, RTW_RCR, RTW_RCR);
 
        return phydelay;



Home | Main Index | Thread Index | Old Index