From 5a89aa1d25bb6391c07005ce951b3307655f7035 Mon Sep 17 00:00:00 2001 From: marius Date: Wed, 9 Feb 2011 11:28:57 +0000 Subject: Correct signedness and off-by-one issues in parameters used for DMA tag creation. PR: 154259 Submitted by: Vladislav Movchan (partially) MFC after: 3 days --- sys/dev/sound/pci/emu10k1.c | 2 +- sys/dev/sound/pci/emu10kx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/sound') diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index 43b7ebe..4c02fa4 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -2017,7 +2017,7 @@ emu_pci_attach(device_t dev) if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/2, /*boundary*/0, - /*lowaddr*/1 << 31, /* can only access 0-2gb */ + /*lowaddr*/(1U << 31) - 1, /* can only access 0-2gb */ /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/sc->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index f1d10ed..c7ac57f 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -2700,7 +2700,7 @@ emu_init(struct emu_sc_info *sc) if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(sc->dev), /* alignment */ 2, /* boundary */ 0, - /* lowaddr */ 1 << 31, /* can only access 0-2gb */ + /* lowaddr */ (1U << 31) - 1, /* can only access 0-2gb */ /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, /* maxsize */ EMU_MAX_BUFSZ, /* nsegments */ 1, /* maxsegz */ 0x3ffff, -- cgit v1.1