From patchwork Mon Jul 13 07:46:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235321 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2611199ilg; Mon, 13 Jul 2020 00:48:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb7I6GI36qiNtSpFkag2FMpw5Vo8Y86VgmC3jPXcV7nc8Zru3Uf2WnUCVT2oD9oQR3dQM2 X-Received: by 2002:a17:906:1688:: with SMTP id s8mr63209738ejd.164.1594626482352; Mon, 13 Jul 2020 00:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594626482; cv=none; d=google.com; s=arc-20160816; b=t3vxwpw87LIrHakuyz4FgrMhuDddV1Q9pwIyR2KdNXbhiwCdxf/DYCBGA3bGLlOT1P 6FKeON41zNJvtDi05YVPF4qvDCRXE21q0vIBl9377CvAWNDTazweVWMayOlmP3Cs6flr hMR1eBSKW//cLRLvmIa/20iAOR2uBMCvYM33WAfACWA+DvYPJ51XoouZLa1zsz++x9PN C8eWFPIzl/iGyDRHlO5pKroaC3ErK1VITzim20HGzm3VKdJIogtN7hrkIdCeXgBusXVW OHRK65RgBdJyx0v4i/ZdVCWII0qh8+q8h2KQqq7J+lKKv2LHLlNmKrMUpBXs0/fzal1G f1Rg== 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=FyBj62ckuErnieL47fWYby5Q+46yiqUV0ydBH5CkeAwgroTemzZf2wDPpuPpg2K0EU 8Yw/BTiShL+Qzwgdh7A9G4k++0KmXJ99Ksbk2Xh+j0Ba78QqF9G4b/B+zpn+ZbJvUyru EuiVzyqGu4q6fxctl3YKj3UV/RGB+AVRj8ayU8Efytad/BpbEKWn81Zcx/ZPNABihd/3 vEOHY93r/pwQt4up6vuksT8vu+noRnpTI5KpTqWxls6X1/1+f8TTiTM8WSGBC4ooTw6b QBw/rhLarjxNF0Qbf6SqFqOyp+iynb/g8LEOynjpWgheWP9aNWAzWWLhJOQ2xZFNO95h 16Xg== 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-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 e13si8452918ejx.153.2020.07.13.00.48.02 for ; Mon, 13 Jul 2020 00:48:02 -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=OY9mL1RC; 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 S1729360AbgGMHsB (ORCPT ); Mon, 13 Jul 2020 03:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgGMHrL (ORCPT ); Mon, 13 Jul 2020 03:47:11 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A0A8C061794 for ; Mon, 13 Jul 2020 00:47:11 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q15so12318464wmj.2 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=r7xP3XxAoT3vreeuakeOhuJpVzI9XtjML0HT4505MguZXnSOKDa9Rc1ja2MjxIRiuW voAVaSmdAJ6DuKaMtvbxZK+j3HnXV1kpukr2OcEJozmD88ep/G0IvQHrVXuaxFXz7mSt HXiYzHIGFigbkMO2AGe5QJkIus1Nz5/h2RLePSK1Z/DB/Sh5g93IzFiPhZ4zQE5fzgN5 7wpzowvMiSE5gaQE89Dkiwbn1r3Wcb8+HdIkZQgJDqrxReRbgwm9/q14mZRA1i7yRYP6 HOaYVQVjlyqr74+0gye1C9g9NY15Q6T6qzhsmEeXdbVqMrcCGHz8jWYXcxe9DCBivYds hwEQ== X-Gm-Message-State: AOAM533ylavyIvWeIqBenZlppNgDQ05r3hJCbOZL28VMgTAW8NSc9c2n B/iy3jY49mwZ0Y1aZHrT2x0BCw== 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 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 Reviewed-by: Hannes Reinecke 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) {