From: Marek Lindner Date: Fri, 29 Jul 2011 16:31:38 +0000 (+0200) Subject: batman-adv: reuse tt_len() to calculate tt buffer length X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=267151cdfd17c9dd3923c8ed75ef03725cbdd539;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git batman-adv: reuse tt_len() to calculate tt buffer length Signed-off-by: Marek Lindner Acked-by: Antonio Quartulli --- diff --git a/net/batman-adv/aggregation.h b/net/batman-adv/aggregation.h index 216337bb841f..df4a5a943088 100644 --- a/net/batman-adv/aggregation.h +++ b/net/batman-adv/aggregation.h @@ -28,8 +28,7 @@ static inline int aggregated_packet(int buff_pos, int packet_len, int tt_num_changes) { - int next_buff_pos = buff_pos + BAT_PACKET_LEN + (tt_num_changes * - sizeof(struct tt_change)); + int next_buff_pos = buff_pos + BAT_PACKET_LEN + tt_len(tt_num_changes); return (next_buff_pos <= packet_len) && (next_buff_pos <= MAX_AGGREGATION_BYTES);