All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 1/6] fm10k: Avoid crashing the kernel
@ 2016-02-10 22:45 Jacob Keller
  2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 2/6] fm10k: prevent possibly uninitialized variable Jacob Keller
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Jacob Keller @ 2016-02-10 22:45 UTC (permalink / raw)
  To: intel-wired-lan

From: Bruce Allan <bruce.w.allan@intel.com>

Use BUILD_BUG_ON() instead of BUG_ON() where appropriate to get a compile
error rather than crash the kernel.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
---
This is a direct copy of a patch from our out-of-tree driver written
by Bruce, hence the authorship and signed-off-by line.

 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index fecc51aeb6c7..7a959713daa3 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -468,7 +468,7 @@ static void fm10k_get_reg_q(struct fm10k_hw *hw, u32 *buff, int i)
 	buff[idx++] = fm10k_read_reg(hw, FM10K_TX_SGLORT(i));
 	buff[idx++] = fm10k_read_reg(hw, FM10K_PFVTCTL(i));
 
-	BUG_ON(idx != FM10K_REGS_LEN_Q);
+	BUILD_BUG_ON(idx != FM10K_REGS_LEN_Q);
 }
 
 /* If function above adds more registers this define needs to be updated */
@@ -484,7 +484,7 @@ static void fm10k_get_reg_vsi(struct fm10k_hw *hw, u32 *buff, int i)
 	for (j = 0; j < 32; j++)
 		buff[idx++] = fm10k_read_reg(hw, FM10K_RETA(i, j));
 
-	BUG_ON(idx != FM10K_REGS_LEN_VSI);
+	BUILD_BUG_ON(idx != FM10K_REGS_LEN_VSI);
 }
 
 static void fm10k_get_regs(struct net_device *netdev,
-- 
2.7.0.236.gda096a0.dirty


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-03-10  0:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 22:45 [Intel-wired-lan] [PATCH 1/6] fm10k: Avoid crashing the kernel Jacob Keller
2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 2/6] fm10k: prevent possibly uninitialized variable Jacob Keller
2016-02-25 20:27   ` Singh, Krishneil K
2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 3/6] fm10k: use ethtool_rxfh_indir_default for default redirection table Jacob Keller
2016-02-16  4:41   ` Jeff Kirsher
2016-02-25 20:28   ` Singh, Krishneil K
2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 4/6] fm10k: update driver summary and reduce code duplication Jacob Keller
2016-02-25 20:29   ` Singh, Krishneil K
2016-02-25 21:45     ` Allan, Bruce W
2016-03-09 23:51       ` Allan, Bruce W
2016-03-10  0:19         ` Keller, Jacob E
2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 5/6] fm10k: correctly clean up when init_queueing_scheme fails Jacob Keller
2016-02-25 20:30   ` Singh, Krishneil K
2016-02-10 22:45 ` [Intel-wired-lan] [PATCH 6/6] fm10k: fix a minor typo in some comments Jacob Keller
2016-02-25 20:31   ` Singh, Krishneil K
2016-02-16  3:57 ` [Intel-wired-lan] [PATCH 1/6] fm10k: Avoid crashing the kernel Jeff Kirsher
2016-02-16 18:20   ` Keller, Jacob E
2016-02-25 20:27 ` Singh, Krishneil K

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.