Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp626781pxb; Thu, 9 Sep 2021 08:29:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhiq2mUxmIaQaknvBnhkFGNu818VmizVFZVbz9ogJhN4/VbeV7mSx74c8g9zGhbfVGglz+ X-Received: by 2002:a17:906:4acd:: with SMTP id u13mr4076867ejt.255.1631201373507; Thu, 09 Sep 2021 08:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631201373; cv=none; d=google.com; s=arc-20160816; b=bH7AxvyTxOoV9cq/Qnzn/9mnzS7ZedZzV3ImdVuLk9QkkvxFBMPf8CioCqBRykbBcr UCE8O3aRFubQenFAImGeIynw2UhJZwNI1p+dtAjqO0bT4OZPZ/psQeWwL48tGITtn5+A NtNDS2DbDvof8j5QRtHS/BgWRt7zbo/xy03oGePfG8H9rMkhW7LcVxH2gh9Ma+ZzlV1V EaEIm16lVxpGVaA2JZI7oZLKQ4TEdIrSpwOQ0sueuRFpNJHCtZJELfipt/iT133GQqsw qDhCZim9dLRpTmw3kpUu4VUFbIWOjNT6JhEkV22KfnbdrMhwbEdLIYqkzLD+7HnZLEn0 5Nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=6tHmmr6EYX54LscJkfglvsnjWn5NIbSldSbRP9IVhJE=; b=s1f0jT1LCeKRSqDLTY3i3jqyrAlplw9neEvecTTek5NwCX8qzOGWLffBR7C/CGJbqI i64tlaZFEFYx55Q4Xfytbymisf8Xx1VXkYG+6pFxOTcdXjPWQfkFLtcv8FFBMgdloIaa wDM93u+fSVnOkh+pKcweKFcCUA+ITSRcKzng+0s4+UbRLlaZstbsQxjlFm0BB4o7K7yQ 8qE/xcYqmUat19lufuhLTseujb7gm5rcyPnKIGwcaVejwILwV6OXJ6w1MYV4dRdgeVSk Uzlyc9Bjywilh2nv104vQjdpR1Vk5lW0LOP2RRuneU5XVmxfsUiYDit40sfuDDoqPrfL NSZA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gc38si1999372ejc.395.2021.09.09.08.29.06; Thu, 09 Sep 2021 08:29:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236542AbhIIP2j (ORCPT + 99 others); Thu, 9 Sep 2021 11:28:39 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:52012 "EHLO mail.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbhIIP2i (ORCPT ); Thu, 9 Sep 2021 11:28:38 -0400 Received: from localhost (cpc147930-brnt3-2-0-cust60.4-2.cable.virginm.net [86.15.196.61]) by mail.monkeyblade.net (Postfix) with ESMTPSA id 877AC4F670CF6; Thu, 9 Sep 2021 08:27:27 -0700 (PDT) Date: Thu, 09 Sep 2021 16:27:21 +0100 (BST) Message-Id: <20210909.162721.1267526781289116670.davem@davemloft.net> To: linux@roeck-us.net Cc: ajk@comnets.uni-bremen.de, kuba@kernel.org, linux-hams@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: 6pack: Fix tx timeout and slot time From: David Miller In-Reply-To: <751f5079-2da1-187e-573c-d7d2d6743bbf@roeck-us.net> References: <20210909035743.1247042-1-linux@roeck-us.net> <20210909.123442.1648633411296774237.davem@davemloft.net> <751f5079-2da1-187e-573c-d7d2d6743bbf@roeck-us.net> X-Mailer: Mew version 6.8 on Emacs 27.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.monkeyblade.net [0.0.0.0]); Thu, 09 Sep 2021 08:27:28 -0700 (PDT) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck Date: Thu, 9 Sep 2021 07:53:29 -0700 > On 9/9/21 4:34 AM, David Miller wrote: >> From: Guenter Roeck >> Date: Wed, 8 Sep 2021 20:57:43 -0700 >> >>> tx timeout and slot time are currently specified in units of HZ. >>> On Alpha, HZ is defined as 1024. When building alpha:allmodconfig, >>> this results in the following error message. >>> >>> drivers/net/hamradio/6pack.c: In function 'sixpack_open': >>> drivers/net/hamradio/6pack.c:71:41: error: >>> unsigned conversion from 'int' to 'unsigned char' >>> changes value from '256' to '0' >>> >>> In the 6PACK protocol, tx timeout is specified in units of 10 ms >>> and transmitted over the wire. Defining a value dependent on HZ >>> doesn't really make sense. Assume that the intent was to set tx >>> timeout and slot time based on a HZ value of 100 and use constants >>> instead of values depending on HZ for SIXP_TXDELAY and SIXP_SLOTTIME. >>> >>> Signed-off-by: Guenter Roeck >>> --- >>> No idea if this is correct or even makes sense. Compile tested only. >> These are timer offsets so they have to me HZ based. Better to make >> the >> structure members unsigned long, I think. >> > > Hmm, ok. Both tx_delay and slottime are updated in sp_encaps(), > though, > from data in the transmit buffer. The KISS protocol description states > that the values are in units of 10ms; that is where my assumption > came from. They are ms and must be converted using to HZ in order to use the values as timer offsets. The values are perfectly fine, the types used to store them need to be fixed. > Anyway, I am inclined to just mark the protocol as dependent on > !ALPHA. Would you accept that ? No, fix this properly. Make the unsigfned char members be unsigned long. Why do you not want to fix it this way? Thank you.