Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp793522ybh; Mon, 13 Jul 2020 01:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg1qCwhSMlqFudUx07LAV1tTNmGvGN7QCHKv8pEwhN0WWmv9g5KA7/SnqximSDehmUOlas X-Received: by 2002:a17:907:94c4:: with SMTP id dn4mr70239294ejc.150.1594627302388; Mon, 13 Jul 2020 01:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594627302; cv=none; d=google.com; s=arc-20160816; b=wCumf9aSCq/fJ2H/eLI83+Dm3hl8BnDVce/yGFzIkiyEuguuAMYvPpUeScaxplBpm8 OoEdUHkbMseZ5qx5EE4YVciBxdNqKMQPVAq/AImKH5DomPWMaksdI0XJArA6emZOCVWO teoSCzxe/68AogFxqj569/MdqQ82Ytba5U+56dhAoJlk+APkAqE9ugMrCUhq/NmUGx6O j0VUPJlpsawRBZIdwX+bXWqnO79WSjQX2aGIPmPEWxOMVUISfGcm/Ht/2YdpADlNbEjq rdkoS1Wtii0RWoWwwF1iR8QT6FiqhZN4PhQ0q4LxZ/pyglE2+zcjBonvUzPbP2/DmRab HM3w== 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=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=lPa3LZkfinAiolUBx+fybdCI+27/7r+p9PC5A65QXc7U4ywJtVPNO3Fszz0foZNFN1 z8rBk5ehP9VdAyPPssjha6i58aWInuuK7HqCDsmTU46FS0VsatjVxLRiF6bryxNfOYFw JingmRfY0nlyucF8GPY4tN2AWA6PPHUgV/SeNF/YcxSpR5GqcwCgBHzeeHiH6TLrCgg+ 7IS6bytv1rjGCMeAICgfjbOvSt/OHZ1wIOBK+b6Z1dlz0qb7ojNbHy9mjlbDvk2Dv5qG kVpyIlFWjaiqjjc7bYTI+itEGLtqHbLz8MkJ9pO/zdlyyuiDmCA71PgZQYkz7wahNDGH +dpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g5RssAEy; 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 z19si8576445edx.83.2020.07.13.01.01.19; Mon, 13 Jul 2020 01:01:42 -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=g5RssAEy; 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 S1729434AbgGMIAg (ORCPT + 99 others); Mon, 13 Jul 2020 04:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729411AbgGMIAf (ORCPT ); Mon, 13 Jul 2020 04:00:35 -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 B5081C061794 for ; Mon, 13 Jul 2020 01:00:34 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id f2so14702758wrp.7 for ; Mon, 13 Jul 2020 01:00:34 -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=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=g5RssAEyVWSu9L06I2k7D7WofbgEQJ8+Fjgyt22YJ6NMm0i+3Pac++WSxZ543qhSQJ f1b4YPSM40MFF6z2/hcBwuZ2YZ5SkVFzJZzXrAMYkxdzxogel0GfMUq7rx9Jvn7o1ZJp NtDW9QxqFGW7sAmX8FZx6NfNtvJJkuGQbZpFxupI9x/VqMQaBFlmnrnDs4CEIzaBE5eM e0J5uMapfLs1KlPpwS6JA123vI6gkoqlYP76ByAefa/FOJkUtevNR6buaCTVZGfKufZL xfz6sTNyu2HZjmKnrhKM3cjc1Tf5hFB+SYpG7KhwpYOTz3bvOCSYBpVcDH69EsdNtaHj NjTw== 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=XXWcsoi+xGgOcFmbeWP75diSxyhw0hWfzUHSepxSy6k=; b=jmD5MHye2KZtRHxeY1YQ4cDtoheXGwLWbnMZ22OuNLdOfDKJLgPxOM6hIlRGrniGqL HXFmZnCZoBbcQur8DRXBKoQD5fBdaS3MxCXursrJaE6EdHiifuPXD6ootiWAD0jaPnts 3eRhuIqUvg8pbFXQIcOvK3eQViTaW782q8MvjDwue1l6xY6by4ssTWrzagg26qBWbtoz Ye5Qzx4JvfFRw3ZNQUjfpPQVHOCR+3qx/RwuS7wDNBzE+KEvx9RL8nb53e/qW+hS//Rd K/ptAU89mp7Z8uD1+rS4OJCh9yf6siiwa1LsHb2zNvHaOrV0q0NWDpzEkaUNE4tzSUIt /Jag== X-Gm-Message-State: AOAM532C7lC9PJXGgUH6B9lJIShqpvCA+Nzs8WUKdmQ585XgD18sCKYg Za6r3yMcHSnucF/Dxy5k1WCUug== X-Received: by 2002:adf:f14e:: with SMTP id y14mr78388722wro.151.1594627233468; Mon, 13 Jul 2020 01:00:33 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.6]) by smtp.gmail.com with ESMTPSA id 33sm24383549wri.16.2020.07.13.01.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 01:00:32 -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 Subject: [PATCH v2 23/24] scsi: aic7xxx: aic79xx_osm: Fix 'amount_xferred' set but not used issue Date: Mon, 13 Jul 2020 09:00:00 +0100 Message-Id: <20200713080001.128044-24-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713080001.128044-1-lee.jones@linaro.org> References: <20200713080001.128044-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/aic79xx_osm.c: In function ‘ahd_done’: drivers/scsi/aic7xxx/aic79xx_osm.c:1796:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable] Cc: Hannes Reinecke Signed-off-by: Lee Jones --- drivers/scsi/aic7xxx/aic79xx_osm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 8e43ff86e0a60..3782a20d58885 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1787,10 +1787,12 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) */ cmd->sense_buffer[0] = 0; if (ahd_get_transaction_status(scb) == CAM_REQ_INPROG) { +#ifdef AHD_REPORT_UNDERFLOWS uint32_t amount_xferred; amount_xferred = ahd_get_transfer_length(scb) - ahd_get_residual(scb); +#endif if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_MISC) != 0) { -- 2.25.1