Skip to content

Commit

Permalink
KASSERT should add newline at the end to match FreeBSD behavior
Browse files Browse the repository at this point in the history
Fix KASSERT calls that add their own newline.


git-svn-id: https://madwifi-project.org/svn/madwifi/trunk@3734 0192ed92-7a03-0410-a25b-9323aeb14dbd
  • Loading branch information
proski committed Jun 19, 2008
1 parent 717cb96 commit 941d62b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions ath/if_ath.c
Original file line number Diff line number Diff line change
Expand Up @@ -8255,7 +8255,7 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
(struct ieee80211_qosframe *)bf->bf_skb->data;
an = ATH_NODE(ni);
KASSERT(ni != NULL, ("Processing U-APSD txq for "
"ath_buf with no node!\n"));
"ath_buf with no node!"));
if (qwh->i_qos[0] & IEEE80211_QOS_EOSP) {
DPRINTF(sc, ATH_DEBUG_UAPSD,
"EOSP detected for node (" MAC_FMT ") on desc %p\n",
Expand Down Expand Up @@ -12537,7 +12537,7 @@ static inline struct ath_buf *
descdma_get_buffer(struct ath_descdma *dd, int index)
{
KASSERT((index >= 0 && index < dd->dd_nbuf),
("Invalid index, %d, requested for %s dma buffers.\n", index, dd->dd_name));
("Invalid index, %d, requested for %s dma buffers", index, dd->dd_name));
return dd->dd_bufptr + index;
}

Expand Down
8 changes: 4 additions & 4 deletions ath_rate/minstrel/minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
*try0 = sn->retry_adjusted_count[ndx];

KASSERT((ndx < sn->num_rates),
("%s: bad ndx (%d/%d) for " MAC_FMT "?\n",
("%s: bad ndx (%d/%d) for " MAC_FMT "?",
dev_info, ndx, sn->num_rates,
MAC_ADDR(an->an_node.ni_macaddr)));

Expand Down Expand Up @@ -420,17 +420,17 @@ ath_rate_get_mrr(struct ath_softc *sc, struct ath_node *an, int shortPreamble,
rc3 = 0;

KASSERT((rc1 >= 0) && (rc1 < sn->num_rates),
("%s: bad rc1 (%d/%d) for " MAC_FMT "?\n",
("%s: bad rc1 (%d/%d) for " MAC_FMT "?",
dev_info, rc1, sn->num_rates,
MAC_ADDR(an->an_node.ni_macaddr)));

KASSERT((rc2 >= 0) && (rc2 < sn->num_rates),
("%s: bad rc2 (%d/%d) for " MAC_FMT "?\n",
("%s: bad rc2 (%d/%d) for " MAC_FMT "?",
dev_info, rc2, sn->num_rates,
MAC_ADDR(an->an_node.ni_macaddr)));

KASSERT((rc3 >= 0) && (rc3 < sn->num_rates),
("%s: bad rc3 (%d/%d) for " MAC_FMT "?\n",
("%s: bad rc3 (%d/%d) for " MAC_FMT "?",
dev_info, rc3, sn->num_rates,
MAC_ADDR(an->an_node.ni_macaddr)));

Expand Down
2 changes: 1 addition & 1 deletion ath_rate/sample/sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
}

KASSERT(ndx >= 0 && ndx < sn->num_rates,
("%s: bad ndx (%u/%u) for " MAC_FMT "?\n",
("%s: bad ndx (%u/%u) for " MAC_FMT "?",
dev_info, ndx, sn->num_rates,
MAC_ADDR(an->an_node.ni_macaddr)));

Expand Down
1 change: 1 addition & 0 deletions include/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#define KASSERT(exp, msg) do { \
if (unlikely(!(exp))) { \
printk msg; \
printk("\n"); \
BUG(); \
} \
} while (0)
Expand Down
4 changes: 2 additions & 2 deletions net80211/ieee80211_crypto_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ ccmp_encrypt(struct ieee80211_key *key, struct sk_buff *skb0, int hdrlen)
space_next = len > space ? len - space : 0;
KASSERT(skb->len >= space_next,
("not enough data in following buffer, "
"skb len %u need %u\n", skb->len, space_next));
"skb len %u need %u", skb->len, space_next));

xor_block(b + space, pos_next, space_next);
CCMP_ENCRYPT(i, b, b0, pos, e, space);
Expand Down Expand Up @@ -644,7 +644,7 @@ ccmp_decrypt(struct ieee80211_key *key, u_int64_t pn, struct sk_buff *skb0, int
space_next = len > space ? len - space : 0;
KASSERT(skb->len >= space_next,
("not enough data in following buffer, "
"skb len %u need %u\n", skb->len, space_next));
"skb len %u need %u", skb->len, space_next));

xor_block(b+space, pos_next, space_next);
CCMP_DECRYPT(i, b, b0, pos, a, space);
Expand Down
4 changes: 2 additions & 2 deletions net80211/ieee80211_crypto_tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ michael_mic(struct tkip_ctx *ctx, const u8 *key,
break;
skb = skb->next;
if (skb == NULL) {
KASSERT(0, ("out of data, data_len %lu\n",
KASSERT(0, ("out of data, data_len %lu",
(unsigned long)data_len));
break;
}
Expand All @@ -893,7 +893,7 @@ michael_mic(struct tkip_ctx *ctx, const u8 *key,
data_next = skb->data;
KASSERT(skb->len >= sizeof(uint32_t) - space,
("not enough data in following buffer, "
"skb len %u need %u\n", skb->len,
"skb len %u need %u", skb->len,
(int)sizeof(uint32_t) - space));
switch (space) {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion net80211/ieee80211_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ ieee80211_node_join(struct ieee80211_node *ni, int resp)
if (IEEE80211_IS_CHAN_ANYG(ic->ic_bsschan))
ieee80211_node_join_11g(ni);

KASSERT(ni->ni_suppchans == NULL, ("not a reassociation, but suppchans bitmap not NULL\n"));
KASSERT(ni->ni_suppchans == NULL, ("not a reassociation, but suppchans bitmap not NULL"));
/* Use node's new suppchans as the current */
ni->ni_suppchans = ni->ni_suppchans_new;
ni->ni_suppchans_new = NULL;
Expand Down
14 changes: 7 additions & 7 deletions net80211/ieee80211_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ __ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int
case IEEE80211_S_SCAN: /* adhoc/hostap mode */
case IEEE80211_S_ASSOC: /* infra mode */
KASSERT(ni->ni_txrate < ni->ni_rates.rs_nrates,
("%s: bogus xmit rate %u setup\n", __func__,
("%s: bogus xmit rate %u setup", __func__,
ni->ni_txrate));
#ifdef IEEE80211_DEBUG
if (ieee80211_msg_debug(vap)) {
Expand Down Expand Up @@ -1681,14 +1681,14 @@ static int get_dominant_state(struct ieee80211com *ic) {
tmpvap->iv_state == IEEE80211_S_AUTH ||
tmpvap->iv_state == IEEE80211_S_ASSOC) {
KASSERT((nscanning <= 1), ("Two VAPs cannot scan at "
"the same time\n"));
"the same time"));
nscanning++;
}
}
KASSERT(!(nscanning && nrunning), ("SCAN and RUN can't happen at the "
"same time\n"));
"same time"));
KASSERT((nscanning <= 1), ("Two VAPs must not SCAN at the "
"same time\n"));
"same time"));

if (nrunning > 0)
return IEEE80211_S_RUN;
Expand Down Expand Up @@ -1725,17 +1725,17 @@ dump_vap_states(struct ieee80211com *ic, struct ieee80211vap *highlighed)
}
if (tmpvap->iv_state == IEEE80211_S_RUN) {
KASSERT((nscanning == 0), ("SCAN and RUN can't happen "
"at the same time\n"));
"at the same time"));
nrunning++;
}
if (tmpvap->iv_state == IEEE80211_S_SCAN ||
/* STA in WDS/Repeater */
tmpvap->iv_state == IEEE80211_S_AUTH ||
tmpvap->iv_state == IEEE80211_S_ASSOC) {
KASSERT((nscanning == 0), ("Two VAPs cannot scan at "
"the same time\n"));
"the same time"));
KASSERT((nrunning == 0), ("SCAN and RUN can't happen "
"at the same time\n"));
"at the same time"));
nscanning++;
}
}
Expand Down

0 comments on commit 941d62b

Please sign in to comment.