linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] sctp: fix a plenty of flexible-array-nested warnings
@ 2023-04-19 15:16 Xin Long
  2023-04-19 15:16 ` [PATCH net-next 1/6] sctp: delete the nested flexible array params Xin Long
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Xin Long @ 2023-04-19 15:16 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: davem, kuba, Eric Dumazet, Paolo Abeni, Marcelo Ricardo Leitner

Paolo noticed a compile warning in SCTP,

../net/sctp/stream_sched_fc.c: note: in included file (through ../include/net/sctp/sctp.h):
../include/net/sctp/structs.h:335:41: warning: array of flexible structures

But not only this, there are actually quite a lot of such warnings in
some SCTP structs. This patchset fixes most of warnings by deleting
these nested flexible array members.

After this patchset, there are still some warnings left:

  # make C=2 CF="-Wflexible-array-nested" M=./net/sctp/
  ./include/net/sctp/structs.h:1145:41: warning: nested flexible array
  ./include/uapi/linux/sctp.h:641:34: warning: nested flexible array
  ./include/uapi/linux/sctp.h:643:34: warning: nested flexible array
  ./include/uapi/linux/sctp.h:644:33: warning: nested flexible array
  ./include/uapi/linux/sctp.h:650:40: warning: nested flexible array
  ./include/uapi/linux/sctp.h:653:39: warning: nested flexible array

the 1st is caused by __data[] in struct ip_options, not in SCTP;
the others are in uapi, and we should not touch them.

Note that instead of completely deleting it, we just leave it as a
comment in the struct, signalling to the reader that we do expect
such variable parameters over there, as Marcelo suggested.

Xin Long (6):
  sctp: delete the nested flexible array params
  sctp: delete the nested flexible array skip
  sctp: delete the nested flexible array variable
  sctp: delete the nested flexible array peer_init
  sctp: delete the nested flexible array hmac
  sctp: delete the nested flexible array payload

 include/linux/sctp.h         | 18 +++++++++---------
 include/net/sctp/sctp.h      | 12 ++++++------
 include/net/sctp/structs.h   |  2 +-
 net/sctp/associola.c         |  5 +++--
 net/sctp/auth.c              |  2 +-
 net/sctp/input.c             |  2 +-
 net/sctp/outqueue.c          | 11 +++++++----
 net/sctp/sm_make_chunk.c     | 22 +++++++++++-----------
 net/sctp/sm_sideeffect.c     |  3 +--
 net/sctp/sm_statefuns.c      | 14 ++++++--------
 net/sctp/stream.c            |  2 +-
 net/sctp/stream_interleave.c |  4 ++--
 12 files changed, 49 insertions(+), 48 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-14 16:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 15:16 [PATCH net-next 0/6] sctp: fix a plenty of flexible-array-nested warnings Xin Long
2023-04-19 15:16 ` [PATCH net-next 1/6] sctp: delete the nested flexible array params Xin Long
2023-04-19 15:16 ` [PATCH net-next 2/6] sctp: delete the nested flexible array skip Xin Long
2023-04-19 15:31   ` Stephen Hemminger
2023-04-20  1:20     ` Jakub Kicinski
2023-04-19 15:16 ` [PATCH net-next 3/6] sctp: delete the nested flexible array variable Xin Long
2023-04-19 15:16 ` [PATCH net-next 4/6] sctp: delete the nested flexible array peer_init Xin Long
2023-04-19 15:16 ` [PATCH net-next 5/6] sctp: delete the nested flexible array hmac Xin Long
2023-04-19 15:16 ` [PATCH net-next 6/6] sctp: delete the nested flexible array payload Xin Long
2023-04-20  1:18 ` [PATCH net-next 0/6] sctp: fix a plenty of flexible-array-nested warnings Jakub Kicinski
2023-12-14 16:55   ` Kees Cook
2023-04-21  7:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).