From c6c9e7b65c9c790aa2631b2a38a6277830ff32ea Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 29 Sep 2008 18:17:23 +0000 Subject: [PATCH] Minor style fixes from mav@ (with similar problems fixed where I noticed them): #define zero memory when we allocate it Put device name in error message. Submitted by: mav@ --- sys/dev/mmc/mmc.c | 5 +++-- sys/dev/mmc/mmcreg.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index 831a94384b2..c9182579fdb 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -618,14 +618,15 @@ mmc_discover_cards(struct mmc_softc *sc) device_t child; while (1) { - ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, M_WAITOK); + ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, + M_WAITOK | M_ZERO); if (!ivar) return; err = mmc_all_send_cid(sc, ivar->raw_cid); if (err == MMC_ERR_TIMEOUT) break; if (err != MMC_ERR_NONE) { - printf("Error reading CID %d\n", err); + device_printf(sc->dev, "Error reading CID %d\n", err); break; } if (mmcbr_get_mode(sc->dev) == mode_sd) { diff --git a/sys/dev/mmc/mmcreg.h b/sys/dev/mmc/mmcreg.h index fddaf976358..6bd45fc5f6a 100644 --- a/sys/dev/mmc/mmcreg.h +++ b/sys/dev/mmc/mmcreg.h @@ -96,7 +96,7 @@ struct mmc_command { #define MMC_ERR_FIFO 3 #define MMC_ERR_FAILED 4 #define MMC_ERR_INVALID 5 -#define MMC_ERR_NO_MEMORY 6 +#define MMC_ERR_NO_MEMORY 6 struct mmc_data *data; /* Data segment with cmd */ struct mmc_request *mrq; /* backpointer to request */ }; @@ -292,7 +292,7 @@ struct mmc_request { * * The MMC_OCR_CCS appears to be valid for only SD cards. */ -#define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ +#define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ #define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ #define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ #define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ -- 2.45.2