Skip to content

Commit

Permalink
Use BUILD_BUG_ON instead of checking size at runtime for pcie_tx_init…
Browse files Browse the repository at this point in the history
…_ndp

Use BUILD_BUG_ON instead of checking size at runtime for
pcie_tx_init_ndp.

Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
Ansuel committed May 12, 2024
1 parent 44419b1 commit dba7428
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions hif/pcie/8964/tx_ndp.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,8 @@ int pcie_tx_init_ndp(struct ieee80211_hw *hw)
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(&skb);
int rc;

if (sizeof(struct pcie_tx_ctrl_ndp) >
sizeof(tx_info->driver_data)) {
wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n",
sizeof(struct pcie_tx_ctrl_ndp),
sizeof(tx_info->driver_data));
return -ENOMEM;
}
BUILD_BUG_ON(sizeof(struct pcie_tx_ctrl_ndp) >
sizeof(tx_info->driver_data));

rc = pcie_tx_ring_alloc_ndp(priv);
if (rc) {
Expand Down

0 comments on commit dba7428

Please sign in to comment.