remove some dead code, avoid set but unused variables.

This commit is contained in:
mrg 2014-03-12 22:21:07 +00:00
parent 49f7ef9bba
commit 3b431c6785
2 changed files with 7 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dbau1550.c,v 1.12 2011/07/10 00:03:52 matt Exp $ */ /* $NetBSD: dbau1550.c,v 1.13 2014/03/12 22:21:07 mrg Exp $ */
/*- /*-
* Copyright (c) 2006 Itronix Inc. * Copyright (c) 2006 Itronix Inc.
@ -32,7 +32,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dbau1550.c,v 1.12 2011/07/10 00:03:52 matt Exp $"); __KERNEL_RCSID(0, "$NetBSD: dbau1550.c,v 1.13 2014/03/12 22:21:07 mrg Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -320,18 +320,8 @@ dbau1550_slot_enable(int slot)
void void
dbau1550_slot_disable(int slot) dbau1550_slot_disable(int slot)
{ {
int shift;
uint16_t status; uint16_t status;
switch (slot) {
case 0:
shift = DBAU1550_PCMCIA_PC0_SHIFT;
break;
case 1:
shift = DBAU1550_PCMCIA_PC1_SHIFT;
break;
}
status = GET16(DBAU1550_PCMCIA); status = GET16(DBAU1550_PCMCIA);
status &= ~(DBAU1550_PCMCIA_MASK); status &= ~(DBAU1550_PCMCIA_MASK);
PUT16(DBAU1550_PCMCIA, status); PUT16(DBAU1550_PCMCIA, status);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ralink_gpio.c,v 1.4 2012/10/27 17:18:02 chs Exp $ */ /* $NetBSD: ralink_gpio.c,v 1.5 2014/03/12 22:21:07 mrg Exp $ */
/*- /*-
* Copyright (c) 2011 CradlePoint Technology, Inc. * Copyright (c) 2011 CradlePoint Technology, Inc.
* All rights reserved. * All rights reserved.
@ -29,7 +29,7 @@
/* ra_gpio.c -- Ralink 3052 gpio driver */ /* ra_gpio.c -- Ralink 3052 gpio driver */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.4 2012/10/27 17:18:02 chs Exp $"); __KERNEL_RCSID(0, "$NetBSD: ralink_gpio.c,v 1.5 2014/03/12 22:21:07 mrg Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/bus.h> #include <sys/bus.h>
@ -665,7 +665,6 @@ ra_gpio_attach(device_t parent, device_t self, void *aux)
static void static void
ra_gpio_pin_init(ra_gpio_softc_t *sc, int pin) ra_gpio_pin_init(ra_gpio_softc_t *sc, int pin)
{ {
u_int gpio_mode;
uint32_t r; uint32_t r;
sc->sc_pins[pin].pin_caps = 0; sc->sc_pins[pin].pin_caps = 0;
@ -692,7 +691,6 @@ ra_gpio_pin_init(ra_gpio_softc_t *sc, int pin)
sc->sc_pins[pin].pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | sc->sc_pins[pin].pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT |
GPIO_PIN_INVIN | GPIO_PIN_INVOUT; GPIO_PIN_INVIN | GPIO_PIN_INVOUT;
sc->sc_pins[pin].pin_state = GPIO_PIN_INPUT; sc->sc_pins[pin].pin_state = GPIO_PIN_INPUT;
gpio_mode = 0;
#if defined(SLICKROCK) #if defined(SLICKROCK)
r = sy_read(sc, RA_SYSCTL_GPIOMODE); r = sy_read(sc, RA_SYSCTL_GPIOMODE);
@ -706,7 +704,9 @@ ra_gpio_pin_init(ra_gpio_softc_t *sc, int pin)
* GPIO0 doesn't have an associated MODE register. * GPIO0 doesn't have an associated MODE register.
*/ */
if (pin != 0) { if (pin != 0) {
for (gpio_mode=0; gpio_mode < GPIO_MODE_SETTINGS; gpio_mode++) { u_int gpio_mode = 0;
for (gpio_mode; gpio_mode < GPIO_MODE_SETTINGS; gpio_mode++) {
if (pin <= pin_share[gpio_mode]) { if (pin <= pin_share[gpio_mode]) {
r = sy_read(sc, RA_SYSCTL_GPIOMODE); r = sy_read(sc, RA_SYSCTL_GPIOMODE);
if (10 == pin) { if (10 == pin) {