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

sctp: delete the nested flexible array skip

This patch deletes the flexible-array skip[] from the structure
sctp_ifwdtsn/fwdtsn_hdr to avoid some sparse warnings:

# make C=2 CF="-Wflexible-array-nested" M=./net/sctp/
net/sctp/stream_interleave.c: note: in included file (through include/net/sctp/structs.h, include/net/sctp/sctp.h):
./include/linux/sctp.h:611:32: warning: nested flexible array
./include/linux/sctp.h:628:33: warning: nested flexible array

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Xin Long and committed by
David S. Miller
73175a04 add7370a

+6 -6
+2 -2
include/linux/sctp.h
··· 603 603 604 604 struct sctp_fwdtsn_hdr { 605 605 __be32 new_cum_tsn; 606 - struct sctp_fwdtsn_skip skip[]; 606 + /* struct sctp_fwdtsn_skip skip[]; */ 607 607 }; 608 608 609 609 struct sctp_fwdtsn_chunk { ··· 620 620 621 621 struct sctp_ifwdtsn_hdr { 622 622 __be32 new_cum_tsn; 623 - struct sctp_ifwdtsn_skip skip[]; 623 + /* struct sctp_ifwdtsn_skip skip[]; */ 624 624 }; 625 625 626 626 struct sctp_ifwdtsn_chunk {
+2 -2
include/net/sctp/sctp.h
··· 452 452 _sctp_walk_fwdtsn((pos), (chunk), ntohs((chunk)->chunk_hdr->length) - sizeof(struct sctp_fwdtsn_chunk)) 453 453 454 454 #define _sctp_walk_fwdtsn(pos, chunk, end)\ 455 - for (pos = chunk->subh.fwdtsn_hdr->skip;\ 456 - (void *)pos <= (void *)chunk->subh.fwdtsn_hdr->skip + end - sizeof(struct sctp_fwdtsn_skip);\ 455 + for (pos = (void *)(chunk->subh.fwdtsn_hdr + 1);\ 456 + (void *)pos <= (void *)(chunk->subh.fwdtsn_hdr + 1) + end - sizeof(struct sctp_fwdtsn_skip);\ 457 457 pos++) 458 458 459 459 /* External references. */
+2 -2
net/sctp/stream_interleave.c
··· 1153 1153 } 1154 1154 1155 1155 #define _sctp_walk_ifwdtsn(pos, chunk, end) \ 1156 - for (pos = chunk->subh.ifwdtsn_hdr->skip; \ 1157 - (void *)pos <= (void *)chunk->subh.ifwdtsn_hdr->skip + (end) - \ 1156 + for (pos = (void *)(chunk->subh.ifwdtsn_hdr + 1); \ 1157 + (void *)pos <= (void *)(chunk->subh.ifwdtsn_hdr + 1) + (end) - \ 1158 1158 sizeof(struct sctp_ifwdtsn_skip); pos++) 1159 1159 1160 1160 #define sctp_walk_ifwdtsn(pos, ch) \