aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2017-05-24 17:35:20 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-05-25 22:37:13 +0300
commit148a700fb9af847a64d732bf7ed9975aa03fefa9 (patch)
treea63fe6c8712c07841e4dd31e125e9f7f64466aa9 /platform/linux-generic
parentba6cad6319b917c078dd0c20cd6b011637195898 (diff)
linux-gen: packet: fix gcc errors with single segment pool
Fix (invalid) gcc errors when CONFIG_PACKET_MAX_SEGS is set to one. https://bugs.linaro.org/show_bug.cgi?id=3013 Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r--platform/linux-generic/odp_packet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 3e7c07a35..e2bb8426a 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -804,7 +804,8 @@ static inline int move_data_to_head(odp_packet_hdr_t *pkt_hdr, int segs)
free_len = BASE_LEN - len;
- for (src_seg = dst_seg + 1; src_seg < segs; src_seg++) {
+ for (src_seg = dst_seg + 1; CONFIG_PACKET_MAX_SEGS > 1 &&
+ src_seg < segs; src_seg++) {
len = fill_seg_head(pkt_hdr, dst_seg, src_seg,
free_len);
moved += len;
@@ -928,7 +929,7 @@ int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len,
pkt_hdr = new_hdr;
*pkt = packet_handle(pkt_hdr);
- } else if (free_segs) {
+ } else if (CONFIG_PACKET_MAX_SEGS > 1 && free_segs) {
new_hdr = pkt_hdr->buf_hdr.seg[free_segs].hdr;
packet_seg_copy_md(new_hdr, pkt_hdr);