From patchwork Thu May 14 18:12:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 6409201 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E79E5C0433 for ; Thu, 14 May 2015 18:21:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1600A203F7 for ; Thu, 14 May 2015 18:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2494420465 for ; Thu, 14 May 2015 18:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbbENSVJ (ORCPT ); Thu, 14 May 2015 14:21:09 -0400 Received: from www.osadl.org ([62.245.132.105]:37259 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753058AbbENSVG (ORCPT ); Thu, 14 May 2015 14:21:06 -0400 Received: from debian.hofr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t4EIKTWm013966; Thu, 14 May 2015 20:20:29 +0200 From: Nicholas Mc Guire To: Vasu Dev Cc: "James E.J. Bottomley" , fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] scsi: match wait_for_completion_timeout return type Date: Thu, 14 May 2015 20:12:34 +0200 Message-Id: <1431627154-12695-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return type of wait_for_completion_timeout is unsigned long not int. An appropriately named unsigned long is added, and the assignments as well as error checking fixed up. API conformance testing for completions with coccinelle spatches are being used to locate API usage inconsistencies: ./drivers/scsi/libfc/fc_fcp.c:1279 int return assigned to unsigned long Patch was compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y, CONFIG_SCSI_FC_ATTRS=m, CONFIG_LIBFC=m Patch is against 4.1-rc3 (localversion-next is -next-20150514) Signed-off-by: Nicholas Mc Guire Acked-by: Vasu Dev --- drivers/scsi/libfc/fc_fcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index c679594..c438b81 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -1261,7 +1261,7 @@ static void fc_lun_reset_send(unsigned long data) static int fc_lun_reset(struct fc_lport *lport, struct fc_fcp_pkt *fsp, unsigned int id, unsigned int lun) { - int rc; + unsigned long time_left; fsp->cdb_cmd.fc_dl = htonl(fsp->data_len); fsp->cdb_cmd.fc_tm_flags = FCP_TMF_LUN_RESET; @@ -1276,7 +1276,7 @@ static int fc_lun_reset(struct fc_lport *lport, struct fc_fcp_pkt *fsp, * wait for completion of reset * after that make sure all commands are terminated */ - rc = wait_for_completion_timeout(&fsp->tm_done, FC_SCSI_TM_TOV); + time_left = wait_for_completion_timeout(&fsp->tm_done, FC_SCSI_TM_TOV); spin_lock_bh(&fsp->scsi_pkt_lock); fsp->state |= FC_SRB_COMPL; @@ -1292,7 +1292,7 @@ static int fc_lun_reset(struct fc_lport *lport, struct fc_fcp_pkt *fsp, fsp->wait_for_comp = 0; spin_unlock_bh(&fsp->scsi_pkt_lock); - if (!rc) { + if (!time_left) { FC_SCSI_DBG(lport, "lun reset failed\n"); return FAILED; }