From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758135AbcCVBR3 (ORCPT ); Mon, 21 Mar 2016 21:17:29 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:24862 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758026AbcCVBR1 (ORCPT ); Mon, 21 Mar 2016 21:17:27 -0400 Subject: Re: [PATCH net 06/10] net: hns: fix return value of the function about rss To: David Miller References: <1458558401-190165-1-git-send-email-Yisen.Zhuang@huawei.com> <1458558401-190165-7-git-send-email-Yisen.Zhuang@huawei.com> <20160321.114238.1469581550499984000.davem@davemloft.net> CC: , , , , , , , , , , , , From: Yisen Zhuang Message-ID: <56F09CED.3060607@huawei.com> Date: Tue, 22 Mar 2016 09:16:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160321.114238.1469581550499984000.davem@davemloft.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.157.38] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56F09CF8.0012,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 169bad45d4dcd72e6c8a2cf69b19402a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016/3/21 23:42, David Miller 写道: > From: Yisen Zhuang > Date: Mon, 21 Mar 2016 19:06:37 +0800 > >> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c >> index 3c4a3bc..f3a5e05 100644 >> --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c >> +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c > ... >> @@ -1235,12 +1226,11 @@ hns_set_rss(struct net_device *netdev, const u32 *indir, const u8 *key, >> { >> struct hns_nic_priv *priv = netdev_priv(netdev); >> struct hnae_ae_ops *ops; >> - int ret; >> >> if (AE_IS_VER1(priv->enet_ver)) { >> netdev_err(netdev, >> "RSS feature is not supported on this hardware\n"); >> - return -EOPNOTSUPP; >> + return (u32)-EOPNOTSUPP; >> } >> > > This is incredibly broken, you cannot cast this negative error return value to > an unsigned integer. > Hi David, This is my misunderstanding of the return value. Will fix it in next version. Many thanks, Yisen > . >