linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Cc: martin.petersen@oracle.com, hare@suse.de, jejb@linux.ibm.com,
	mlombard@redhat.com, michael.christie@oracle.com,
	bvanassche@acm.org, houpu@bytedance.com,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH 17/23] target/configfs: remove the memset with declare-init
Date: Sat, 27 Feb 2021 21:56:39 -0800	[thread overview]
Message-ID: <20210228055645.22253-18-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com>

Instead of initializing the array with memset, use declare init pattern
that is present under the kernel tree in other drivers so we can remove
the memset call.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/target/target_core_configfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index ca5b083d2958..0ec9fe1ebade 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -2609,9 +2609,7 @@ static ssize_t target_lu_gp_members_show(struct config_item *item, char *page)
 	struct se_hba *hba;
 	struct t10_alua_lu_gp_member *lu_gp_mem;
 	ssize_t len = 0, cur_len;
-	unsigned char buf[LU_GROUP_NAME_BUF];
-
-	memset(buf, 0, LU_GROUP_NAME_BUF);
+	unsigned char buf[LU_GROUP_NAME_BUF] = { };
 
 	spin_lock(&lu_gp->lu_gp_lock);
 	list_for_each_entry(lu_gp_mem, &lu_gp->lu_gp_mem_list, lu_gp_mem_list) {
-- 
2.22.1


  parent reply	other threads:[~2021-02-28  6:00 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28  5:56 [PATCH 00/23] target: code cleanup Chaitanya Kulkarni
2021-02-28  5:56 ` [PATCH 01/23] target/iblock: remove an extra argument Chaitanya Kulkarni
2021-03-01 10:40   ` Johannes Thumshirn
2021-03-09 17:15   ` Bart Van Assche
2021-02-28  5:56 ` [PATCH 02/23] target/iblock: trim down line longer than 80 char Chaitanya Kulkarni
2021-03-01 10:41   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 03/23] target/iblock: fix the type of the logs_per_phys Chaitanya Kulkarni
2021-03-01 10:45   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 04/23] targe/pscsi: fix the warning in pscsi_complete_cmd Chaitanya Kulkarni
2021-03-01 12:30   ` Johannes Thumshirn
2021-03-02  3:57     ` Chaitanya Kulkarni
2021-02-28  5:56 ` [PATCH 05/23] target/sbc: get rid of the warning in cmp & write Chaitanya Kulkarni
2021-03-01 12:51   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 06/23] target/pscsi: remove unsed macro ISPRINT Chaitanya Kulkarni
2021-03-01 12:56   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 07/23] target/stat: " Chaitanya Kulkarni
2021-03-01 12:56   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 08/23] target/stat: remove unsed macro NONE Chaitanya Kulkarni
2021-03-01 12:57   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 09/23] target/stat: remove unsed macro Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 10/23] target/iscsi: remove unsed macro TEXT_LEN Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 11/23] target/iscsi: remove unsed macro PRINT_BUF Chaitanya Kulkarni
2021-03-01 12:58   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 12/23] target/iscsi: remove the memset with declare-init Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 13/23] target/configfs: " Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 14/23] " Chaitanya Kulkarni
2021-03-01 12:59   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 15/23] " Chaitanya Kulkarni
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 16/23] " Chaitanya Kulkarni
2021-03-01 13:00   ` Johannes Thumshirn
2021-02-28  5:56 ` Chaitanya Kulkarni [this message]
2021-03-01 13:01   ` [PATCH 17/23] " Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 18/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 19/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 20/23] target/pr: " Chaitanya Kulkarni
2021-03-01 13:01   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 21/23] " Chaitanya Kulkarni
2021-03-01 13:02   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 22/23] " Chaitanya Kulkarni
2021-03-01 13:02   ` Johannes Thumshirn
2021-02-28  5:56 ` [PATCH 23/23] target/core: don't duplicate memset 0xff Chaitanya Kulkarni
2021-03-01 13:05   ` Johannes Thumshirn
2021-02-28 20:13 ` [PATCH 00/23] target: code cleanup michael.christie
2021-03-01  0:06   ` Chaitanya Kulkarni
2021-03-09  5:04 ` Chaitanya Kulkarni
2021-03-09 17:15   ` Bart Van Assche
2021-03-10  4:32 ` Martin K. Petersen
2021-03-16  3:14 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210228055645.22253-18-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=houpu@bytedance.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mlombard@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).