From patchwork Thu Apr 30 13:18:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 11520297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D569292A for ; Thu, 30 Apr 2020 13:20:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEC8C208C3 for ; Thu, 30 Apr 2020 13:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbgD3NUd (ORCPT ); Thu, 30 Apr 2020 09:20:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:60854 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726929AbgD3NUI (ORCPT ); Thu, 30 Apr 2020 09:20:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 49D8FAF2D; Thu, 30 Apr 2020 13:20:02 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , John Garry , Ming Lei , Bart van Assche , linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH RFC v3 14/41] hpsa: drop refcount field from CommandList Date: Thu, 30 Apr 2020 15:18:37 +0200 Message-Id: <20200430131904.5847-15-hare@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200430131904.5847-1-hare@suse.de> References: <20200430131904.5847-1-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Field is now unused, so drop it. Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 12 ++---------- drivers/scsi/hpsa_cmd.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 51e503a668d5..6f66cec0e2cc 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -5514,8 +5514,8 @@ static void hpsa_cmd_init(struct ctlr_info *h, int index, { dma_addr_t cmd_dma_handle, err_dma_handle; - /* Zero out all of commandlist except the last field, refcount */ - memset(c, 0, offsetof(struct CommandList, refcount)); + /* Zero out all of commandlist */ + memset(c, 0, sizeof(struct CommandList)); c->Header.tag = cpu_to_le64((u64) (index << DIRECT_LOOKUP_SHIFT)); cmd_dma_handle = h->cmd_pool_dhandle + index * sizeof(*c); c->err_info = h->errinfo_pool + index; @@ -5537,7 +5537,6 @@ static void hpsa_preinitialize_commands(struct ctlr_info *h) struct CommandList *c = h->cmd_pool + i; hpsa_cmd_init(h, i, c); - atomic_set(&c->refcount, 0); } } @@ -6133,19 +6132,12 @@ static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h, return NULL; } - atomic_inc(&c->refcount); - hpsa_cmd_partial_init(h, idx, c); return c; } static void cmd_tagged_free(struct ctlr_info *h, struct CommandList *c) { - /* - * Release our reference to the block. We don't need to do anything - * else to free it, because it is accessed by index. - */ - (void)atomic_dec(&c->refcount); c->scsi_cmd = NULL; } diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 7825cbfea4dc..2575a396f1a5 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h @@ -449,7 +449,6 @@ struct CommandList { int abort_pending; struct hpsa_scsi_dev_t *device; - atomic_t refcount; /* Must be last to avoid memset in hpsa_cmd_init() */ } __aligned(COMMANDLIST_ALIGNMENT); /* Max S/G elements in I/O accelerator command */