All of lore.kernel.org
 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 21/23] target/pr: remove the memset with declare-init
Date: Sat, 27 Feb 2021 21:56:43 -0800	[thread overview]
Message-ID: <20210228055645.22253-22-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_pr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 942b93d12295..3644d2642929 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -1202,10 +1202,10 @@ static struct t10_pr_registration *core_scsi3_locate_pr_reg(
 	struct se_session *sess)
 {
 	struct se_portal_group *tpg = nacl->se_tpg;
-	unsigned char buf[PR_REG_ISID_LEN], *isid_ptr = NULL;
+	unsigned char buf[PR_REG_ISID_LEN] = { };
+	unsigned char *isid_ptr = NULL;
 
 	if (tpg->se_tpg_tfo->sess_get_initiator_sid != NULL) {
-		memset(&buf[0], 0, PR_REG_ISID_LEN);
 		tpg->se_tpg_tfo->sess_get_initiator_sid(sess, &buf[0],
 					PR_REG_ISID_LEN);
 		isid_ptr = &buf[0];
-- 
2.22.1


  parent reply	other threads:[~2021-02-28  6:01 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 ` [PATCH 17/23] " Chaitanya Kulkarni
2021-03-01 13:01   ` 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 ` Chaitanya Kulkarni [this message]
2021-03-01 13:02   ` [PATCH 21/23] " 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-22-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.