From patchwork Fri Oct 9 00:41:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sailer X-Patchwork-Id: 528036 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 49D9C140D6E for ; Fri, 9 Oct 2015 11:52:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512AbbJIAwn (ORCPT ); Thu, 8 Oct 2015 20:52:43 -0400 Received: from gloster.rz.uni-augsburg.de ([137.250.2.98]:34949 "EHLO gloster.rz.uni-augsburg.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756051AbbJIAwm (ORCPT ); Thu, 8 Oct 2015 20:52:42 -0400 X-Greylist: delayed 640 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Oct 2015 20:52:41 EDT Received: from limone.rz.uni-augsburg.de ([137.250.1.101]) by gloster.rz.uni-augsburg.de with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ZkLl1-0007X0-OH; Fri, 09 Oct 2015 02:41:59 +0200 Received: from ch-die001-vserver-171.customer.fsit.com ([185.32.124.171] helo=yang.openlab.lan) by limone.rz.uni-augsburg.de with esmtpsa (UNKNOWN:AES128-SHA256:128) (Exim 4.72) (envelope-from ) id 1ZkLl1-0001k8-6L; Fri, 09 Oct 2015 02:41:59 +0200 From: Richard Sailer To: netdev@vger.kernel.org, davem@davemloft.net Cc: kuznet@ms2.inr.ac.ru, jmorris@namei.org Subject: [PATCH net] tcp: change type of alive from int to bool Date: Fri, 9 Oct 2015 02:41:37 +0200 Message-Id: <1444351297-22614-1-git-send-email-richard@weltraumpflege.org> X-Mailer: git-send-email 2.5.3 X-uaux-clamav: 69b8bcd5c401698f58edbb0f835a48e6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The alive parameter of tcp_orphan_retries, indicates whether the connection is assumed alive or not. In the function and all places calling it is used as a boolean value. Therefore this changes the type of alive to bool in the function definition and all calling locations. Since tcp_orphan_tries is a tcp_timer.c local function no change in any other file or header is necessary. Signed-off-by: Richard Sailer --- net/ipv4/tcp_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 7149ebc..c9c716a 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -83,7 +83,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset) } /* Calculate maximal number or retries on an orphaned socket. */ -static int tcp_orphan_retries(struct sock *sk, int alive) +static int tcp_orphan_retries(struct sock *sk, bool alive) { int retries = sysctl_tcp_orphan_retries; /* May be zero. */ @@ -184,7 +184,7 @@ static int tcp_write_timeout(struct sock *sk) retry_until = sysctl_tcp_retries2; if (sock_flag(sk, SOCK_DEAD)) { - const int alive = icsk->icsk_rto < TCP_RTO_MAX; + const bool alive = icsk->icsk_rto < TCP_RTO_MAX; retry_until = tcp_orphan_retries(sk, alive); do_reset = alive || @@ -298,7 +298,7 @@ static void tcp_probe_timer(struct sock *sk) max_probes = sysctl_tcp_retries2; if (sock_flag(sk, SOCK_DEAD)) { - const int alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX; + const bool alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX; max_probes = tcp_orphan_retries(sk, alive); if (!alive && icsk->icsk_backoff >= max_probes)