From patchwork Wed Mar 22 10:44:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 9638471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C90C7602CB for ; Wed, 22 Mar 2017 10:45:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD3E628452 for ; Wed, 22 Mar 2017 10:45:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FB4B2841F; Wed, 22 Mar 2017 10:45:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F2102841F for ; Wed, 22 Mar 2017 10:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933918AbdCVKou (ORCPT ); Wed, 22 Mar 2017 06:44:50 -0400 Received: from www.osadl.org ([62.245.132.105]:50209 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759175AbdCVKoW (ORCPT ); Wed, 22 Mar 2017 06:44:22 -0400 Received: from debian01.hofrr.at (92-243-34-74.adsl.nanet.at [92.243.34.74] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id v2MAi4Tb029142; Wed, 22 Mar 2017 11:44:04 +0100 From: Nicholas Mc Guire To: "James E.J. Bottomley" Cc: Vikas Chaudhary , QLogic-Storage-Upstream@qlogic.com, "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] qla4xxx: drop redundant init_completion Date: Wed, 22 Mar 2017 11:44:22 +0100 Message-Id: <1490179462-16559-1-git-send-email-der.herr@hofr.at> X-Mailer: git-send-email 2.1.4 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 The redundant init_completion() here seems to be a cut&past error as struct scsi_qla_host only has 4 completion elements to initialize, thus the duplicate init_completion(disable_acb_comp) is simply removed. Signed-off-by: Nicholas Mc Guire --- Found by experimental coccinelle script: ./drivers/scsi/qla4xxx/ql4_os.c:8667:1-16: WARNING: possible duplicate init_completion checking struct scsi_qla_host in drivers/scsi/qla4xxx/ql4_def.h:457 "Linux Host Adapter structure" it contain only the following 4 completion objects: struct completion disable_acb_comp; struct completion idc_comp; struct completion link_up_comp; struct completion mbx_intr_comp; so it seems the double initialization of disable_acb_comp was just a cut&past but and no omission of some other completion object - thus the second initialization is simply removed. Patch was only compile tested with: x86_64_defconfig + SCSI_LOWLEVEL=y, CONFIG_SCSI_QLA_ISCSI=m (...quite a few sparse and coccinelle errors/warnings during build-tests) Patch is against 4.11-rc3 (localversion-next is next-20170322) drivers/scsi/qla4xxx/ql4_os.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index ac52150..64c6fa5 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -8663,9 +8663,8 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, init_completion(&ha->mbx_intr_comp); init_completion(&ha->disable_acb_comp); init_completion(&ha->idc_comp); init_completion(&ha->link_up_comp); - init_completion(&ha->disable_acb_comp); spin_lock_init(&ha->hardware_lock); spin_lock_init(&ha->work_lock);