Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Simplify and avoid undefined behavior. Thi...



details:   https://anonhg.NetBSD.org/src/rev/4f556f4f44d9
branches:  trunk
changeset: 842859:4f556f4f44d9
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 26 03:27:24 2019 +0000

description:
Simplify and avoid undefined behavior. This is not a real bug because
the max number of queue is 2.

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f87025672c0f -r 4f556f4f44d9 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Fri Jul 26 02:31:09 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Fri Jul 26 03:27:24 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.123 2019/07/25 09:28:07 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.124 2019/07/26 03:27:24 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -826,7 +826,7 @@
 {
        struct ixgbe_hw *hw = &adapter->hw;
        struct ix_queue *que = &adapter->queues[vector];
-       u32             queue = 1 << vector;
+       u32             queue = 1UL << vector;
        u32             mask;
 
        mutex_enter(&que->dc_mtx);
@@ -847,7 +847,7 @@
 {
        struct ixgbe_hw *hw = &adapter->hw;
        struct ix_queue *que = &adapter->queues[vector];
-       u64             queue = (u64)(1 << vector);
+       u32             queue = 1UL << vector;
        u32             mask;
 
        mutex_enter(&que->dc_mtx);



Home | Main Index | Thread Index | Old Index