From patchwork Thu Mar 30 23:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 77482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp226384vqo; Thu, 30 Mar 2023 17:27:26 -0700 (PDT) X-Google-Smtp-Source: AKy350YIAF22LJ1bWQJiHrlaSGa+eWDxnSCrwGtt/BqOpqtUsN8apQxAcx2zanMaX1KihPGvYbNd X-Received: by 2002:a05:6402:50a:b0:4ab:d1f4:4b88 with SMTP id m10-20020a056402050a00b004abd1f44b88mr25999596edv.41.1680222446633; Thu, 30 Mar 2023 17:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680222446; cv=none; d=google.com; s=arc-20160816; b=UjWQA8Yzc7HZLuBtolIe7zsQmSQsUugJ9gDfkVuh4pIF6S9vg/y8HeUeZW9u7ec5m3 dT5pbMLe/Fvr7fvlH0Ea6ShunVVduIa14Shk1wXkPLLzjCcmgJ/70/XJKYDDFsnJyBmd H57kwl7vrh14+/Pue+E3UbbwbhNbXHwQl1usV/V1Ffl74ZRfojdU17cjyYxPQpLiwFZk ig1DshkyoSnI0Bp69qilsyBVsTsKVKDLVfFaJp00p5xghdYXAfPewmhukGPSAzroC2Gr uKGLOuMriwKnbHOidoDdAIcVaw3R+FJT7hwYeeFLq/IiJIDQB2dic4Ywafh3mQLnU7P3 knxg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1xy3Si82hsoX5OufaGVk7KtbhEZkZn8SmKdNVmGxaE4=; b=e4dUp2ENS+vRhKk7uh5OOrCsuDZo97osAc3xNuMeLlZVwETvb3eSu02q/18emdSK/1 hrtaA71XhkHgZn2F5HxiFGramsbrFRHzsWtGCmQdAMbcZauYJug0kF568rLFlCyI0yDR Vzk9i9WbgUV1ZgYzmNhgtRofTC2dmwNqzyvnsWrnnosznbTUU/8gx31PCiaqkJiyWHcl VxNE7ApkQKEc6WcPfRioDnLfm1Fw4GZ0aLw95+8q/WJsUnWuRw/lz7wJnFgBd9rz4HuB S1cpip5swyMl2ckl1p8rgFmmXYSDfkmgMkLG/9i6wscuzLApf6nLrir/xt0pqhEZI8ds ZBtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PCYPeCgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020aa7c651000000b004acc613462fsi767546edr.525.2023.03.30.17.27.01; Thu, 30 Mar 2023 17:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PCYPeCgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231774AbjC3X6z (ORCPT + 99 others); Thu, 30 Mar 2023 19:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbjC3X6w (ORCPT ); Thu, 30 Mar 2023 19:58:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55863B771 for ; Thu, 30 Mar 2023 16:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680220685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1xy3Si82hsoX5OufaGVk7KtbhEZkZn8SmKdNVmGxaE4=; b=PCYPeCgf6EXy+Kv8I1OBLZ2NN+S4/n0RSH/kMsNbaiye3MpS1UZXBIvqz/Dmx0Fw+bLczB SSJLdoWUHnXXiNBUbdEVcJ1TKY5WfXkgRs9w7wFHk7YFeKS78avp7cZ0g3VveRfZ0/d6Hj x8lLW0xm47VwtdjEuxVdMlXO7HKFBDI= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-198-rGNzXE46NyWmkg1zfP6G3g-1; Thu, 30 Mar 2023 19:58:04 -0400 X-MC-Unique: rGNzXE46NyWmkg1zfP6G3g-1 Received: by mail-qk1-f199.google.com with SMTP id 195-20020a3705cc000000b00746a3ab9426so9661698qkf.20 for ; Thu, 30 Mar 2023 16:58:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680220683; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1xy3Si82hsoX5OufaGVk7KtbhEZkZn8SmKdNVmGxaE4=; b=Vs5tjTOFV6T8/EoL4YnJmY96xhD+bkOKnYNJ/HqPb1xsOBv3D08PIgYjQbd8wXShG9 lj3j+sGrUAiH2FXg0JTWd0EXKImHnqs82lpjk0mjwmhQ8EX6K0zQIxKrk2DlHwlZ0uBQ w9GsJoWgZFugDF4jcPz7yfXPGCPIToWqLRYHdKfjkPVVB//0U05O4mkJ8CQk2ZCCdvo4 r/P1oyXaPiqY+h3C//7LrWDYgbzIsT6qEaqGZsXYekZTINuHJ1vTGEItpJLni15CZAr6 nUacdY+RAYwiKnavkPZqo1ZkBWU7bzbuJyQVw5WH48YNGsNfYun8iFBtGlqXbGIClTfX T8iA== X-Gm-Message-State: AO0yUKUWd7xo0mSYL9TOaYPXESuZCOXmGVct9P/yErf6AHxhK5oDsmuW qmIqrlYsloOh7LOMCXl4Q3KXJvg4AMTXBzHaySstO0QdleJT2gHnz3mMpt0B4e5uLQNRNTXo/Rl xSsSfKXQzZIwqpAGjXxQE8HcT/168x0W8 X-Received: by 2002:ac8:5a81:0:b0:3e3:9532:fa06 with SMTP id c1-20020ac85a81000000b003e39532fa06mr41800166qtc.45.1680220683457; Thu, 30 Mar 2023 16:58:03 -0700 (PDT) X-Received: by 2002:ac8:5a81:0:b0:3e3:9532:fa06 with SMTP id c1-20020ac85a81000000b003e39532fa06mr41800149qtc.45.1680220683222; Thu, 30 Mar 2023 16:58:03 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i2-20020ac84882000000b003d5aae2182dsm229182qtq.29.2023.03.30.16.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 16:58:02 -0700 (PDT) From: Tom Rix To: dennis.dalessandro@cornelisnetworks.com, jgg@ziepe.ca, leon@kernel.org, nathan@kernel.org, ndesaulniers@google.com Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix Subject: [PATCH] IB/qib: remove unused cnt variable Date: Thu, 30 Mar 2023 19:58:00 -0400 Message-Id: <20230330235800.1845815-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761840932442528023?= X-GMAIL-MSGID: =?utf-8?q?1761840932442528023?= clang with W=1 reports drivers/infiniband/hw/qib/qib_file_ops.c:487:20: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable] u32 tid, ctxttid, cnt, limit, tidcnt; ^ drivers/infiniband/hw/qib/qib_file_ops.c:1771:9: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable] int i, cnt = 0, maxtid = ctxt_tidbase + dd->rcvtidcnt; ^ This variable is not used so remove it. Signed-off-by: Tom Rix --- drivers/infiniband/hw/qib/qib_file_ops.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c index 108520e53928..bf0c90eb3129 100644 --- a/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/drivers/infiniband/hw/qib/qib_file_ops.c @@ -484,7 +484,7 @@ static int qib_tid_free(struct qib_ctxtdata *rcd, unsigned subctxt, const struct qib_tid_info *ti) { int ret = 0; - u32 tid, ctxttid, cnt, limit, tidcnt; + u32 tid, ctxttid, limit, tidcnt; struct qib_devdata *dd = rcd->dd; u64 __iomem *tidbase; unsigned long tidmap[8]; @@ -520,7 +520,7 @@ static int qib_tid_free(struct qib_ctxtdata *rcd, unsigned subctxt, /* just in case size changes in future */ limit = tidcnt; tid = find_first_bit(tidmap, limit); - for (cnt = 0; tid < limit; tid++) { + for (; tid < limit; tid++) { /* * small optimization; if we detect a run of 3 or so without * any set, use find_first_bit again. That's mainly to @@ -530,7 +530,7 @@ static int qib_tid_free(struct qib_ctxtdata *rcd, unsigned subctxt, */ if (!test_bit(tid, tidmap)) continue; - cnt++; + if (dd->pageshadow[ctxttid + tid]) { struct page *p; dma_addr_t phys; @@ -1768,7 +1768,7 @@ static void unlock_expected_tids(struct qib_ctxtdata *rcd) { struct qib_devdata *dd = rcd->dd; int ctxt_tidbase = rcd->ctxt * dd->rcvtidcnt; - int i, cnt = 0, maxtid = ctxt_tidbase + dd->rcvtidcnt; + int i, maxtid = ctxt_tidbase + dd->rcvtidcnt; for (i = ctxt_tidbase; i < maxtid; i++) { struct page *p = dd->pageshadow[i]; @@ -1783,7 +1783,6 @@ static void unlock_expected_tids(struct qib_ctxtdata *rcd) dma_unmap_page(&dd->pcidev->dev, phys, PAGE_SIZE, DMA_FROM_DEVICE); qib_release_user_pages(&p, 1); - cnt++; } }