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/54d9711e2cc0
branches:  trunk
changeset: 457981:54d9711e2cc0
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 871949884c51 -r 54d9711e2cc0 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