wifi: brcm80211: Use min() to improve code
Use min() to reduce the code and improve its readability. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>> Link: https://patch.msgid.link/20250715121721.266713-5-rongqianfeng@vivo.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
committed by
Johannes Berg
parent
6d0a67c600
commit
b60c49590a
@@ -927,10 +927,7 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
|
||||
/* Wait until the usb device reports it received all
|
||||
* the bytes we sent */
|
||||
if ((rdlbytes == sent) && (rdlbytes != dllen)) {
|
||||
if ((dllen-sent) < TRX_RDL_CHUNK)
|
||||
sendlen = dllen-sent;
|
||||
else
|
||||
sendlen = TRX_RDL_CHUNK;
|
||||
sendlen = min(dllen - sent, TRX_RDL_CHUNK);
|
||||
|
||||
/* simply avoid having to send a ZLP by ensuring we
|
||||
* never have an even
|
||||
|
||||
@@ -25825,10 +25825,8 @@ wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
|
||||
|
||||
if (mphase) {
|
||||
cal_cnt = pi->mphase_txcal_cmdidx;
|
||||
if ((cal_cnt + pi->mphase_txcal_numcmds) < max_cal_cmds)
|
||||
num_cals = cal_cnt + pi->mphase_txcal_numcmds;
|
||||
else
|
||||
num_cals = max_cal_cmds;
|
||||
num_cals = min(cal_cnt + pi->mphase_txcal_numcmds,
|
||||
max_cal_cmds);
|
||||
} else {
|
||||
cal_cnt = 0;
|
||||
num_cals = max_cal_cmds;
|
||||
|
||||
Reference in New Issue
Block a user