Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp144415ybk; Fri, 8 May 2020 21:50:49 -0700 (PDT) X-Google-Smtp-Source: APiQypKrKsY7UaYIJxMPc86Vcw4B/NA7FATB1wfuQ6Vg/8+PQgyV5/ufRUqny6xGar11uJJkKahY X-Received: by 2002:a17:906:7f01:: with SMTP id d1mr4624568ejr.49.1588999849695; Fri, 08 May 2020 21:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588999849; cv=none; d=google.com; s=arc-20160816; b=LYLLvhmOTEJOIF+ax0rNajWbAKdByc7VYzeUhH4nagURon79my96grcIN7roQK8xej V+Q69G7VrblEj4LsYqFmCNhJ4MIOk3WfU1TUFca1ETiJENsGABze52XN4CNzRZ6jDMQK hnVm8fN2mY0RPfP6jijgx3DMAEN5uU/WPi+Aov5eLqmeqQuxntabUXP7DzXOYYyZVrfI 2i9QVJPcELEp/AzaRYMZycZPl3Jf8KLm9JgBCohwiSBb/0GZHbf6dn5m9qymyaegboC4 i6lFUM+EQjeAGFJvvGsSkEk/RVhpFthT3LJ1jhTdvaJMy7jZSS3bBHKIK90iMYI0hs5v 4yXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=t1LjLC1s4sCP//+D9ivHb061ksMa6R7nzDgbCchd/Aw=; b=I8Kh0mrToCIJHc+aMSgfHCfproxr0nmJe/LkvsBgvecjftDsKD13tGGxWKUnIVTx8V isiLXWowoyO2DFZoRcxiMpS+WDm6VDJgAhdSvP/pPv5qZuHdV6BQXyUj/jh3IeCevAQk 56Ivn1msABeRZ2+XhxAwwBrHmho6qJH7Y0WpgT4y/Aiimy6lcGpJVdVQ0z7UeqgoE1OW sdjmDm95vEZ0a9phTYiJJZDVCxTCZLiuoyPHcgToJhMAOEFr7mu7yOmOV2mb1+ICTo0k mgF+EmE8G/0bjpLYiSP4OO6zMgnEDZ1Bthp2Te4ZYBVnofDk+QlYErqOOAWIKBss+LVZ sx8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="hW0p/Hi5"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si2206604edx.314.2020.05.08.21.50.26; Fri, 08 May 2020 21:50:49 -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; dkim=pass header.i=@broadcom.com header.s=google header.b="hW0p/Hi5"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728719AbgEIEsn (ORCPT + 99 others); Sat, 9 May 2020 00:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgEIEsm (ORCPT ); Sat, 9 May 2020 00:48:42 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95140C05BD0A for ; Fri, 8 May 2020 21:48:42 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id k81so4136447qke.5 for ; Fri, 08 May 2020 21:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t1LjLC1s4sCP//+D9ivHb061ksMa6R7nzDgbCchd/Aw=; b=hW0p/Hi561SjkDi8KJwWBN/Sd1BQzn/AFk8N18aeXEHY1FmVbkQ74voXCXVYKv/Wnm z5oLDLRq1bPZigqeQHzi5ltNDWm0clHQTNNZTcR9z1lgLMHElWRVZWRgIyY9mHLa8tBl 1zBBhaXWMaDQyKsIs8rp3sXK/jiQEE9BexXMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t1LjLC1s4sCP//+D9ivHb061ksMa6R7nzDgbCchd/Aw=; b=afUcO6RnNwkRZnYmnVzE6wEyn4U35HIalnkNSTV9WhiHxpK6Z/XZM0PMx1+NtZIaJU 5A02KXKx66vViUCzn1cff1aF1IfPtxLVwiaO3iXMtcRawTy0dsz2//pte57n1H+fhjN4 IE7MLWmbEUCS1ntShrRGr2z6ZNiv8qFF0vJyJkibeRRyx2peXy7JT54kyjvfqs23GTqk +vZs3ZC/XZgHUwZDjR0+0iBWqgt9tXCQ82vkmhvrAcZ6hKO+7myJ+Kz7vDCAKUhD0Ji6 pFfElRrr/WcGHR9hqEEhTQfscjuIffu4LqEIpPXrx/OvZiAMn9gMBKMoNY/+GWqg7IQ5 ypAw== X-Gm-Message-State: AGi0PuaOd5e5hvuW5PAjYx3Bgso4VgaJmGfV2m+uIV6PWRN14/gMZsW4 yN9UVYPT2cx5DmEkIrD5IDIpX+nMXdN0vrpQNwx0Eg== X-Received: by 2002:a05:620a:688:: with SMTP id f8mr6019779qkh.431.1588999721764; Fri, 08 May 2020 21:48:41 -0700 (PDT) MIME-Version: 1.0 References: <20200508225301.484094-1-colin.king@canonical.com> <1890306fc8c9306abe11186d419d84f784ee6144.camel@perches.com> <160ce1ee-3bb5-3357-64f3-e5dea8c0538d@canonical.com> <20200508184814.45e10c12@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: From: Michael Chan Date: Fri, 8 May 2020 21:48:30 -0700 Message-ID: Subject: Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply To: Joe Perches Cc: Jakub Kicinski , Colin Ian King , Siva Reddy Kallam , Prashant Sreedharan , Michael Chan , "David S . Miller" , Netdev , kernel-janitors@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 8, 2020 at 7:31 PM Joe Perches wrote: > > On Fri, 2020-05-08 at 18:48 -0700, Jakub Kicinski wrote: > > On Sat, 9 May 2020 00:31:03 +0100 Colin Ian King wrote: > > > > My preference would be for > > > > > > > > { > > > > int i; > > > > u32 off = 0; > > > > > > > > for (i = 0; i < TG3_SD_NUM_RECS; i++) { > > > > tg3_ape_scratchpad_read(tp, (u32 *)ocir, off, TC3_OCIR_LEN); > > > > > > > > if (ocir->signature != TG3_OCIR_SIG_MAGIC || > > > > !(ocir->version_flags & TG3_OCIR_FLAG_ACTIVE)) > > > > memset(ocir, 0, TG3_OCIR_LEN); > > > > > > > > off += TG3_OCIR_LEN; > > > > ocir++; > > > > } > > > > > > > OK, I'll send a V3 tomorrow. > > > > I already reviewed and applied v2, just waiting for builds to finish, > > let's leave it. > > > I think clarity should be preferred. Either way is fine with me. I'm fine with v2 since it's already applied.