Skip to content

Commit

Permalink
sctp: remove the typedef sctp_data_chunk_t
Browse files Browse the repository at this point in the history
This patch is to remove the typedef sctp_data_chunk_t, and replace
with struct sctp_data_chunk in the places where it's using this
typedef.

Signed-off-by: Xin Long <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
lxin authored and davem330 committed Jul 1, 2017
1 parent 3583df1 commit 9f8d314
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/linux/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ struct sctp_datahdr {
__u8 payload[0];
};

typedef struct sctp_data_chunk {
struct sctp_data_chunk {
struct sctp_chunkhdr chunk_hdr;
struct sctp_datahdr data_hdr;
} sctp_data_chunk_t;
};

/* DATA Chuck Specific Flags */
enum {
Expand Down
2 changes: 1 addition & 1 deletion include/net/sctp/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive)
/* Calculate the actual data size in a data chunk */
#define SCTP_DATA_SNDSIZE(c) ((int)((unsigned long)(c->chunk_end)\
- (unsigned long)(c->chunk_hdr)\
- sizeof(sctp_data_chunk_t)))
- sizeof(struct sctp_data_chunk)))

/* Internal error codes */
typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion include/net/sctp/sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static inline __u16 sctp_data_size(struct sctp_chunk *chunk)
__u16 size;

size = ntohs(chunk->chunk_hdr->length);
size -= sizeof(sctp_data_chunk_t);
size -= sizeof(struct sctp_data_chunk);

return size;
}
Expand Down
4 changes: 2 additions & 2 deletions net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet,
/* Check whether this chunk and all the rest of pending data will fit
* or delay in hopes of bundling a full sized packet.
*/
if (chunk->skb->len + q->out_qlen >
transport->pathmtu - packet->overhead - sizeof(sctp_data_chunk_t) - 4)
if (chunk->skb->len + q->out_qlen > transport->pathmtu -
packet->overhead - sizeof(struct sctp_data_chunk) - 4)
/* Enough data queued to fill a packet */
return SCTP_XMIT_OK;

Expand Down
6 changes: 3 additions & 3 deletions net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(struct net *net,
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
}

if (!sctp_chunk_length_valid(chunk, sizeof(sctp_data_chunk_t)))
if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_data_chunk)))
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
commands);

Expand Down Expand Up @@ -3109,7 +3109,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(struct net *net,
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
}

if (!sctp_chunk_length_valid(chunk, sizeof(sctp_data_chunk_t)))
if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_data_chunk)))
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
commands);

Expand Down Expand Up @@ -6262,7 +6262,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
* Actually, allow a little bit of overflow (up to a MTU).
*/
datalen = ntohs(chunk->chunk_hdr->length);
datalen -= sizeof(sctp_data_chunk_t);
datalen -= sizeof(struct sctp_data_chunk);

deliver = SCTP_CMD_CHUNK_ULP;

Expand Down
2 changes: 1 addition & 1 deletion net/sctp/ulpqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,

if (chunk) {
needed = ntohs(chunk->chunk_hdr->length);
needed -= sizeof(sctp_data_chunk_t);
needed -= sizeof(struct sctp_data_chunk);
} else
needed = SCTP_DEFAULT_MAXWINDOW;

Expand Down

0 comments on commit 9f8d314

Please sign in to comment.