Module Name: src Committed By: msaitoh Date: Fri Jul 26 03:27:24 UTC 2019
Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: Simplify and avoid undefined behavior. This is not a real bug because the max number of queue is 2. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.123 src/sys/dev/pci/ixgbe/ixv.c:1.124 --- src/sys/dev/pci/ixgbe/ixv.c:1.123 Thu Jul 25 09:28:07 2019 +++ src/sys/dev/pci/ixgbe/ixv.c Fri Jul 26 03:27:24 2019 @@ -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 @@ ixv_enable_queue(struct adapter *adapter { 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 @@ ixv_disable_queue(struct adapter *adapte { 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);