Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6041803ybe; Tue, 10 Sep 2019 12:36:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuxQMUWUzDTDQ4HsJq+kexvBH0jTcLL/GsTxQxjBm+2hDMwQM/8rYjG/zdbD6GfJWqnZdg X-Received: by 2002:aa7:c649:: with SMTP id z9mr31795713edr.97.1568144161088; Tue, 10 Sep 2019 12:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568144161; cv=none; d=google.com; s=arc-20160816; b=JGFp4KZZp/4uGlqcYSaalBSyF6LOCfROTydevDSBsLixuYKHPwY7/6TcBNr3nKFBPS Gw5KCfNWvmPToiW7kPxjI3BKE2uIWaxfoChq6ZebTg1KqB+fAGi68Zw/i+NGgfh5zyY9 lYQsrOr5cyPpzlLMNfLtBJ+/G/AR8ijloNI0skGRQppjlaWq+Go4W/Zqg5uNzupKYPdB zkDZSzfbLEpYOzI8jeMJLT4FTWFI/3HceJHt6ecz5/l8tPzg5aQ8ux0DEM/5K2AvJJ6y nTeKL7H8cfj9VY+ZU5KDEibHBSMHadSBuQ/tkTeMMKKeV9cjy5z34azeWTb/EKdbX6S2 l7Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PNXHZLibSlx8GAKedEj61iEzVO7t88YI1+R7FoPooS8=; b=Ensvkddd5zz7/eaKQa8/QO1m5VKssz/DfPicwGkbaBeA5EAvqGesHUypkUavJLdJoL iWLBVuQj/3q78BydOUssbpoMhTr/Lgz1xgptTllmQthd+NEAkRwRKJyiSOAMaJ9vJ6uN xZAC69cQ+mTqlKvfgW3QvPG5+baBF1ne2no9ZS7TH370zWT9aGBv43UHfa4fKqchHJor 1VMd1R+Bun0kYp4esFgN020Tc+DBoCr8QNk1ViwF2pBz8Vqh9zIkW0vxzCmHuLmtnsA8 QLiOslrtSsxxQrZRkYXNVOnwugxJWgQ5W3Q0UDRFbm0cwbFwNvnemAKn8cWLeziWBkdF IcuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=YjDCFK4z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si9812229eje.361.2019.09.10.12.35.37; Tue, 10 Sep 2019 12:36:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=YjDCFK4z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbfIJS6e (ORCPT + 99 others); Tue, 10 Sep 2019 14:58:34 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:55946 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbfIJS6d (ORCPT ); Tue, 10 Sep 2019 14:58:33 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8AIrs0f027506; Tue, 10 Sep 2019 18:57:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=PNXHZLibSlx8GAKedEj61iEzVO7t88YI1+R7FoPooS8=; b=YjDCFK4zc9CyH8hCGLWDU+Ph0z6eFfR1BxfWSzUxQTEvqxGJsIm+GiYtNqTP6lfPKmJb ucgwJ5EebprZjNh8b7LVzgAlb+8LKbRmGQD/HYEjyljbHUnQmKp2TymM3LK/7aILWln9 T1YNDIcwV4xatReCt27cxADfoUkCRLZMXCRDX6xBE2z8EsZgwDkFkNoOoZpnJ5Fz3KGs DochFJkjG+hU+d3IkzOsC8fU42efb/nOu9jxQv4Ewn4tNIoLmJQZ23BKD6CPemjbT7rR Fc1fZ/97rYHJC3tmv53eFqGgmMZdX51OiGiPGMwZgKFWWWoLHpAA95ke4GPbeifEX8OB lA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2uw1jkdfq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2019 18:57:29 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8AIrpgJ105209; Tue, 10 Sep 2019 18:57:28 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2uwq9qg20v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2019 18:57:28 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x8AIvOHt018523; Tue, 10 Sep 2019 18:57:24 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Sep 2019 11:57:23 -0700 Date: Tue, 10 Sep 2019 21:57:10 +0300 From: Dan Carpenter To: Mao Wenan Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, marcelo.leitner@gmail.com, davem@davemloft.net, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH net 1/2] sctp: remove redundant assignment when call sctp_get_port_local Message-ID: <20190910185710.GF15977@kadam> References: <20190910071343.18808-1-maowenan@huawei.com> <20190910071343.18808-2-maowenan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190910071343.18808-2-maowenan@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9376 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909100176 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9376 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909100176 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 10, 2019 at 03:13:42PM +0800, Mao Wenan wrote: > There are more parentheses in if clause when call sctp_get_port_local > in sctp_do_bind, and redundant assignment to 'ret'. This patch is to > do cleanup. > > Signed-off-by: Mao Wenan > --- > net/sctp/socket.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/sctp/socket.c b/net/sctp/socket.c > index 9d1f83b10c0a..766b68b55ebe 100644 > --- a/net/sctp/socket.c > +++ b/net/sctp/socket.c > @@ -399,9 +399,8 @@ static int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) > * detection. > */ > addr->v4.sin_port = htons(snum); > - if ((ret = sctp_get_port_local(sk, addr))) { > + if (sctp_get_port_local(sk, addr)) > return -EADDRINUSE; sctp_get_port_local() returns a long which is either 0,1 or a pointer casted to long. It's not documented what it means and neither of the callers use the return since commit 62208f12451f ("net: sctp: simplify sctp_get_port"). Probably it should just return a bool? regards, dan carpenter