From patchwork Sun Jul 23 01:34:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 792510 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="I7DEZPGB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xFRsQ13R6z9sPs for ; Sun, 23 Jul 2017 11:35:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755281AbdGWBff (ORCPT ); Sat, 22 Jul 2017 21:35:35 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:38700 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755172AbdGWBfd (ORCPT ); Sat, 22 Jul 2017 21:35:33 -0400 Received: by mail-pg0-f67.google.com with SMTP id s4so8500954pgr.5; Sat, 22 Jul 2017 18:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=IP8z4GOHmV9XQVgK/5wi72jw8ovQwKnRG+E6mXxnPxw=; b=I7DEZPGBsd8a2N8EVyXfqqqZ2mJLWz/hKXny2g+QUF8ugi1oR1fSMLE6sQFpIy9Bgn 2LGBDUxW4AWpigjBT0kwq5OYJjMjfXWZtdYyvhRu2USHpTTiwgH085/f0wVm1L4vOdGU Zq8Ht2Om9snqPB5lBxOy/32eRDDnZaMjgcRhlhIz+fODF7UAMQOjvtD6Ys7Gx5dYASk6 qVduUWq2vCwhCSIp49Zcsnab1qO70lc1AUGiN3b9l5dD2uNwR+le3Luy9tRxVcpg2ygC feWpuUz0cohS7ty9RJlUhqn3iB3DlVOslUMoIDW2Y95rIND7gZjP571dkx7LYt84N/qW Wtaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=IP8z4GOHmV9XQVgK/5wi72jw8ovQwKnRG+E6mXxnPxw=; b=mE6ff/a01IfeO2TBqe0WsOOKe09eB8q9X7ZqC0O422ULHAfFBp7nRxSJ1uqSCi5HqS geT9OTS0ukXAYJyJ5Hv2H9IAQ6w2YG13qhnUoN7u3EENogoMKm4PK2LbNH52ofbCxgBi nV4lK+mDIgTWE2sF5S2Mp2G2oGLkUhtI9M61Kd/k3d0hX+8x8cc5ATtyEeM29tTEk4iT 4K25L4z+o6pqDYF0kMgtEaTd5/zaHd5k+52F9aL9mNRvKi1XgkoPg+ox5TMiI48RznfK Iwy+WTSoP99ATiqsOuh2GLPYy9t75zhSLutPvwvyaM+PC47vEiG+VSB6ffjFgvchDySb 5F6g== X-Gm-Message-State: AIVw1105ZvbUvjT94vG0aejjXsrSPJRx1IiXVwwfUsw/mjrfkD1BRDI9 T3u3O0GCvjpLL7siQ0k= X-Received: by 10.84.241.139 with SMTP id b11mr8464701pll.422.1500773733342; Sat, 22 Jul 2017 18:35:33 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id d70sm16754114pfg.132.2017.07.22.18.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jul 2017 18:35:32 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net Subject: [PATCH net-next 06/11] sctp: remove the typedef sctp_sack_variable_t Date: Sun, 23 Jul 2017 09:34:31 +0800 Message-Id: <94b6f03745317ab5c57639f2155a5e1503b4dfb3.1500773578.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <42fb936def0c9ef0522d2e3809c9c07dccb6974f.1500773578.git.lucien.xin@gmail.com> References: <78a33af4a9d7ef7116637943dbd0ae1403d20114.1500773578.git.lucien.xin@gmail.com> <54eca4d5d79aae83b386754b4613edc388521d54.1500773578.git.lucien.xin@gmail.com> <303fa591073b161b9434fa7f81a8d9d119954359.1500773578.git.lucien.xin@gmail.com> <42fb936def0c9ef0522d2e3809c9c07dccb6974f.1500773578.git.lucien.xin@gmail.com> In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is to remove the typedef sctp_sack_variable_t, and replace with union sctp_sack_variable in the places where it's using this typedef. It is also to fix some indents in sctp_acked(). Signed-off-by: Xin Long --- include/linux/sctp.h | 6 +++--- net/sctp/outqueue.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 8faf74e..8df6ac5 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -368,17 +368,17 @@ struct sctp_gap_ack_block { __be16 end; }; -typedef union { +union sctp_sack_variable { struct sctp_gap_ack_block gab; __be32 dup; -} sctp_sack_variable_t; +}; typedef struct sctp_sackhdr { __be32 cum_tsn_ack; __be32 a_rwnd; __be16 num_gap_ack_blocks; __be16 num_dup_tsns; - sctp_sack_variable_t variable[0]; + union sctp_sack_variable variable[0]; } sctp_sackhdr_t; typedef struct sctp_sack_chunk { diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index e876270..d2a8adf 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -1197,7 +1197,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) static void sctp_sack_update_unack_data(struct sctp_association *assoc, struct sctp_sackhdr *sack) { - sctp_sack_variable_t *frags; + union sctp_sack_variable *frags; __u16 unack_data; int i; @@ -1224,7 +1224,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) struct sctp_transport *transport; struct sctp_chunk *tchunk = NULL; struct list_head *lchunk, *transport_list, *temp; - sctp_sack_variable_t *frags = sack->variable; + union sctp_sack_variable *frags = sack->variable; __u32 sack_ctsn, ctsn, tsn; __u32 highest_tsn, highest_new_tsn; __u32 sack_a_rwnd; @@ -1736,10 +1736,10 @@ static void sctp_mark_missing(struct sctp_outq *q, /* Is the given TSN acked by this packet? */ static int sctp_acked(struct sctp_sackhdr *sack, __u32 tsn) { - int i; - sctp_sack_variable_t *frags; - __u16 tsn_offset, blocks; __u32 ctsn = ntohl(sack->cum_tsn_ack); + union sctp_sack_variable *frags; + __u16 tsn_offset, blocks; + int i; if (TSN_lte(tsn, ctsn)) goto pass;