From patchwork Tue Feb 26 14:30:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10830389 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 0C6131399 for ; Tue, 26 Feb 2019 14:30:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEA3D2C5E4 for ; Tue, 26 Feb 2019 14:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2B0A2C65D; Tue, 26 Feb 2019 14:30:55 +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 7F7A92C601 for ; Tue, 26 Feb 2019 14:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbfBZOaz (ORCPT ); Tue, 26 Feb 2019 09:30:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:36572 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbfBZOay (ORCPT ); Tue, 26 Feb 2019 09:30:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 98A47B628; Tue, 26 Feb 2019 14:30:52 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCH 4/4] scsi: kill command serial number Date: Tue, 26 Feb 2019 15:30:48 +0100 Message-Id: <20190226143048.68814-5-hare@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190226143048.68814-1-hare@suse.de> References: <20190226143048.68814-1-hare@suse.de> 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 From: Hannes Reinecke No users left, kill it. Signed-off-by: Hannes Reiencke --- drivers/scsi/scsi.c | 16 ---------------- drivers/scsi/scsi_lib.c | 1 - include/scsi/scsi_cmnd.h | 10 ---------- include/scsi/scsi_host.h | 8 -------- 4 files changed, 35 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 7675ff0ca2ea..99a7b9f520ae 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -174,22 +174,6 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) } #endif -/** - * scsi_cmd_get_serial - Assign a serial number to a command - * @host: the scsi host - * @cmd: command to assign serial number to - * - * Description: a serial number identifies a request for error recovery - * and debugging purposes. Protected by the Host_Lock of host. - */ -void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) -{ - cmd->serial_number = host->cmd_serial_number++; - if (cmd->serial_number == 0) - cmd->serial_number = host->cmd_serial_number++; -} -EXPORT_SYMBOL(scsi_cmd_get_serial); - /** * scsi_finish_command - cleanup and pass command back to upper layer * @cmd: the command diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c77cb0d31dbc..95466a5bf6d6 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -316,7 +316,6 @@ EXPORT_SYMBOL(__scsi_execute); */ static void scsi_init_cmd_errh(struct scsi_cmnd *cmd) { - cmd->serial_number = 0; scsi_set_resid(cmd, 0); memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); if (cmd->cmd_len == 0) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 6c7793c2ad01..76ed5e4acd38 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -74,16 +74,6 @@ struct scsi_cmnd { int eh_eflags; /* Used by error handlr */ - /* - * A SCSI Command is assigned a nonzero serial_number before passed - * to the driver's queue command function. The serial_number is - * cleared when scsi_done is entered indicating that the command - * has been completed. It is a bug for LLDDs to use this number - * for purposes other than printk (and even that is only useful - * for debugging). - */ - unsigned long serial_number; - /* * This is set to jiffies as it was when the command was first * allocated. It is used to time how long the command has diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 4047d68d1b08..83ce8580f150 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -490,7 +490,6 @@ struct scsi_host_template { unsigned long irq_flags; \ int rc; \ spin_lock_irqsave(shost->host_lock, irq_flags); \ - scsi_cmd_get_serial(shost, cmd); \ rc = func_name##_lck (cmd, cmd->scsi_done); \ spin_unlock_irqrestore(shost->host_lock, irq_flags); \ return rc; \ @@ -600,12 +599,6 @@ struct Scsi_Host { * is nr_hw_queues * can_queue. */ unsigned nr_hw_queues; - /* - * Used to assign serial numbers to the cmds. - * Protected by the host lock. - */ - unsigned long cmd_serial_number; - unsigned active_mode:2; unsigned unchecked_isa_dma:1; @@ -742,7 +735,6 @@ extern int scsi_host_busy(struct Scsi_Host *shost); extern void scsi_host_put(struct Scsi_Host *t); extern struct Scsi_Host *scsi_host_lookup(unsigned short); extern const char *scsi_host_state_name(enum scsi_host_state); -extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); static inline int __must_check scsi_add_host(struct Scsi_Host *host, struct device *dev)