Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp920079pxy; Sun, 1 Aug 2021 06:32:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMfvCt1N7sYbEk3oZSYHe8opaq2/farGmQSG4XIaivIT2hGdQ7Cc8eTUpPFmkuBIs4k7XK X-Received: by 2002:a05:6602:2e11:: with SMTP id o17mr6060460iow.55.1627824747824; Sun, 01 Aug 2021 06:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627824747; cv=none; d=google.com; s=arc-20160816; b=k9SSouBI730HLpGi4yzHeQStE5DmDB5bdw9zXTeC8AhjhCXJAo1fFu9llMUMPdZlkS +MVFko9FIllZHqld/DRmOXXDdB2Sk7LiSfLQZxR9l6dthELfo7+ax0+WPkH2hwBA8VNT gPHJhZlva5LPkewU4KHYYiNK/usIWTq4eqZTkriYuncUk5nCyw0guzSP4+mdzsMlsUqn cXXD2hitu7C6qA7E7uIGuQrKfu8KqEqvDUq8fZDr7FWQuZU9TsFZ4+YhvrBDahnEx/ZC i/U8uK/5ENWrJHiQ/yc/IcjVAUzMjsKN+w2UG8RMsi1wvcVxfa2UslcrX0f31nIl5UDs 9clA== 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:message-id:subject:cc:to:from:date; bh=mgJsGWCAotORFPbxOqzuUR7a5Mau6aYT+9X7MwNILnc=; b=belIiVEukTYD1qvBs/AOYzEnf2CHPoe+upUcUVdVXBotA5XBlb+gzfJB67L3u3J4tn 9CHLfh0+yHhv6GrFxo2uIVu2C6llVCyVidIAoG7ENYoDapO8bOp9Q1u/TyvEcAB4Pq3T Rd99UQNHd5C5gnCH6C+tFWhbOe1zyUyL16zfn+1jpy2KiMaBei4kvORMqHzbvMM9GPbu 6FPDoOD3rlpcdb04uWMykhiBfBtWK39XxR6qUEpn9TJhNE1fOaFBRce7PznwDWvXust7 hZB/3ADC2qLKX5GuVqRQ/D23Xh8thJAHqb0rJ3jkvMDgxKVhYrVNyd8CMhZ0cA2GgCA7 gVQg== 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 b15si9310920ilv.151.2021.08.01.06.32.14; Sun, 01 Aug 2021 06:32:27 -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 S231786AbhHANbN (ORCPT + 99 others); Sun, 1 Aug 2021 09:31:13 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:50835 "EHLO einhorn-mail-out.in-berlin.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231546AbhHANbL (ORCPT ); Sun, 1 Aug 2021 09:31:11 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id 171DUQ6w005133 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 1 Aug 2021 15:30:28 +0200 Date: Sun, 1 Aug 2021 15:30:24 +0200 From: Stefan Richter To: Greg Kroah-Hartman Cc: Jordy Zomer , linux-kernel@vger.kernel.org, linux1394-devel@lists.sourceforge.net Subject: Re: [PATCH] firewire: ohci: make reg_(read|write) unsigned Message-ID: <20210801153024.21941652@kant> In-Reply-To: References: <20210731104112.512449-1-jordy@pwning.systems> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Aug 01 Greg Kroah-Hartman wrote: > On Sun, Aug 01, 2021 at 08:24:04AM +0200, Greg Kroah-Hartman wrote: > > On Sat, Jul 31, 2021 at 12:41:12PM +0200, Jordy Zomer wrote: > > > The reg_(read|write) functions used to > > > take a signed integer as an offset parameter. > > > The callers of this function only pass an unsigned integer to it. > > > Therefore to make it obviously safe, let's just make this an unsgined > > > integer as this is used in pointer arithmetics. > > > > > > Signed-off-by: Jordy Zomer > > > --- > > > drivers/firewire/ohci.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > Same thing should probably also be done in > > drivers/firewire/init_ohci1394_dma.c for the same inline functions, > > right? Yes, register offsets are always non-negative; the lowest register address is used as the base address. All of the offset values are taken from macros which are define in ohci.h. > And sound/firewire/isight.c also could use this. Seems like there was > some copy/paste in firewire drivers :) These offsets are non-negative too; they defined as macros at the top of isight.c. However, here we aren't in the 32 bit (?) PCI register space but in the 48 bit FireWire node address space, which is why the functions which are wrapped up by reg_read/write() --- snd_fw_transaction() and fw_run_transaction() --- use u64 or unsigned long long for @offset. Long story short, isight.c::reg_read/write() could use u32 or unsigned int or u64 or unsigned long long for @offset; it's going to be added to an u64 so maybe that's what we should use right away? -- Stefan Richter -======--=-= =--- ----= http://arcgraph.de/sr/