Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758298AbcLBI1N (ORCPT ); Fri, 2 Dec 2016 03:27:13 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:22553 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754978AbcLBI1M (ORCPT ); Fri, 2 Dec 2016 03:27:12 -0500 Subject: Re: [PATCH] stmmac: simplify flag assignment To: Pavel Machek , David Miller References: <20161123105125.GA26394@amd> <20161124085506.GA25007@amd> <20161124.110416.198867271899443489.davem@davemloft.net> <20161130114431.GB14296@amd> CC: , , Alexandre TORGUE From: Giuseppe CAVALLARO Message-ID: <7848a23a-7faa-be47-3c2c-da6880b2b909@st.com> Date: Fri, 2 Dec 2016 09:27:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20161130114431.GB14296@amd> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.139.54] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-02_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 859 Lines: 29 + Alex On 11/30/2016 12:44 PM, Pavel Machek wrote: > > Simplify flag assignment. > > Signed-off-by: Pavel Machek > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index ed20668..0b706a7 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -2771,12 +2771,8 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev, > features &= ~NETIF_F_CSUM_MASK; > > /* Disable tso if asked by ethtool */ > - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { > - if (features & NETIF_F_TSO) > - priv->tso = true; > - else > - priv->tso = false; > - } > + if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) > + priv->tso = !!(features & NETIF_F_TSO); > > return features; > } > >