From patchwork Wed Jul 8 12:02:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235082 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp370719ilg; Wed, 8 Jul 2020 05:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx27qNhD7jvJ/gIYN4d1OkNsGzFeXuKgiTWAx5mtfPiMWyOn39tb7Sye2VYQIWQ4T3pTdkN X-Received: by 2002:a17:906:840a:: with SMTP id n10mr49489164ejx.453.1594209827999; Wed, 08 Jul 2020 05:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594209827; cv=none; d=google.com; s=arc-20160816; b=a5Xmqx+se5dtM32uD3Jt+4ekDY0OlbZZdTlRPygz8iZJhFhyftr+uPm6RrdHPXx9qz sGd1W+RuzXXUlehf4zR517WIAMAmop9jS179BwKFBlxbdn5L4sMeIYm+nZsXh688riHs NxsBK4UHnqhuYa9uidtp2pmYwCtT9AymVjRr+xQYHP6ZfaJPNpAfgWdaGGhnlRW4IB+j GZBX0FHBoUZPZkSjdZsq/N30NhukG0aS3ktsYxp5HIAq5U6zXZeHjR9DiApC58XTsfFd 6/il8dgbujZiN6bH5TPJSEK83Hj8FF4zbfR1NVdYMGop9MANIyIupv1tqMIYs/UEPR35 cpcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KFOnaZnxegDwLsJeWEMPqv4RGP3pzEUK9a4hgTT6mu8=; b=dWhWBHpm1DLlJN15PcK1FreoWqOuUXZKBtZTZc2NYGlvUXJwASd9Z/a/+lbhE7t4Pa +V6g3G1VfIW/+kr56tfxRDUDcjnbLN/MwyMRZgitZGGPO17D59AgMQDNepvw18tAghdn j/zGM6QSQVQVYSztY77bytNoIngBasOgbnCDwMQUWE7hWGtqBORQYXnGOcaQAOFKtWFP 5QV3E7e7sUQCTpKzwkfaEax2nLNaT0yb3XLOalnSYOixbiqFa62vdHnOa6uq9vo4AyLp RMMoUqrMWilTduEbWo+sOzZCkxfPPfh5hl/Ms1NV2oyOgfvvoVH9qJkOYbIqk+Mq3Hq3 S/+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6uRu82j; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk1si15529366ejb.497.2020.07.08.05.03.47 for ; Wed, 08 Jul 2020 05:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-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=@linaro.org header.s=google header.b=Q6uRu82j; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729234AbgGHMDr (ORCPT ); Wed, 8 Jul 2020 08:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729166AbgGHMC7 (ORCPT ); Wed, 8 Jul 2020 08:02:59 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 405CCC08C5DC for ; Wed, 8 Jul 2020 05:02:58 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id z15so37394720wrl.8 for ; Wed, 08 Jul 2020 05:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KFOnaZnxegDwLsJeWEMPqv4RGP3pzEUK9a4hgTT6mu8=; b=Q6uRu82jwSDeZ78JavUIgd2woRyBNcxJuhMq+FRLmC3XTYtoWv+51cU6IeO/mNUdBu oKgCZ+rrLCMxezQIxG4UkdQhPcRLfn549EONuRgoAqwxU2Lr2a3vvV3TwUJHWUimlYtQ Fo5TCNuXA+/fUYM1MYkQP7cbji9F6ZST/COLXUwJVI9oju8J31nfBlVBJVPFZlYaNSMw A0LRs9ID71Nuel55W0lc00rmDTKP7lQ7ohQVnrAOTlegM+uNCUKGrO+mWYXiSxuSWKCf 5WeM7YG4vhzx7sfpYTrjL9cO9SNUxp5e4Yxzm44x6dYu5+HdWRTL0NztnI9axDpXk4HM ibvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KFOnaZnxegDwLsJeWEMPqv4RGP3pzEUK9a4hgTT6mu8=; b=grDOxt5eLrx+dIfCMqNa/YmTPd5fX6bCUUN9Fv8ty5CPhD4aKlA0ogT4wax4vTTAwq 25YEvz/VhNkipDmJh9sWGhw55hA0U4ev41I5ONy2pFBBH0sws14iyeKkPz1ACUwDKxyw hLStt08Z1oEVyqUMhHm+KTIz7JB/UD9IdJ7xB4PcujI5KwHW9YKJpXB+Aj6bjjcpbESP P+aAz0gkecvRjgMS3i7LY0epq6jGFUWsAlg2JbARHs1a1+jxiOqJjZQ+BYPL9zHC2jjl dxyiOF6UfOyYXDOi+e+UErUqxlbA7oJYiX8iFPMMgPTjNxpeWXV9cIZ+owoSClLTUhss XtdA== X-Gm-Message-State: AOAM533g9H6ER1erKBRyBh3+vR20gnmO+DTzO2li8egwLWfs6mKPtVaW cLuPDw9ryrcxUkQ0T418c4lU1w== X-Received: by 2002:a05:6000:111:: with SMTP id o17mr61713548wrx.178.1594209776960; Wed, 08 Jul 2020 05:02:56 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.206]) by smtp.gmail.com with ESMTPSA id m62sm3964997wmm.42.2020.07.08.05.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 05:02:56 -0700 (PDT) From: Lee Jones To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Lee Jones , Hannes Reinecke , "Daniel M. Eischen" , Doug Ledford Subject: [PATCH 22/30] scsi: aic7xxx: aic7xxx_osm: Fix 'amount_xferred' set but not used issue Date: Wed, 8 Jul 2020 13:02:13 +0100 Message-Id: <20200708120221.3386672-23-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708120221.3386672-1-lee.jones@linaro.org> References: <20200708120221.3386672-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 'amount_xferred' is used, but only in certain circumstances. Place the same stipulations on the defining/allocating of 'amount_xferred' as is placed when using it. We've been careful not to change any of the ordering semantics here. Fixes the following W=1 kernel build warning(s): drivers/scsi/aic7xxx/aic7xxx_osm.c: In function ‘ahc_done’: drivers/scsi/aic7xxx/aic7xxx_osm.c:1725:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable] 1725 | uint32_t amount_xferred; | ^~~~~~~~~~~~~~ Cc: Hannes Reinecke Cc: "Daniel M. Eischen" Cc: Doug Ledford Signed-off-by: Lee Jones --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index ed437c16de881..e7ccb8b80fc19 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -1711,10 +1711,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) */ cmd->sense_buffer[0] = 0; if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { +#ifdef AHC_REPORT_UNDERFLOWS uint32_t amount_xferred; amount_xferred = ahc_get_transfer_length(scb) - ahc_get_residual(scb); +#endif if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { #ifdef AHC_DEBUG if ((ahc_debug & AHC_SHOW_MISC) != 0) {