Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Some namespace protection (and add greppablity).
details: https://anonhg.NetBSD.org/src/rev/5103b3ea9489
branches: trunk
changeset: 780202:5103b3ea9489
user: dsl <dsl%NetBSD.org@localhost>
date: Sun Jul 15 10:55:27 2012 +0000
description:
Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.
Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.
diffstat:
sys/arch/amiga/dev/efa.c | 4 +-
sys/arch/i386/pci/gcscide.c | 12 ++--
sys/arch/macppc/dev/kauai.c | 16 ++--
sys/arch/macppc/dev/wdc_obio.c | 14 ++--
sys/dev/ata/ata.c | 118 ++++++++++++++++++++--------------------
sys/dev/ata/ata_wdc.c | 16 ++--
sys/dev/ata/atavar.h | 32 +++++-----
sys/dev/ata/sata_subr.c | 12 ++--
sys/dev/ata/satapmp_subr.c | 6 +-
sys/dev/ata/wd.c | 16 ++--
sys/dev/ic/ahcisata_core.c | 28 ++++----
sys/dev/ic/mvsata.c | 58 ++++++++++----------
sys/dev/ic/ninjaata32.c | 8 +-
sys/dev/ic/siisata.c | 22 +++---
sys/dev/ic/wdc.c | 86 ++++++++++++++--------------
sys/dev/mca/ed_mca.c | 8 +-
sys/dev/pci/acardide.c | 18 +++---
sys/dev/pci/aceride.c | 16 ++--
sys/dev/pci/cmdide.c | 20 +++---
sys/dev/pci/cypide.c | 8 +-
sys/dev/pci/geodeide.c | 12 ++--
sys/dev/pci/hptide.c | 12 ++--
sys/dev/pci/iteide.c | 14 ++--
sys/dev/pci/ixpide.c | 12 ++--
sys/dev/pci/jmide.c | 12 ++--
sys/dev/pci/nside.c | 8 +-
sys/dev/pci/optiide.c | 10 +-
sys/dev/pci/pciide_common.c | 22 +++---
sys/dev/pci/pdcide.c | 62 ++++++++++----------
sys/dev/pci/pdcsata.c | 10 +-
sys/dev/pci/piixide.c | 34 +++++-----
sys/dev/pci/rccide.c | 14 ++--
sys/dev/pci/rdcide.c | 12 ++--
sys/dev/pci/satalink.c | 16 ++--
sys/dev/pci/schide.c | 14 ++--
sys/dev/pci/siside.c | 22 +++---
sys/dev/pci/slide.c | 14 ++--
sys/dev/pci/stpcide.c | 12 ++--
sys/dev/pci/toshide.c | 12 ++--
sys/dev/pci/viaide.c | 18 +++---
sys/dev/pcmcia/wdc_pcmcia.c | 8 +-
sys/dev/scsipi/atapi_wdc.c | 28 ++++----
sys/dev/usb/umass_isdata.c | 6 +-
sys/sys/param.h | 4 +-
44 files changed, 453 insertions(+), 453 deletions(-)
diffs (truncated from 3145 to 300 lines):
diff -r 6b3b641e7fd4 -r 5103b3ea9489 sys/arch/amiga/dev/efa.c
--- a/sys/arch/amiga/dev/efa.c Sun Jul 15 09:13:59 2012 +0000
+++ b/sys/arch/amiga/dev/efa.c Sun Jul 15 10:55:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efa.c,v 1.7 2012/07/09 19:34:56 rkujawa Exp $ */
+/* $NetBSD: efa.c,v 1.8 2012/07/15 10:55:28 dsl Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -485,7 +485,7 @@
for (drive = 0; drive < 2; drive++) {
drvp = &chp->ch_drive[drive];
- if (drvp->drive_type == DRIVET_NONE)
+ if (drvp->drive_type == ATA_DRIVET_NONE)
continue; /* nothing to see here */
if (drvp->PIO_cap < mode)
diff -r 6b3b641e7fd4 -r 5103b3ea9489 sys/arch/i386/pci/gcscide.c
--- a/sys/arch/i386/pci/gcscide.c Sun Jul 15 09:13:59 2012 +0000
+++ b/sys/arch/i386/pci/gcscide.c Sun Jul 15 10:55:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gcscide.c,v 1.10 2012/07/02 18:15:45 bouyer Exp $ */
+/* $NetBSD: gcscide.c,v 1.11 2012/07/15 10:55:28 dsl Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gcscide.c,v 1.10 2012/07/02 18:15:45 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gcscide.c,v 1.11 2012/07/15 10:55:28 dsl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -198,15 +198,15 @@
for (drive = 0; drive < 2; drive++) {
drvp = &chp->ch_drive[drive];
- if (drvp->drive_type == DRIVET_NONE)
+ if (drvp->drive_type == ATA_DRIVET_NONE)
continue;
reg = rdmsr(drive ? GCSCIDE_ATAC_CH0D1_DMA :
GCSCIDE_ATAC_CH0D0_DMA);
- if (drvp->drive_flags & DRIVE_UDMA) {
+ if (drvp->drive_flags & ATA_DRIVE_UDMA) {
s = splbio();
- drvp->drive_flags &= ~DRIVE_DMA;
+ drvp->drive_flags &= ~ATA_DRIVE_DMA;
splx(s);
/* Enable the Ultra DMA mode bit */
reg |= GCSCIDE_ATAC_DMA_SEL;
@@ -216,7 +216,7 @@
wrmsr(drive ? GCSCIDE_ATAC_CH0D1_DMA :
GCSCIDE_ATAC_CH0D0_DMA, reg);
- } else if (drvp->drive_flags & DRIVE_DMA) {
+ } else if (drvp->drive_flags & ATA_DRIVE_DMA) {
/* Enable the Multi-word DMA bit */
reg &= ~GCSCIDE_ATAC_DMA_SEL;
/* set the Multi-word DMA mode */
diff -r 6b3b641e7fd4 -r 5103b3ea9489 sys/arch/macppc/dev/kauai.c
--- a/sys/arch/macppc/dev/kauai.c Sun Jul 15 09:13:59 2012 +0000
+++ b/sys/arch/macppc/dev/kauai.c Sun Jul 15 10:55:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kauai.c,v 1.29 2012/07/02 18:15:45 bouyer Exp $ */
+/* $NetBSD: kauai.c,v 1.30 2012/07/15 10:55:28 dsl Exp $ */
/*-
* Copyright (c) 2003 Tsubai Masanari. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.29 2012/07/02 18:15:45 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.30 2012/07/15 10:55:28 dsl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -208,15 +208,15 @@
struct ata_drive_datas *drvp;
int drive;
- if (drvp0->drive_type != DRIVET_NONE &&
- drvp1->drive_type != DRIVET_NONE) {
+ if (drvp0->drive_type != ATA_DRIVET_NONE &&
+ drvp1->drive_type != ATA_DRIVET_NONE) {
drvp0->PIO_mode = drvp1->PIO_mode =
min(drvp0->PIO_mode, drvp1->PIO_mode);
}
for (drive = 0; drive < 2; drive++) {
drvp = &chp->ch_drive[drive];
- if (drvp->drive_type != DRIVET_NONE) {
+ if (drvp->drive_type != ATA_DRIVET_NONE) {
(*sc->sc_calc_timing)(sc, drive);
bus_space_write_4(wdr->cmd_iot, wdr->cmd_baseioh,
PIO_CONFIG_REG, sc->sc_piotiming_r[drive]);
@@ -266,12 +266,12 @@
pioconf = pio_timing_kauai[piomode];
dmaconf = 0;
- if (drvp->drive_flags & DRIVE_DMA)
+ if (drvp->drive_flags & ATA_DRIVE_DMA)
dmaconf |= dma_timing_kauai[dmamode];
- if (drvp->drive_flags & DRIVE_UDMA)
+ if (drvp->drive_flags & ATA_DRIVE_UDMA)
dmaconf |= udma_timing_kauai[udmamode];
- if (drvp->drive_flags & DRIVE_UDMA)
+ if (drvp->drive_flags & ATA_DRIVE_UDMA)
dmaconf |= 1;
sc->sc_piotiming_r[drive] = sc->sc_piotiming_w[drive] = pioconf;
diff -r 6b3b641e7fd4 -r 5103b3ea9489 sys/arch/macppc/dev/wdc_obio.c
--- a/sys/arch/macppc/dev/wdc_obio.c Sun Jul 15 09:13:59 2012 +0000
+++ b/sys/arch/macppc/dev/wdc_obio.c Sun Jul 15 10:55:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_obio.c,v 1.54 2012/07/02 18:15:45 bouyer Exp $ */
+/* $NetBSD: wdc_obio.c,v 1.55 2012/07/15 10:55:28 dsl Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.54 2012/07/02 18:15:45 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.55 2012/07/15 10:55:28 dsl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -319,7 +319,7 @@
drvp = &chp->ch_drive[drive];
/* set up pio mode timings */
- if (drvp->drive_type != DRIVET_NONE) {
+ if (drvp->drive_type != ATA_DRIVET_NONE) {
int piomode = drvp->PIO_mode;
min_cycle = pio_timing[piomode].cycle;
min_active = pio_timing[piomode].active;
@@ -335,7 +335,7 @@
conf |= (inact_tick << 5) | act_tick;
}
/* Set up DMA mode timings */
- if (drvp->drive_flags & DRIVE_DMA) {
+ if (drvp->drive_flags & ATA_DRIVE_DMA) {
int dmamode = drvp->DMA_mode;
min_cycle = dma_timing[dmamode].cycle;
min_active = dma_timing[dmamode].active;
@@ -385,7 +385,7 @@
drvp = &chp->ch_drive[drive];
/* set up pio mode timings */
- if (drvp->drive_type != DRIVET_NONE) {
+ if (drvp->drive_type != ATA_DRIVET_NONE) {
int piomode = drvp->PIO_mode;
min_cycle = pio_timing[piomode].cycle;
min_active = pio_timing[piomode].active;
@@ -397,7 +397,7 @@
conf |= (inact_tick << 5) | act_tick;
}
/* set up dma mode timings */
- if (drvp->drive_flags & DRIVE_DMA) {
+ if (drvp->drive_flags & ATA_DRIVE_DMA) {
int dmamode = drvp->DMA_mode;
min_cycle = dma_timing[dmamode].cycle;
min_active = dma_timing[dmamode].active;
@@ -408,7 +408,7 @@
conf |= (act_tick << 10) | (inact_tick << 15);
}
/* set up udma mode timings */
- if (drvp->drive_flags & DRIVE_UDMA) {
+ if (drvp->drive_flags & ATA_DRIVE_UDMA) {
int udmamode = drvp->UDMA_mode;
min_cycle = udma_timing[udmamode].cycle;
min_active = udma_timing[udmamode].active;
diff -r 6b3b641e7fd4 -r 5103b3ea9489 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Jul 15 09:13:59 2012 +0000
+++ b/sys/dev/ata/ata.c Sun Jul 15 10:55:27 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ata.c,v 1.117 2012/07/02 18:15:46 bouyer Exp $ */
+/* $NetBSD: ata.c,v 1.118 2012/07/15 10:55:29 dsl Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.117 2012/07/02 18:15:46 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.118 2012/07/15 10:55:29 dsl Exp $");
#include "opt_ata.h"
@@ -236,7 +236,7 @@
goto out;
KASSERT(chp->ch_ndrives == 0 || chp->ch_drive != NULL);
for (i = 0; i < chp->ch_ndrives; i++)
- if (chp->ch_drive[i].drive_type != DRIVET_NONE)
+ if (chp->ch_drive[i].drive_type != ATA_DRIVET_NONE)
break;
if (i == chp->ch_ndrives)
goto out;
@@ -288,13 +288,13 @@
* First look for a port multiplier
*/
if (chp->ch_ndrives == PMP_MAX_DRIVES &&
- chp->ch_drive[PMP_PORT_CTL].drive_type == DRIVET_PM) {
+ chp->ch_drive[PMP_PORT_CTL].drive_type == ATA_DRIVET_PM) {
#if NSATA_PMP > 0
satapmp_attach(chp);
#else
aprint_error_dev(atabus_sc->sc_dev,
"SATA port multiplier not supported\n");
- /* no problems going on, all drives are DRIVET_NONE */
+ /* no problems going on, all drives are ATA_DRIVET_NONE */
#endif
}
@@ -303,7 +303,7 @@
*/
KASSERT(chp->ch_ndrives == 0 || chp->ch_drive != NULL);
for (i = 0; i < chp->ch_ndrives && chp->atapibus == NULL; i++) {
- if (chp->ch_drive[i].drive_type == DRIVET_ATAPI) {
+ if (chp->ch_drive[i].drive_type == ATA_DRIVET_ATAPI) {
#if NATAPIBUS > 0
(*atac->atac_atapibus_attach)(atabus_sc);
#else
@@ -315,8 +315,8 @@
chp->atapibus = NULL;
s = splbio();
for (i = 0; i < chp->ch_ndrives; i++) {
- if (chp->ch_drive[i].drive_type == DRIVET_ATAPI)
- chp->ch_drive[i].drive_type = DRIVET_NONE;
+ if (chp->ch_drive[i].drive_type == ATA_DRIVET_ATAPI)
+ chp->ch_drive[i].drive_type = ATA_DRIVET_NONE;
}
splx(s);
#endif
@@ -326,8 +326,8 @@
for (i = 0; i < chp->ch_ndrives; i++) {
struct ata_device adev;
- if (chp->ch_drive[i].drive_type != DRIVET_ATA &&
- chp->ch_drive[i].drive_type != DRIVET_OLD) {
+ if (chp->ch_drive[i].drive_type != ATA_DRIVET_ATA &&
+ chp->ch_drive[i].drive_type != ATA_DRIVET_OLD) {
continue;
}
if (chp->ch_drive[i].drv_softc != NULL)
@@ -343,7 +343,7 @@
ata_probe_caps(&chp->ch_drive[i]);
} else {
s = splbio();
- chp->ch_drive[i].drive_type = DRIVET_NONE;
+ chp->ch_drive[i].drive_type = ATA_DRIVET_NONE;
splx(s);
}
}
@@ -356,7 +356,7 @@
#if NATARAID > 0
if (atac->atac_cap & ATAC_CAP_RAID) {
for (i = 0; i < chp->ch_ndrives; i++) {
- if (chp->ch_drive[i].drive_type == DRIVET_ATA) {
+ if (chp->ch_drive[i].drive_type == ATA_DRIVET_ATA) {
ata_raid_check_component(
chp->ch_drive[i].drv_softc);
}
@@ -370,11 +370,11 @@
*/
s = splbio();
for (i = 0; i < chp->ch_ndrives; i++) {
- if (chp->ch_drive[i].drive_type == DRIVET_PM)
+ if (chp->ch_drive[i].drive_type == ATA_DRIVET_PM)
continue;
if (chp->ch_drive[i].drv_softc == NULL) {
chp->ch_drive[i].drive_flags = 0;
- chp->ch_drive[i].drive_type = DRIVET_NONE;
+ chp->ch_drive[i].drive_type = ATA_DRIVET_NONE;
} else
chp->ch_drive[i].state = 0;
}
@@ -418,7 +418,7 @@
KASSERT(chp->ch_ndrives == 0 || chp->ch_drive != NULL);
for (i = 0; i < chp->ch_ndrives; i++) {
chp->ch_drive[i].drive_flags = 0;
- chp->ch_drive[i].drive_type = DRIVET_NONE;
+ chp->ch_drive[i].drive_type = ATA_DRIVET_NONE;
}
splx(s);
@@ -567,10 +567,10 @@
* Detach our other children.
*/
for (i = 0; i < chp->ch_ndrives; i++) {
- if (chp->ch_drive[i].drive_type == DRIVET_ATAPI)
Home |
Main Index |
Thread Index |
Old Index