Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wfx: simplify hif_multi_tx_confirm()

Usage of the "buf_loc" variable does not simplify the function.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-65-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
240503a6 2f5fd8b0

+3 -8
+3 -8
drivers/staging/wfx/hif_rx.c
··· 77 77 const struct hif_msg *hif, const void *buf) 78 78 { 79 79 const struct hif_cnf_multi_transmit *body = buf; 80 - const struct hif_cnf_tx *buf_loc = 81 - (const struct hif_cnf_tx *)&body->tx_conf_payload; 82 80 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 83 - int count = body->num_tx_confs; 84 81 int i; 85 82 86 - WARN(count <= 0, "corrupted message"); 83 + WARN(body->num_tx_confs <= 0, "corrupted message"); 87 84 WARN_ON(!wvif); 88 85 if (!wvif) 89 86 return -EFAULT; 90 87 91 - for (i = 0; i < count; ++i) { 92 - wfx_tx_confirm_cb(wvif, buf_loc); 93 - buf_loc++; 94 - } 88 + for (i = 0; i < body->num_tx_confs; i++) 89 + wfx_tx_confirm_cb(wvif, &body->tx_conf_payload[i]); 95 90 return 0; 96 91 } 97 92