Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5467139pxb; Mon, 15 Feb 2021 22:06:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjykrHm29zdRNGNHGs6vLZqKLjMIh1Mm15WxmY+AI3Go6cCGrF/vNS/4BAELZSxQkd+9XH X-Received: by 2002:a17:907:9626:: with SMTP id gb38mr18670783ejc.301.1613455566594; Mon, 15 Feb 2021 22:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613455566; cv=none; d=google.com; s=arc-20160816; b=S1u0I0bsW1rYGkrKtWocSt57CO+LI6NzyU6Ce+ssVCDNy0oEOXI563xS1wcYeriFuS Zp8FxGMl52N3V5AQr2zxdFkIdDXev3EKwTg8rUT4pOQZ5JAhaqC6MepcklFpOaaE6qTD Zy/Fsp5nrsz0d9XHxB2IXA53aleCYWVIIk9QKi5ieuPO1huScef6UQxGa6IntqcfrjRX wjfH8hoaDLoIZK9qye/oUOem01CXifbEabqUuShj7+iGvE36cYMUVutkUsKG5PRUuvHI 4+HdoHZC6heUhbS4cftadGHuDRlXhmh/5sOqar5tjns/NUFt64bBY5GE2tao5IWd+YOD JPOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PwLbeX6N/L8jfjIGf4QmvnvfU2rzakh/uc9dFUjJofA=; b=PadGJiZcS0AV7ksGMyOBYXFqExtIBjlmpjErh1D0g9rXzWqIW9lkiamlsJ22OXW27g B8oSqAYxSKPz3x9wwKr/uHGmOPy1u2xjoqbgT8VwRZzCHVQMiboBFj6cl7lmBsfGrEUe ziimdaAPCbcyIqqKoCN03adQClpWllgJeUzx8BDPWdRE2/ak+uBICl05k/MtkbO3qeHb IDtpXBp1a9CIAqK1ucFvbGknDPjitMl2Ta0d28prvcMuziNJwkhiBDbEIbBudDv90Tin ckMwpz5H7wtEMSZlYkku20fD4mgurgCsVvuPXDaiCAHULu/4iIe+76jfXdsVahmSzPmd lnYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AsklDOfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si5684505edd.533.2021.02.15.22.05.43; Mon, 15 Feb 2021 22:06:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AsklDOfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbhBPGEt (ORCPT + 99 others); Tue, 16 Feb 2021 01:04:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:50708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbhBPGEl (ORCPT ); Tue, 16 Feb 2021 01:04:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F80764DDA; Tue, 16 Feb 2021 06:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613455440; bh=r+OZB827JaqOfN2ks887+1Upc8nphXhkC94g+YGIn8M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AsklDOfrNTLRJuOs3a9ZsgoPK35EJNkFEC4dBkKun7xSuklBW1Z4qnO5wWd4F/Q3Z WUlFY1EUXs2pQ/vDl6Y0eY/lQ5tJRWZehE+lyAXEbJhQqzsqUe0kDnlmBfrKvWQce9 2wqYom6NxA9Hmtqfb2Wd0xxUL4dZLY5iah2NjES+mCY2fX6SJ7X7vb2ZlH6iSjgZsr 245oU9pKE9i1Kh794k7i5GLtmJNdlnPOQzQH9VP86R4dXS6PU7/CvKgMo4PtD0aVHX ZikNO7d5DJ032Fma4jMNGJwpld1pJCgXE3TmdRLzzejQzkDwp8+JcoQAOETq+rlIHs bQFKv0B75OBKw== Date: Tue, 16 Feb 2021 08:03:56 +0200 From: Leon Romanovsky To: Xie He Cc: "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML , Martin Schiller , Krzysztof Halasa Subject: Re: [PATCH net-next RFC v3] net: hdlc_x25: Queue outgoing LAPB frames Message-ID: References: <20210215072703.43952-1-xie.he.0141@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 15, 2021 at 11:08:02AM -0800, Xie He wrote: > On Mon, Feb 15, 2021 at 10:54 AM Leon Romanovsky wrote: > > > > On Mon, Feb 15, 2021 at 09:23:32AM -0800, Xie He wrote: > > > On Mon, Feb 15, 2021 at 1:25 AM Leon Romanovsky wrote: > > > > > > > > > + /* When transmitting data: > > > > > + * first we'll remove a pseudo header of 1 byte, > > > > > + * then the LAPB module will prepend an LAPB header of at most 3 bytes. > > > > > + */ > > > > > + dev->needed_headroom = 3 - 1; > > > > > > > > 3 - 1 = 2 > > > > > > > > Thanks > > > > > > Actually this is intentional. It makes the numbers more meaningful. > > > > > > The compiler should automatically generate the "2" so there would be > > > no runtime penalty. > > > > If you want it intentional, write it in the comment. > > > > /* When transmitting data, we will need extra 2 bytes headroom, > > * which are 3 bytes of LAPB header minus one byte of pseudo header. > > */ > > dev->needed_headroom = 2; > > I think this is unnecessary. The current comment already explains the > meaning of the "1" and the "3". There's no need for a reader of this > code to understand what a "2" is. That is the job of the compiler, not > the human reader. It is not related to compiler/human format. If you need to write "3 - 1" to make it easy for users, it means that your comment above is not full/correct/e.t.c. Thanks