Module Name:    src
Committed By:   he
Date:           Thu Mar 22 08:54:48 UTC 2012

Modified Files:
        src/lib/libarch/alpha: alpha_pci_io.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libarch/alpha/alpha_pci_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libarch/alpha/alpha_pci_io.c
diff -u src/lib/libarch/alpha/alpha_pci_io.c:1.5 src/lib/libarch/alpha/alpha_pci_io.c:1.6
--- src/lib/libarch/alpha/alpha_pci_io.c:1.5	Mon Apr 28 20:22:55 2008
+++ src/lib/libarch/alpha/alpha_pci_io.c	Thu Mar 22 08:54:48 2012
@@ -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
 {
 	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
 {
 	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();

Reply via email to