From patchwork Wed Apr 17 21:44:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10906231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A4B71390 for ; Wed, 17 Apr 2019 21:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45DB428A93 for ; Wed, 17 Apr 2019 21:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39F9D28BAB; Wed, 17 Apr 2019 21:45:19 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 6008D28BAC for ; Wed, 17 Apr 2019 21:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387667AbfDQVpQ (ORCPT ); Wed, 17 Apr 2019 17:45:16 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41267 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387635AbfDQVpP (ORCPT ); Wed, 17 Apr 2019 17:45:15 -0400 Received: by mail-pl1-f196.google.com with SMTP id d1so109641plj.8 for ; Wed, 17 Apr 2019 14:45:15 -0700 (PDT) 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=tbyMkZxJBbvz4bqMG98IB6XToDHzHvJi/lZkfpKAJaE=; b=A+pMEt6eyNY5k8xI+hRIjKa5FC81CZ1uHsB/yCIZx6a0Ch7ommUg4kRCKVCeJgQYaT SwfLzkRn+pLiXwldYS9N6k/h6ePCynkfbNICW3nWYo6GwQQkXPZ68dTrId7n7OW+niYi nfuFP91LUtq1hTt6Ac4mvNFjEVDnH7rlREiEaATvwU1WgIv1+Mih5PQS6gjLqSIZgj0Q R1TelTgpN4PXN1mdHw4Z/kcjBjqZE/1AYFFix7Jg5NfPlU2/DoLqQ5phrHHb7Xj78NRC iN1TLs6GTn0BMLSdipl3jKpq5wJHa2325m7SwuqUMF8FR4X9X5wywLrVHx0GHVoicqEE MC5g== X-Gm-Message-State: APjAAAX4BiqGiuCyCAATtmh6b9SAVepUn+W9IvpGZGr8X4rYpVV3Umk0 Ipz4azgSfyYhMQGMR2hNFOw= X-Google-Smtp-Source: APXvYqxcOte9HYJs+sbjDrZaxjlGAOsaEmLJ9E35Z2DZNZnr2gZFDprlpnRfJOLFlJKsOmFCwiS7GQ== X-Received: by 2002:a17:902:1621:: with SMTP id g30mr59040428plg.168.1555537515058; Wed, 17 Apr 2019 14:45:15 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id d68sm219314pfg.16.2019.04.17.14.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 14:45:14 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Himanshu Madhani , Giridhar Malavali Subject: [PATCH 17/34] qla2xxx: Simplify qlt_send_term_imm_notif() Date: Wed, 17 Apr 2019 14:44:26 -0700 Message-Id: <20190417214443.243152-18-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190417214443.243152-1-bvanassche@acm.org> References: <20190417214443.243152-1-bvanassche@acm.org> MIME-Version: 1.0 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 All qlt_send_term_imm_notif() callers pass '1' as second argument to this function. Hence remove the (broken) code that depends on that second argument having another value. Add a pr_debug() statement that prints rc to avoid that the compiler would complain that rc has been set but is not used. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index f25535fb30f5..69fc29d7e59d 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3651,33 +3651,11 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha, static void qlt_send_term_imm_notif(struct scsi_qla_host *vha, struct imm_ntfy_from_isp *imm, int ha_locked) { - unsigned long flags = 0; int rc; - if (ha_locked) { - rc = __qlt_send_term_imm_notif(vha, imm); - -#if 0 /* Todo */ - if (rc == -ENOMEM) - qlt_alloc_qfull_cmd(vha, imm, 0, 0); -#else - if (rc) { - } -#endif - goto done; - } - - spin_lock_irqsave(&vha->hw->hardware_lock, flags); + WARN_ON_ONCE(!ha_locked); rc = __qlt_send_term_imm_notif(vha, imm); - -#if 0 /* Todo */ - if (rc == -ENOMEM) - qlt_alloc_qfull_cmd(vha, imm, 0, 0); -#endif - -done: - if (!ha_locked) - spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); + pr_debug("rc = %d\n", rc); } /*