Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp788110ybh; Mon, 13 Jul 2020 00:49:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIanIzLLK9Ex+ikUusoVBEkSZ65xjbXnw+n2vP+so2oF4DTxmsFe3x6DVIeOzb913Y2fAN X-Received: by 2002:aa7:d8cf:: with SMTP id k15mr87221532eds.250.1594626557666; Mon, 13 Jul 2020 00:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594626557; cv=none; d=google.com; s=arc-20160816; b=UV1D10Ntwy/Xi7ue0IvnW6y/HFWiKkcprHZ3zWpuDIDwU6wOvl5i6r3lzQTf2vF1zr PsLkXlF+VtD1AmoYRJjiVCs5E0jklf07gwCf4UDVOVjZkEoUNHz1hktUHpzNCAkQgDPJ pQWfST2xMQHQXYB8NhDIKOlG9tHU/uPhmAm4CkW7cpgcU8Qe1KC5UESG/YoYQwbOpN54 H7TCg7QjIS3IlkAih7QZGErjVyZUXOUXmAmGx/tza9D0BBl+40nFgUXJ9m5L65EzsxlI So8IMUgjPtyUnP/Xd9N0x5gxvXx2YDznO2dN6966kd0Oy5rcQiVWQo6fB77+ifQEPBob 569w== 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=DAKlKRtaUUH4yDKwy+cIjd0J4XI7MDu8nR+scoxHvXczkHNqCXWYDTnHa8OJ18V7AK c+t8JxZZmY2MMQeW1X2wLasZxXb337e7bGFhoB9U0dbHaDJGBM2WaqvktSkq+AUK063p Sycjtr2lm41ZIEsbjWW4BTll0dPrMxqFNlRcUe0nGHoT84fp65YwxTPg+Gs2021FAfbM 5qwmouAx6uvzaRyhz5hY4OlWniwACWc+XMphoLIuHtqP94JhzEyGN3mVuGMVBrLbMYNH Ge7NAu9fV0Vzw6zHat3zfV7WTrqqAYU3tHR2Bhvp6sVmwXn/EWFIjd/+OxfqZsu434Ex 4ykA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OY9mL1RC; 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=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 g11si8119841ejx.307.2020.07.13.00.48.55; Mon, 13 Jul 2020 00:49:17 -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=@linaro.org header.s=google header.b=OY9mL1RC; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729334AbgGMHsB (ORCPT + 99 others); Mon, 13 Jul 2020 03:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729331AbgGMHrL (ORCPT ); Mon, 13 Jul 2020 03:47:11 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F2CC061755 for ; Mon, 13 Jul 2020 00:47:11 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f18so12172529wml.3 for ; Mon, 13 Jul 2020 00:47:11 -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=OY9mL1RCUfiNwlK7Y8LLoK+AzG927nw81f3Z4PqcWbGl3vSJOucO49vTdu8eGhYXAl w11NKIhj/+05DjP3pU/AWZq9hcBlj2iLJ0iSTbqGhdUktM+Vj1xLk5a3PvFeb1nwhDCl fsrQXk2S0T4I5s9VtOZsPAP926q3LKfnEbI1jnv3qx8AVtlmWgClMnsXa+/JfBUrMgco pkjIqv4DSe/jwVUWdO/svjzb7A4Np+nDuFcikxV3+5oFt+aQ7YIuPvKX6L9WBu3aSwhD uYjuLCzI6U3kEKHCIkcMiSYiCw9rJ/c7tswAPwBOLDa7XRCAjFF3qbOzeTZtoENoe30S g+MA== 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=Wtnc9a8RNTd4D9FNJ9dBFzxnI54nF9nTk/Xv2lsKD2NaFDe4RiIPzZNxUd2AtT/Jn2 o9MGEM7wVhLdpv+9HOPijZOJDwj2JAI9lst9UKqyQwR2R68eXDf2/cE7g52ljogborhu MJaZirlyIupfkuYHLb/BfW+dqizn4owm5VWhgMTrNgWX3YiA4TiGqaoYf+QsQZuxBUep wFmfVZHzn6SkiEIZo6BwKNYj0cebpZZxOeVWy/XWfblKqUedAPNAvflMHyoDA97eNEoP k/VMde5ohcH5FCNi9u4GlneQje3nZSjGTLWxCFqdvh17xFEV92x88SGUD4++hEn2e+0s Y4BQ== X-Gm-Message-State: AOAM530d0Jd1QmljB2OwTW/+vyOQgHKkJfrJs67IShxgT20IZWISYv1T GPW2YBRYshpxEekgNKlNcOYyWg== X-Received: by 2002:a7b:c013:: with SMTP id c19mr17249605wmb.158.1594626430342; Mon, 13 Jul 2020 00:47:10 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.6]) by smtp.gmail.com with ESMTPSA id k11sm25142488wrd.23.2020.07.13.00.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 00:47:09 -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 v2 21/29] scsi: aic7xxx: aic7xxx_osm: Fix 'amount_xferred' set but not used issue Date: Mon, 13 Jul 2020 08:46:37 +0100 Message-Id: <20200713074645.126138-22-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713074645.126138-1-lee.jones@linaro.org> References: <20200713074645.126138-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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) { -- 2.25.1