Re: [PATCH 6/7] staging: wfx: drop calls to BUG_ON()
From: Dan Carpenter
Date: Tue Oct 08 2019 - 08:08:09 EST
On Tue, Oct 08, 2019 at 09:43:01AM +0000, Jerome Pouiller wrote:
> @@ -56,9 +56,9 @@ static uint8_t fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
> {
> uint8_t *keybuf = key->key;
>
> - WARN_ON(key->keylen != sizeof(msg->tkip_key_data)
> - + sizeof(msg->tx_mic_key)
> - + sizeof(msg->rx_mic_key));
> + WARN(key->keylen != sizeof(msg->tkip_key_data)
> + + sizeof(msg->tx_mic_key)
> + + sizeof(msg->rx_mic_key), "inconsistent data");
This is not a comment on the patch since the code was like that
originally, but the " +" should go of the first line:
WARN(key->keylen != sizeof(msg->tkip_key_data) +
sizeof(msg->tx_mic_key) +
sizeof(msg->rx_mic_key),
"inconsistent data");
That doesn't look too good still... The error message is sort of
rubbish also. Anyway the operator goes on the first line.
regards,
dan carpenter