Add a cast of the shift count to int32_t, so that we don't try

to do int32_t << long, since ANSI C doesn't perform "balancing"
before the shift operation according to lint.  Should not make a
difference, offset is limited to 0..3 anyway.
This commit is contained in:
he 2012-03-22 08:54:48 +00:00
parent 2df8a64968
commit b722f9f3bf

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_pci_io.c,v 1.5 2008/04/28 20:22:55 martin Exp $ */
/* $NetBSD: alpha_pci_io.c,v 1.6 2012/03/22 08:54:48 he Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -195,7 +195,7 @@ alpha_pci_io_swiz_outb(bus_addr_t ioaddr, uint8_t val)
{
uint32_t *port = alpha_pci_io_swiz(ioaddr, 0);
bus_addr_t offset = ioaddr & 3;
uint32_t nval = ((uint32_t)val) << (8 * offset);
uint32_t nval = ((uint32_t)val) << (uint32_t)(8 * offset);
*port = nval;
alpha_mb();
@ -206,7 +206,7 @@ alpha_pci_io_swiz_outw(bus_addr_t ioaddr, uint16_t val)
{
uint32_t *port = alpha_pci_io_swiz(ioaddr, 1);
bus_addr_t offset = ioaddr & 3;
uint32_t nval = ((uint32_t)val) << (8 * offset);
uint32_t nval = ((uint32_t)val) << (uint32_t)(8 * offset);
*port = nval;
alpha_mb();