Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2665334ybl; Thu, 19 Dec 2019 18:20:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyBou3C5RSILrk5YvTnIuNEV8Mdt/64/uLfv3kijCvNt71VIoDgL1Kf1t2rnEpRK/fhHpJ2 X-Received: by 2002:a9d:6d81:: with SMTP id x1mr12832240otp.9.1576808447985; Thu, 19 Dec 2019 18:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576808447; cv=none; d=google.com; s=arc-20160816; b=vgWV9lLxWoFw7BXqJePjBdV5rJ0BjmJccTSq4ermHcLNUIquZOEbqrjp8gr5ZCMhOo sjiPPJySrvkVb0HQLX+nEPd1Ttj2CHIm5koa0VgL7gQ4PpajQ5WddxFC9wWLJN1KuoYs tkCQGIOS7GMES1kK1aZlNy+DfFMgEqNfB7bKGwSOg+pVV2GgL4T6x8zepHDrzPHLH2iC KrivdwewCkpjpaiI13U/pEw9g6O89fslu3E2eSXJxZnKxkW113vzXyJWBbt0W+iecxmS M/OLFKHPYShgJUYvMDwXnptQP8UbpRBPzPr41F5z/W0vUnt8QYGSf746JjxlBilnAp0K H+Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Siy9qFZHihAPBOSs8zgxiiIaO8t9ZUkZPWXjf/l/83w=; b=iYsgs4tgJbC+V93aEe+6d0UcBe0fecAimcVjvJHp6LuEGQFik8zkOh674F6I7O7DO/ pCzSsMadNMM6YzhKagLcrH+dnKq70OIYqB9mTHY+C0lH2SGE0zv93kWI7CA8X1LklYrY fq6mn1dCh+vsjWVxtShP0za8q3uIycXoomd2rdIEtoTKhZRZ275JEbE5tROTTUqqT5z9 njRpLG/PHdmQZFYsFMKJnxcG6EgIuQxG4MvoGV/avv7qeX5IOzxP/yDMm5q6pzhrlgcS 4XzUiMmw9MHyTzbz3K7YWFTzbTiDgChVNABoCm1RjXS4S4BJnlzKZk3J8K5gc75fYKth sHCA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si4315390oth.3.2019.12.19.18.20.32; Thu, 19 Dec 2019 18:20:47 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfLTCTl (ORCPT + 99 others); Thu, 19 Dec 2019 21:19:41 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8156 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726963AbfLTCTl (ORCPT ); Thu, 19 Dec 2019 21:19:41 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 658332DE0C0B8ACCE7E0; Fri, 20 Dec 2019 10:19:39 +0800 (CST) Received: from [127.0.0.1] (10.177.96.96) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Fri, 20 Dec 2019 10:19:33 +0800 Subject: Re: [PATCH net] af_packet: refactoring code for prb_calc_retire_blk_tmo To: Willem de Bruijn CC: David Miller , Eric Dumazet , , Paolo Abeni , , Neil Horman , "Network Development" , linux-kernel , References: <20191219013344.34603-1-maowenan@huawei.com> From: maowenan Message-ID: Date: Fri, 20 Dec 2019 10:19:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/19 21:56, Willem de Bruijn wrote: > On Wed, Dec 18, 2019 at 8:37 PM Mao Wenan wrote: >> >> If __ethtool_get_link_ksettings() is failed and with >> non-zero value, prb_calc_retire_blk_tmo() should return >> DEFAULT_PRB_RETIRE_TOV firstly. Refactoring code and make >> it more readable. >> >> Fixes: b43d1f9f7067 ("af_packet: set defaule value for tmo") > > This is a pure refactor, not a fix. yes , it is not a fix. > > Code refactors make backporting fixes across releases harder, among > other things. I think this code is better left as is. Either way, it > would be a candidate for net-next, not net. sorry, it would be net-next. > >> - unsigned int mbits = 0, msec = 0, div = 0, tmo = 0; >> + unsigned int mbits = 0, msec = 1, div = 0, tmo = 0; > > Most of these do not need to be initialized here at all, really. > some of them do not need to be initialized, msec=1 can be reserved because it can indicate tmo is for millisecond and msec initialized value is 1ms.