ath10k: cleanup ath10k_bmi_fast_download()
PATCH 1/1 ath10k: cleanup ath10k_bmi_fast_download()
Signed-off-by Michal Kazior <[email protected]>
--- drivers/net/wireless/ath/ath10k/bmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.c +8 -9
@@ -261,26 +261,25 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address)int ath10k_bmi_fast_download (struct ath10k *ar,u32 address,const void *buffer,u32 length) { +u8 trailer[4 ] = {}; +u32 head_len =rounddown (length,4 ); +u32 trailer_len = length - head_len;int ret; -u32 last_work =0 ; -u32 last_work_offset = length & ~0x3 ; -u32 unaligned_bytes = length &0x3 ; ret =ath10k_bmi_lz_stream_start (ar, address);if (ret)return ret;/* copy the last word into a zero padded buffer */ -if (unaligned_bytes) -memcpy (&last_work, buffer + last_work_offset, unaligned_bytes); - - ret =ath10k_bmi_lz_data (ar, buffer, last_work_offset); +if (trailer_len >0 ) +memcpy (trailer, buffer + head_len, trailer_len); + ret =ath10k_bmi_lz_data (ar, buffer, head_len);if (ret)return ret; -if (unaligned_bytes) - ret =ath10k_bmi_lz_data (ar, &last_work,4 ); +if (trailer_len >0 ) + ret =ath10k_bmi_lz_data (ar, trailer,4 );if (ret !=0 )return ret;
Signature · 1 line
1.7.9.5
Kalle Valo
AppliedPATCH 1/1 ath10k: cleanup ath10k_bmi_fast_download()
Quoted 1 line · Michal Kazior
Signed-off-by Michal Kazior <[email protected]>
Thanks, applied.
Signature · 1 line
Kalle Valo