From patchwork Sun Feb 28 05:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3763BC433E0 for ; Sun, 28 Feb 2021 05:58:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE56364E55 for ; Sun, 28 Feb 2021 05:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbhB1F6O (ORCPT ); Sun, 28 Feb 2021 00:58:14 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:2436 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhB1F6N (ORCPT ); Sun, 28 Feb 2021 00:58:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491893; x=1646027893; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e+nCZClvPRWXeXByMdBarp3rVDLfZcc7xOm2J+buTHg=; b=FOfBhBBAvoALmRY9x/PCxHPgB5NgGtcwMMayN7LGbfqi6+Mh0Zivk2As keXgGWXRXNJSFPGd46XdxVZHgOimyq1dqfTMpTpUCZL6kvogMbycdlCDj G6qgQrAg+3W+AO6JoMawLT1YRN9Ygyca4V3SpkZDtwxfOEt+pz/XGwsm3 6BTqrUnD7PatW79JRiOV1/PumdUcRGkAbKa7aIrAMW0UdZcGl0jPvP50p V5ZxD2eA641CH/CZT2yRIeZTx7PE1qtYjtD0vP/29NjuqlRpqQ5b7rBRU C6ZcB7MZMglOao0TGLuAAFtYCgqqKW5bmnH82072ertH8i1xpJr5be66Y w==; IronPort-SDR: rA3YEqw0Kp4TAircqdl+RIx7mfVcHf60kBYg8MdxUjJ17mbr3OalJWtPfbrd+VV+Fq2zrN7SNx DWklshVyWH1Sd3+ZyAReVGyNQldJMYAqTxD9Yt8y75hzOB7/HTzKmshQpWWWDJGq3DKb5fL6ty Xl+AFQDzgJtlEu0AmKaiQyYi1Z9GBU1HLW/uVqFejEauKZJD420sTvWkZewHessbkh674OaKei 2gMCEk7K9oWGPwZGCknvOaf1GXI0extoX82CdPuJ4fMFk0pgUjX/j9IY2jhVEscJWY9rZSsAxX O0Y= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="162152791" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:57:03 +0800 IronPort-SDR: E6nY2IkZC+Sm4uDwlnX7hZp5OVcvDvx9Kcefv2yG/SUPbhc8KjnLxklklidtE2MaczgUxW6ED7 +EIFspYR4doWMDasrF5WM7ZPVkytiksq0Poahav64vNDzrwvj6RlSD8xa4JOxn3Hzwxyhuuoy/ QKt8YX/7p3Mk+TbdRdd2Lb5zFTktlxF+TFhxRKW7yj/PBg4h/RVIzoxUJdTqMx8KLRnWf+vjmo M5FB6GsTNmNmqyPImfP0OZeilooUvK6WtZOT8BrfRnOcVHVdsYq3eTvTSH/S7olQiCnhTryWuK NVxtjCDFa2EhE8v1a0M6bv3W Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:12 -0800 IronPort-SDR: Z8zPdriP7Z3VdhAVdEwYRzCO8QMsccu/21jBNytMY+0VpPxOCngV5z0ITQh58uDUJ+Yhwbt1Cx yZaPmOlIsvnlOjJqc3P3xcaHPugc+oOupuATF+gg/cPIoCc5Q4s/t/9hY9PlLiKuqKBOowKP6w R+qVH7Kugu4rr3zdivy5xFU/sEs8bIdCnWUeQXUN3Yb/g7H/HX3c1Qd5D+GuWY5vp35aQmvpNM /9R/MnmtuJo9aOaeAbLHAk1jFWEcES7N1bj2Ylae6plXfp+0kCxyem5iH16yL/XYBdDhCiUNVl WIg= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:02 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 01/23] target/iblock: remove an extra argument Date: Sat, 27 Feb 2021 21:56:23 -0800 Message-Id: <20210228055645.22253-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org The twp arguments to the functions op and opf which are REQ_OP_XXX and REQ_XXX flags belong to the two different namespaces, i.e. they can be combined safely given that REQ_OP_XXX takes 8bits of the flags and rest is available to REQ_XXX flags. Replace op and op_flag arguments with opf. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_iblock.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index ee3d52061281..04aeed6558d6 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -304,9 +304,8 @@ static void iblock_bio_done(struct bio *bio) iblock_complete_cmd(cmd); } -static struct bio * -iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int op, - int op_flags) +static struct bio *iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, + unsigned int opf) { struct iblock_dev *ib_dev = IBLOCK_DEV(cmd->se_dev); struct bio *bio; @@ -326,7 +325,7 @@ iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, int op, bio->bi_private = cmd; bio->bi_end_io = &iblock_bio_done; bio->bi_iter.bi_sector = lba; - bio_set_op_attrs(bio, op, op_flags); + bio->bi_opf = opf; return bio; } @@ -477,7 +476,7 @@ iblock_execute_write_same(struct se_cmd *cmd) goto fail; cmd->priv = ibr; - bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE, 0); + bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE); if (!bio) goto fail_free_ibr; @@ -490,8 +489,7 @@ iblock_execute_write_same(struct se_cmd *cmd) while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) != sg->length) { - bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE, - 0); + bio = iblock_get_bio(cmd, block_lba, 1, REQ_OP_WRITE); if (!bio) goto fail_put_bios; @@ -685,9 +683,11 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, struct bio_list list; struct scatterlist *sg; u32 sg_num = sgl_nents; + unsigned int opf; unsigned bio_cnt; - int i, rc, op, op_flags = 0; + int i, rc; struct sg_mapping_iter prot_miter; + unsigned int miter_dir; if (data_direction == DMA_TO_DEVICE) { struct iblock_dev *ib_dev = IBLOCK_DEV(dev); @@ -696,15 +696,17 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, * Force writethrough using REQ_FUA if a volatile write cache * is not enabled, or if initiator set the Force Unit Access bit. */ - op = REQ_OP_WRITE; + opf = REQ_OP_WRITE; + miter_dir = SG_MITER_TO_SG; if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) { if (cmd->se_cmd_flags & SCF_FUA) - op_flags = REQ_FUA; + opf |= REQ_FUA; else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags)) - op_flags = REQ_FUA; + opf |= REQ_FUA; } } else { - op = REQ_OP_READ; + opf = REQ_OP_READ; + miter_dir = SG_MITER_FROM_SG; } ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL); @@ -718,7 +720,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, return 0; } - bio = iblock_get_bio(cmd, block_lba, sgl_nents, op, op_flags); + bio = iblock_get_bio(cmd, block_lba, sgl_nents, opf); if (!bio) goto fail_free_ibr; @@ -730,8 +732,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, if (cmd->prot_type && dev->dev_attrib.pi_prot_type) sg_miter_start(&prot_miter, cmd->t_prot_sg, cmd->t_prot_nents, - op == REQ_OP_READ ? SG_MITER_FROM_SG : - SG_MITER_TO_SG); + miter_dir); for_each_sg(sgl, sg, sgl_nents, i) { /* @@ -752,8 +753,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, bio_cnt = 0; } - bio = iblock_get_bio(cmd, block_lba, sg_num, op, - op_flags); + bio = iblock_get_bio(cmd, block_lba, sg_num, opf); if (!bio) goto fail_put_bios; From patchwork Sun Feb 28 05:56:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E378C433DB for ; Sun, 28 Feb 2021 05:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66C8064D5D for ; Sun, 28 Feb 2021 05:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbhB1F61 (ORCPT ); Sun, 28 Feb 2021 00:58:27 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:1337 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhB1F60 (ORCPT ); Sun, 28 Feb 2021 00:58:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491905; x=1646027905; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aZzpH4veIJNQx/5JpuGiLxAKoVEslprxcHSo1AirYuI=; b=m6RTZ7G6K57rNTMvaINBznS5gEmjeyQYOdP7WkrYkmqxbwd7VhLWoFsc 6rdWbNB16VAHQVe4qrHsc+bQsY/j21qZ0FgFP8oMWppxxE9UIeJQe6EfN aPIpwY8sINs5xNQsgL0nWP2Qcyiqe+yUubjToW37UThv2BJAy8qjTUxSV sccaLSXOZJ0ddlrL04P/RkPPIWgBu/cZ5quNDqsHPpO5Z3LTY6I/9CjWs /MLigNYtSactpfDA1nx5gLr5twZ8nhzYLdOfh5XwN/jL/FKTAtEDmCiK8 eROPUezbh9MpIqZ2UlgRAOHfXE/C1Yy/qGFM6OPKUQObbgYWqlEs6Sdmh Q==; IronPort-SDR: 7wpjoZnW7ffI3S87aR/aOmgHsiVK0eYNxVz4Q1etfW9ceBMmm6noOO0pVcMrHtHW48NVRjBx9y lXFbDOjsr97EghQ/9+aj+HUqNbgY1ZWIfYmJsGeSyw5Qnpmh7aCNLiKx6i2USFouXye9DxI0V2 F97rMYPKZuKWCIcW3ygTxDdk5dNrLJTjmeGUAiEA2r4UQzglujn30JDdOActRwFacqFrWMMQhU sCiQwyXdM0eBuvQwNYgeSniYRBz9anFy1mnsAgZg10hcqsdVAcYNhwNYlVkKRCIp5TZtxcudUr Cik= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564047" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:57:11 +0800 IronPort-SDR: obsuZ4L2PX/kynHBar+9vvlKl28i+sW53pDBhB5eIscFYhqMyv8l2Gu6JT8zrJyxhGvLgLFRnd 0DRt4BEgxshT7D1jZZ0ElMxCK+pbJJz0q4XTLau8rvRlkxcgmaPfD4nKvkTyl8ZzaDBfbd2eth UnOoRo/VFqwCbu8bzKYeCIYrw0cY5Begm+0IrGIVjzatRhDdGLK+RTu1O4VRtTnoBnSYM54+yq DUYWXWNeeWZNQFnGO49t/eOAjaalxpoQIh5baWyqT9VtvAY/aaLpZL5+EqNFkZhKkV2QS/D7wz qTnEabNglrxp7mmPFsv0BOao Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:21 -0800 IronPort-SDR: Es3j4T7AdQ/ZbS26w/DXlNzOUZlLG0NKRZWwN2sSZ3G8GZMa6jwhxiIfUXvm1KsNfVd1uHYrnC Q5OJKYQoSrjbzPL/UqmvVhm5KxTbTnUazbkSkOFabvsv4vPoUY6rys7j75iL2vBHU4+tIFPvBA iYJLrgH9IxIK5SCwkuOOSPWZRmemaXodE/bo14EsMQLVXfS3eQnzHHsjLxcQYXxp743F8roePi WuZp7HWktVGo3q95ppt3Z+0yzVr82k4uX/aYXZbzJovnguO+2pmY2BZsiG5EaTPoErpSj7k9gh AS8= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:11 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 02/23] target/iblock: trim down line longer than 80 char Date: Sat, 27 Feb 2021 21:56:24 -0800 Message-Id: <20210228055645.22253-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Trim the lines that are longer than 80 char, which is inconsistent with the rest of the code. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_iblock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 04aeed6558d6..db9bd571acb1 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -813,7 +813,8 @@ static unsigned int iblock_get_lbppbe(struct se_device *dev) { struct iblock_dev *ib_dev = IBLOCK_DEV(dev); struct block_device *bd = ib_dev->ibd_bd; - int logs_per_phys = bdev_physical_block_size(bd) / bdev_logical_block_size(bd); + int logs_per_phys = + bdev_physical_block_size(bd) / bdev_logical_block_size(bd); return ilog2(logs_per_phys); } From patchwork Sun Feb 28 05:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27C91C433DB for ; Sun, 28 Feb 2021 05:58:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB00A64D5D for ; Sun, 28 Feb 2021 05:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbhB1F6v (ORCPT ); Sun, 28 Feb 2021 00:58:51 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:1300 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbhB1F6l (ORCPT ); Sun, 28 Feb 2021 00:58:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491920; x=1646027920; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kOFh94eLL2PIEwHWuY6WhNIsqglTKksaBtqtYDCeIPU=; b=Qaz85nd3KX06zLlL1f+8ioEBz1QtMR/JOiHuRvAYNe2+d8gks4Jrn+Tt +Gi9WKUKu1KimVDsYbZMjmlt4Dz3daHt7ULcyIwP3+hf226qG/yt4ejkO 5PzfKThMKVkQWhQ2K5M6DYQ6mWu3QjmPLnOklVdFfoE2MvIpOIicuKPzb lkySWnAPiNraA4XRB4v/FthPzAlidhUoSYG8DmzBhcWGhaNNFjE2WE8lF VwbQb5dpw8rPt2zdj8q8AAWKV91t3dS7QjvXWSYLB7SEdRY5Zss9L/6Bx Jk/FaBP5sB6HtWtrAI8e1KyOT3oBdIjTSsPbxgAHySI5FYj0SZM8waKKf g==; IronPort-SDR: fsFLjjgoiGUSGcsEzl7dJX3uy4EO//j5P3zx0HHn9mkIc+jCFP45+SGsWWWy4/hhPMrp2hI/h4 pQkVszqhidhWp9Zu4uefRV/0LcS8amLbbbxMLq9MyeUpyUXTer2FEYIbkSiyizqLWNoJ2xUzpm ipg8Jyj3vU2j7b/wTq2Idarzs3n6AIaBhDzXozK3SjjPgs+NO7ThjcbC0cX4sTHofVtKB5BcNI LQiCgE9d/Y1YvS9sfHTTgcmX1rN/3/JdHKqyEjr3As6V8H9luSgn1wLPZXG4bZBiMAN1GPUsfT ZFQ= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564052" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:57:20 +0800 IronPort-SDR: 3zYS/Lkig+S/1524VljEmVyQfea7G6HzBVmBIPoT/84EnmWxD5ReJMoRGtHFdCDQa/UJ6sFJ2o gaTvd0o49HihU4aIytqOWbFY5zxcEO+3rppSaKmhIbY4+AzGocKFl5leecdiWq+RDHuyfbzlUq zO1uNFK2b1ubyeltKCZWt5RlAkhwu+Ijr3Ls1VGOSSs0KkdReQn+a6x888ghVSp0fXZtc9uGAF BHVWMpCkhFLyUxRszSZ/kLPbfROQYd3Ej6gOIlqD0DYtID2DCrELJmRvdN8AT4oVOQyq6dlvwe n3HhMoIl3J8ylWVF7kRVXRKj Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:38:38 -0800 IronPort-SDR: NXBoS63biWcrtsBBuMpu9e10llRkalqMFGsewdX6dVOL4yRFCIPNd5kLQMVCQyeY0WlJxqSxzZ YHDlt9E/HkoRNXS4+F+dRREk/wzBLdNR+TGE8zqevE/zGp6WUBQuYv+PL5dTk+QXMPKD0KA/hZ YU5N6s0dhLmmdhrrDCpHmad4bBI3Fz6XNvIJs9+uovE01u++yliOacocgtIjNqLn5r6V0oVTue twJlPU6f3bZd3go8j1Nb4Q/oN809Jl7czIXnaFTiGKZ8AnEyGt6dkAfzUhevQO3Lk5lL2zX0o+ EOM= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:20 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 03/23] target/iblock: fix the type of the logs_per_phys Date: Sat, 27 Feb 2021 21:56:25 -0800 Message-Id: <20210228055645.22253-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org According to the ilog2() it expects 32/64 bit unsigned value. "  147  * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value" Replace the type of the logs_per_phys from int to unsigned int. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_iblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index db9bd571acb1..12999d39c398 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -813,7 +813,7 @@ static unsigned int iblock_get_lbppbe(struct se_device *dev) { struct iblock_dev *ib_dev = IBLOCK_DEV(dev); struct block_device *bd = ib_dev->ibd_bd; - int logs_per_phys = + unsigned int logs_per_phys = bdev_physical_block_size(bd) / bdev_logical_block_size(bd); return ilog2(logs_per_phys); From patchwork Sun Feb 28 05:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C6AC433E9 for ; Sun, 28 Feb 2021 05:58:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EEA864D5D for ; Sun, 28 Feb 2021 05:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbhB1F6v (ORCPT ); Sun, 28 Feb 2021 00:58:51 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:47227 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhB1F6o (ORCPT ); Sun, 28 Feb 2021 00:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491923; x=1646027923; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jV8FsyXd6VoT8Sccl2XFXrDLujX8ZltFvH/C2v8hOWg=; b=mxVyZo7jNniqzwoilxzuzI2p+6B8J1SZFz8jKjc7hk9qYXwNsPYk1uyb cMz/l5cKIV771cvyxkWOBdtmfBmij73d954a1e2OJpoqbXKjs3E8iIc7B WuXEd+q1mB8E90j8LmtWpK8vRj3pnGdsB5ttoG81fv9Xs3o+i3Lef0Ro7 Ma95KicJcz23q+P+3zv+JMCEDF/RedbKmfcOS9Ka4DcE+GkdkDE6rCN44 ZjrK/wIeHipcBek+Y8QsEgL6JN1DLtaI9xjlbqZk0WIa7KZbZ1tNTKzoF hNKhwDvu21HGiZpeqhPmRrkvo2OFbWWhOevB6B37IByo/heDcNZS5YDEJ w==; IronPort-SDR: stO2vVazMgnNlZZGKY63KB/tuKnwHUaifaJi8WS1LkVMOI4jDvd7g2Rh0fLECRew9cfKoYo6c8 aC3RRYCBd5+JIGRgtPK9d/5Pj4uQ6RzUQDIJgBsqObIlrl+vMtNGlxKHMCofzRWt3DKPqrfYco TdL9Pu/rg+RhJ7cDOlzaCT/Wg+/F/YIlvWo64qSso7GZgDM/SkrPaQ7Vp50MUd+fx2jnF2Xhtd lhOK17NuYzhum1ZH4q1An9JcH3/39V3DxhCyLWUtVGmSkh+u0yOlaB2c+HlE1BHTYx8lCSo2/A c7Q= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="160999419" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:57:35 +0800 IronPort-SDR: 9auC3s1nJFtvSrv2yZXq7NToNXkpdCHEHHOFErNJg5tqCcKxkWo5qy/3LL9aur2iUD+7TEDv// VgJfIPJnaOieY/ZT8LYNx8DuTBQ1iv8pL4oPvzOaGjehYzq36VI6osCz7wVEnH2K5tI/uGmpnE v5B8P8RqzNlII/P0uxxhJzh7yMGxyQIP16PthfoDndXCzpibVMUm5QxcP8IuFzfQ2Aaefg+mvk Po9fNfXmYYlzxwT+5/iHfZsfV9TwPMzQonNuiTdk0QDFv7rg1TefySUAb4XlFjh1BPSN7mAGjh gtqZNY0+UwbdumIJAnKPxPt8 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:46 -0800 IronPort-SDR: OqrDyhJXxB41kGAZRTjcHHoaEhgHapa7bxMVE4rA3Fl8yjSfG9sSLhVH8GgXUToV7L/3eYaZUP b4LaK25Fx4yRMa9X9Qqhbu1M1mX6bNWarNlumiUNXICsWWUTDKtmsMvj9/8F/h9AOXj5a864b6 w6tCiREjRmsk/5daTZP+FfTX3Zq2nkNjbDsbzvENS46Nl98sdM6Wdryzrewd2lVi1jxBDquLRy y2CEd4QWM1SJrHLukzfUxOaT/TxB7jpQUzEKd1jfiXo976qTRC21AXkwH1j8Y1kiGpvWGdvLyU lR0= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:35 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 04/23] targe/pscsi: fix the warning in pscsi_complete_cmd Date: Sat, 27 Feb 2021 21:56:26 -0800 Message-Id: <20210228055645.22253-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This fixes the compilation warning in pscsi_complete_cmd():-     drivers/target/target_core_pscsi.c: In function ‘pscsi_complete_cmd’:     drivers/target/target_core_pscsi.c:624:5: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]          ; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */          ^ Signed-off-by: Chaitanya Kulkarni --- drivers/target/target_core_pscsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 3cbc074992bc..689e503e3301 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -620,8 +620,9 @@ static void pscsi_complete_cmd(struct se_cmd *cmd, u8 scsi_status, unsigned char *buf; buf = transport_kmap_data_sg(cmd); - if (!buf) + if (!buf) { ; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */ + } if (cdb[0] == MODE_SENSE_10) { if (!(buf[3] & 0x80)) From patchwork Sun Feb 28 05:56:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69300C433E0 for ; Sun, 28 Feb 2021 05:59:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3813464D5D for ; Sun, 28 Feb 2021 05:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbhB1F7G (ORCPT ); Sun, 28 Feb 2021 00:59:06 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:34894 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbhB1F6w (ORCPT ); Sun, 28 Feb 2021 00:58:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492605; x=1646028605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7kSYxKm8+KMkh8fgxhih+9JXrVQOWMzWTgb+Sd44LW4=; b=gr5m0zDXd5tGtuugI1GiLEHPzmYBxXq4wwM516e/AgwwV6totwb6DLsb RQHmqsC5vYaAv3fxTq4zpAfxCh3p2YJ6a/XE7xMab8J3SVmLG9LdY1JIn Vh2c/Ae1IHdCR75Q9V2hcYEUkx/z4g+mAoixpgVX/fq/2n6NxUQTp0a2i g5Sj0dCpCwBKJa1F73cdbHxPoT2PxqTDMgxrzjGKEUrnNLfd7dbYuEj/M hNisnXcF3bDipyrymfJif0VFixKmrxRB+wgKj53zVECmq2uH2EN/k4/Bz EIX/zfnAOQJ+ndclZmt3Hp0971z8NrxsWUqUykIq53ZiGCOs5uCb9xmjt w==; IronPort-SDR: u9hISYfxlNQPeWnKFTC2Hze3tQBCynLFYfiYQVEyxYrbeFPMuJmKot2lY0RE7NnfGuwGOoYXJa m1icBkAcxYmDxcJZaVn9PoIWGI8nnWq196SfhX8j5QEsTRa1wrA2GC8HJ3njWnRd8HR+Ohfe+Q SLqCmADJn5c793pz0LQ5/otv3sP1dkDkPh4uXnHIMmDw/przo3JHVTlsRena4yczO5XeWc2B+e nVBWrnWrf+07AH46bKd+CJC85Maa76eZN8nCT22Wp6kg+/YgkoNa3UreJfECzwbqn1wSG3TfbQ unA= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="265236069" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:08:25 +0800 IronPort-SDR: tRiDzpDcaM/zQnYgH9FALCn0c/g+3x+jUpQJ7CLFSV1q3rgTUvB1uwgQ9l7WxXMkyrsOhOKBru OZD4vkte8fs3dmopYYsOnoQt/CxnwUUo/3JIPFKkk/JiOVbxs94ZsEhMhUwt3IGl5w3dynryc/ LbX1F0V+axJZ/1LIqYKzjGyx2ilBjpDz7NF/iW7Nm6X6VjnM+VLAZxatKZuv/PvGCz8J8odEaG 8/f0bBaCYgSOqS/X/5MAnffED8PyVa2YzEUIQUh75zI4UdakBosEfCs78Yeoj+PR9lJNLE5Hwb x1x9zqbI4gXuQDVorWh1yGjL Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:39:04 -0800 IronPort-SDR: eGGCpVsT61EQctc8HcH2EA0W4n2olUy+6TB5CstDgSTtVdhunrgtEaLj8ZHecB+WhQg+yGPZD6 udQ9tsBikPmPhxW1V5OCCA8n+Qa0fyX3h1TgBoV5Kn7Sf1SB9n/m51FfzhM0NrQeHCyHeh0r6a eDDxLRWgMkiouH2cvUiVCUFP9ROFzyZXKS2giit8evSRTTjL+k6XFp3W6mrGuf3O62r+ei2Det Po0THPfFu+1N4172aRlkOgfX2+vdQVzs30mSvMJ4JYhI4TtdAZNfKHV1Fu0qihQFhiRZ5VcHPo z14= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:45 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 05/23] target/sbc: get rid of the warning in cmp & write Date: Sat, 27 Feb 2021 21:56:27 -0800 Message-Id: <20210228055645.22253-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Rename the function local variable i -> sg_cnt so we can get rid of the shadow variable compilation warning:- drivers/target//target_core_sbc.c: In function ‘compare_and_write_do_cmp’: drivers/target//target_core_sbc.c:475:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow]     unsigned int i;                  ^ drivers/target//target_core_sbc.c:451:6: note: shadowed declaration is here   int i;       ^ Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_sbc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index f7c527a826fd..7b07e557dc8d 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -448,7 +448,7 @@ compare_and_write_do_cmp(struct scatterlist *read_sgl, unsigned int read_nents, sense_reason_t ret; unsigned int offset; size_t rc; - int i; + int sg_cnt; buf = kzalloc(cmp_len, GFP_KERNEL); if (!buf) { @@ -467,7 +467,7 @@ compare_and_write_do_cmp(struct scatterlist *read_sgl, unsigned int read_nents, */ offset = 0; ret = TCM_NO_SENSE; - for_each_sg(read_sgl, sg, read_nents, i) { + for_each_sg(read_sgl, sg, read_nents, sg_cnt) { unsigned int len = min(sg->length, cmp_len); unsigned char *addr = kmap_atomic(sg_page(sg)); From patchwork Sun Feb 28 05:56:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96E21C433E0 for ; Sun, 28 Feb 2021 05:59:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EE6A64D5D for ; Sun, 28 Feb 2021 05:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230220AbhB1F7H (ORCPT ); Sun, 28 Feb 2021 00:59:07 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:1366 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhB1F7F (ORCPT ); Sun, 28 Feb 2021 00:59:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491945; x=1646027945; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WtNMMAgFJuO/rCrjBbOX1Y+YFKzRHWrQ6/oJa5ZpzLM=; b=Z/R1/Ss0RtrA/9J9KCWsAI7GiLmzAW7vRDoZdHLvroWtVYesCM8rf+z6 f4E1G43MrC9Fa1Pobw+d+myQqESGAVL2ErrOT2OhEcXsShVIbuLJQFfiD jlArII964oct8Sn19bZPtAHlTRETo75ftrd1JOATIbx6Z5pNuqkQqId+M I2+0G0dtBNPiD91j5UK/pgJbRbfjLji4ofHW8jZbiWhrhsohz75epoEzZ 8pFsjN1bSS37BrJcXov5+mNzQlWRdp+eq35MByw2FgE0CQ2st+SbzkQWd o1oNCrTHO8GVWpwb8RoUlfpY7kq62tKS/hQeG1hWclRc7Pgcsw8nNfhrE w==; IronPort-SDR: EVxhdmjhwjgXFWTMOFcnCXtZgcDaaj+WIhAmQKOwuFDKKH1WsN9pjp0T8UopNTnEjzf4zegYv2 QsZJ/G3wC5YsT+1++1ogpE/9QLPddfNvz+0ljC+BCQUrbyY4gS0FYn7qeICcdttAGXdAqInghc qlrcyH+0Gh/ZPFkDS0M49Hpr6QzVxxTQPytKgsxra97ElBprHOVXmr8p9goUIYo+3VIsbPEIV0 p7lHOkzrazuoUCQ6rGeeumyOFIQ5chB0zPnd1tCIl8LjVKuaUTHHDSR5yW+SlgXt8Y7WgW2jZ9 mF4= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564073" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:00 +0800 IronPort-SDR: OcYEG/mt8p57+78wXBYOMHPjyoC89uCM7onqPS16QRFZ0XqZyzZeS4y1ORJnNbFw0rA6bvEvMN yMv1fa1Y2irgyXLhnBGqKAUwjUyr2b+0ROZYLEL8ESWfSn8tyeHVeeW4lE3aBo0qqoX/+WcHIL 5k3I/7bR1HDRl8M7ceCI8f4GebIfS1ss0azIDTx0dtK0jaf+dTmxd/SITPvRVxJ5hWZvx7vhY3 oTzOHtYzHkRwlc812NinsDKOJGawI5JRx18g4gxqVaQ1ny55+KiuTWbupkTTK5ANBYbM3hPPQD 5SpdIHIoqmLWkip+ft+DvnST Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:10 -0800 IronPort-SDR: GL/VQWbHLKGHW2/D8fYnwdqdRqdbdHUMEP90WLrQdbwPr1oKE7RGNwzVo06Xmcmc+eBgUxzMve eVAdxgoJvBeX91Xq+jm0fO/u+wh6FGipr64D6IR/5RvJVnNqeMiRd31uwzqqpU4haKf6J91yeN yGjnD0kdUiqIxj+LSzbF/FnSArpY9QAAD5f7WhpNS92w3yjx0YLAywZ7TyhxmJElfzYVzP//w8 DQaqMXjS4XFF2OfFJIgFeLb4oehbBBkqgXjkP99IruqzBES/7NWyopu5Ic2BLGIlIehxYlA6sn xio= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:57:59 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 06/23] target/pscsi: remove unsed macro ISPRINT Date: Sat, 27 Feb 2021 21:56:28 -0800 Message-Id: <20210228055645.22253-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//target_core_pscsi.c:37: warning: macro "ISPRINT" is not used [-Wunused-macros]  #define ISPRINT(a)  ((a >= ' ') && (a <= '~')) Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_pscsi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 689e503e3301..7b1035e08419 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -34,8 +34,6 @@ #include "target_core_internal.h" #include "target_core_pscsi.h" -#define ISPRINT(a) ((a >= ' ') && (a <= '~')) - static inline struct pscsi_dev_virt *PSCSI_DEV(struct se_device *dev) { return container_of(dev, struct pscsi_dev_virt, dev); From patchwork Sun Feb 28 05:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65888C433DB for ; Sun, 28 Feb 2021 05:59:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 338F664E4A for ; Sun, 28 Feb 2021 05:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbhB1F7u (ORCPT ); Sun, 28 Feb 2021 00:59:50 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:34894 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhB1F7q (ORCPT ); Sun, 28 Feb 2021 00:59:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492687; x=1646028687; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wPdIvppD0YsC5I7aHdBmZrV0Q8Rh2FzwPy4aY7o3FMk=; b=pIlPnPgWak9YcrRUId9w96jN2Dxcq4r2W2lsdvu3zYGVxTMcIcO3Yna+ fIGbm7eWUyrzjEsuiOI9A0ONR8qT9TNqDcFlE2MkDbfzT8QG1ImJn8zKS obbicbXy+I7sKIjsTWGFKla4kXRl15sL/ioX9A0RDwsDAfHu+54bE/oXQ B05bj55agX90VBaPmov6wRNrHYkRYITX+EwogOwQQXe05Dh3csypjZCkj WSI34o2qnGxKl7tsIkvvjFq/O4Bc8q/Z/4AW+elD7OEXhvBohWlthDinE QukCwsbOtYWGaFJyPKuD4/qDP0RIs8QQLh5GvNMVyQer4XYJjAn3vhkXV A==; IronPort-SDR: Ug8pQgtoMs5+E061BMwemvCTkFUtZ1CJxR690L6eQhTFX2RxrV4roQyVqTC5neJjaAqTtGljQ1 svBsFvMZyaMQGGdFnGvsuxjm8RIEm4AamD8uHmZq6V10/q9S65OjGVASwdN116hx9MRtXyf/ye pdrHg2ZDLXIwGLcLnF6yx9ldevRwJTLhbHUbO1ePbBjNoxp8Z40tQYXIbWbn/0v9F2ekJdTZA6 lQsRFC9nfQWju/699xORQ8xIxrMG0U2bvIwI8TNgP2EFB8EL2E0g8ZGuc4dbVnOtYHC91jP0Dx ZR0= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="265236080" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:08:59 +0800 IronPort-SDR: Fp2xBH0LQTu/Ba8VMc1E9X0Pxqn5pD1w18Pfn3RHRQikvemoZRwv+C11H3Ilu51X7bB1RxGfXO ew/fuhV2AVzroh9C9O4RvIi5RORsXlwv2AGdSAs3vxzT3LGR4xntwV7yCDeEpsPhxDkm/4cRar cO0GF+q6mdVwh5D1XncoqS22vJh6RcWWtMiRWOrMi+Zta+J3G3OfzcPUBe5KCT0mejFl8rD+Iu v4GLoaQvs29+9ORKy25ZFpzua0J28Xr3FUOZParbic2RNR+7MUM9Hzi8HYEEEtUGDgX1RCH/+7 mR/l8BDbySi/8l2X3czogr3W Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:18 -0800 IronPort-SDR: zc63QTPprKAyK0tS4S22G+LQT1cONyRWNTeWQTBCiUJcOEbi/Ewx1u7lYJbyB1GTKQZhzoas2i AIWAEL0sCmX92F0jEiBM4/OiaSwYa5kic+h3ypLvFr/y0ywc9pzMkvkbjb6Pzvr0EiIV55R47R TRyUEmmm4sn+qjaC4GuIx9/PHZQgYjXpSd8viCiPYHUOH/H4BSgUvYhPa9Df2/JQRZreNm4ofh eRW8NUIoQCox93EW2slwejn9tEH9CUG97trxOzpjUxaPY/7BPbJNGvpHa1oDZRBNjtARQeMzSJ Mek= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:08 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 07/23] target/stat: remove unsed macro ISPRINT Date: Sat, 27 Feb 2021 21:56:29 -0800 Message-Id: <20210228055645.22253-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//iscsi/iscsi_target_stat.c:36: warning: macro "ISPRINT" is not used [-Wunused-macros] #define ISPRINT(a)   ((a >= ' ') && (a <= '~')) Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_stat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index 237309db4b33..2d2c7e377722 100644 --- a/drivers/target/target_core_stat.c +++ b/drivers/target/target_core_stat.c @@ -32,7 +32,6 @@ #endif #define NONE "None" -#define ISPRINT(a) ((a >= ' ') && (a <= '~')) #define SCSI_LU_INDEX 1 #define LU_COUNT 1 From patchwork Sun Feb 28 05:56:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AE6BC433E0 for ; Sun, 28 Feb 2021 05:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DDFA64E4A for ; Sun, 28 Feb 2021 05:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbhB1F7N (ORCPT ); Sun, 28 Feb 2021 00:59:13 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:1337 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbhB1F7H (ORCPT ); Sun, 28 Feb 2021 00:59:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491947; x=1646027947; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jlnYlB7KkBVHxXDXY5DxM2q8kiiMAJP13pVGde6cMSM=; b=ijRLk9SSokZLIuy1WLt9xwJCkTUXRFawl+xheS8vhFkcTPu4NuE8wb0X SpD3kDWwXMRxU0L2cw5cgZRIIiUj9N0VaP0X33wq9GjgAEI3MqRAAYnrn dAKyEAP506nTSLuE3UqCWzLV2nu1XSG4c73M3ICsBoaIRc4T4iephAzdR gJSvdwKyhVWCtJS4UseAl/r+9SqcWnXRH88lXeS6I/zh8ukwQ3XnIi0sR O6zkJSTqe2MrqmMgWKNR2TMMgNBX0QxwT0j3lyOnxptWAsBX8XKFiJCl8 o3weO2IcXPWSx2OkXoNorFGX5YeccLpOHm4PB0bQZ8DV2wUi64sJW+04R Q==; IronPort-SDR: cw0BfvLGwNTtqULfoeZu4CHdHnCwTrFjqH1W4eZ2kixnK/sSYjgkWFB9qexuzGqbfuujymbkWd YjucrWMuhjwRPlUuyBqBFz5PzK2r7vHnU3nhe1MHilMKxMzDICgJXAKfcTGxDL/nmPVtzZV1UE QePWLUwWzFaj1AU7/lzuy4N12yX6hj9QNnD1Cx9+cY4Mma2mwFdgB35HLzybXWVJVQD/k0mEFk ILdMdtydpph53GGtztzkuAtcSVOeqip0DW1a10mJ6CNVaFu6xn7j22aY5BCED+OUReBFuBMsjw kzo= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564078" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:17 +0800 IronPort-SDR: 7MKI43X742fkPF4t8ltBPPOUqdrqSX+N0ktSFCLyeEMkQHJTqAWr+a8qKXWIM5vrBktedfLTwG Lh4ZtdSZOtXROkF75WD2EPilN+W08HyCFc+EpPaONelvhIDP63fT+Uot2kOoY7xzZ10DeRa86z gOuuePt4EgoAaLQPPHWPqxM41pO193GM3hDxuGWDHvzoRIiVMwt7pMDe7qVC0VEvvAHNgONryG YvXoeTjxyHtEbaQhngo3Y3Tat9cGnKdgvq8IKlm72ci1AATeVG1iUvtYy1L+XndYdLaM2kPpIC IkWqI2szF96CKik560udggjH Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:39:36 -0800 IronPort-SDR: vlg45nhZbx3XPbsLO8fq+IjFknI7UevZ2WZDK13r6q29xQhJtafrr7DRev9seq2qtg3qbtzwo1 dhc7TO2WWIWqBrOuWvRWdOhWjvXSm2lE7EyS5k35Z82Ds9W8gaMNVEhc2H/kstBO/0WbtAj8bw Tq5e6GV7KiYfaSb5UqStP33DS7OdVJzEjRIR5BmQMI+gQaGz+eiEEzQysVQDE4XnIZnH4V/65K 4aPJYoDcAgZvZ+J8z2qUVU4V1oRGsX8Hrlrc9xdxXPz2UJv1TLPg2ut/ey9KhaAlfr6kY9vyWh x/A= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:17 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 08/23] target/stat: remove unsed macro NONE Date: Sat, 27 Feb 2021 21:56:30 -0800 Message-Id: <20210228055645.22253-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//target_core_stat.c:34: warning: macro "NONE" is not used [-Wunused-macros] #define NONE  "None" Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_stat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index 2d2c7e377722..62d15bcc3d93 100644 --- a/drivers/target/target_core_stat.c +++ b/drivers/target/target_core_stat.c @@ -31,8 +31,6 @@ #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ)) #endif -#define NONE "None" - #define SCSI_LU_INDEX 1 #define LU_COUNT 1 From patchwork Sun Feb 28 05:56:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0D5FC433E6 for ; Sun, 28 Feb 2021 05:59:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E0E664D5D for ; Sun, 28 Feb 2021 05:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbhB1F7a (ORCPT ); Sun, 28 Feb 2021 00:59:30 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:6288 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhB1F73 (ORCPT ); Sun, 28 Feb 2021 00:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491969; x=1646027969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ggGVfWhUsAWpR7HSNj5OQYt9h5d0O6rKV8fQJdazerE=; b=lioYjNoLMs25H2k5l5KJoaBDpPDaSfM9o68S4w8nMAb6Mv9AyjduNxzg ACtmCR6pUVPwlajK84e7qiWwsjR27Llnbvbf84RrPcdD0M+JTYuXADNs4 34GId1h9LIEc21apWXTkjpAgDSmhvdlcc0Vz2I3JM3lxPOnO+jN9q0kHE 2EVS/kLT71er8omNAZZwIF3NBmlPzLIzeCKdguRUrTMSMgVJIeZ3AGuDJ SkAqQ1AGmNxwNASeimgKeQ5+rXUPewwm3DdaNoQDF3rxfyrPTXkPwB8yM t0xsL/bHyxB96cwFOx9Bbt8r4dsHZNtl9bB18w4uIEMoBfnxdSdXBb357 g==; IronPort-SDR: BSo9/aigVaLyJUgLlOv9HUaSBHGWxQF+YcD6Qz744J6mg1klXrMXLkgz6DYNRB3VB2wxmoBz0T kaIERH8q8sCUpA1Zv3Fr3o3GX4bAZmblUjfkvwt/+nvKBy1g5bh+BoLwBcdlQdPmoYIXSu0YHF lVXKBNfxM5JL0U3w+FopcPxKmeMazhXzOb43pvAzk7a9e4wAzLpRQ39wyCfxoENSIe5ZxZqZDR F5bPcoEPEswpolHLos76dxW3tfawTQRoO4aRRKU0COl5PSExVxL/eb7WPUUD+MwUaqoDaJsoiz toM= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="165466155" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:23 +0800 IronPort-SDR: AlfMhnUBDEtnNvoDY4/klQfnDpuKFw6Vzr93fVyGjyHMNhbedlt0ilp5SWQRvt6M6tv9B7QL6z Aq+Zc1L8mCx5VAM5Rfks07DQG5rnnaoBiI8WvnOo/FFYIfHDKodWeGj/IhTU+ayUb7Hh8Vn/+X rBV+P9xattpBtoPI2MABjCrV7rIHXIUCAnFl2bRVeg9Of+jKbyGzCKMlt05KB+UDoi9B8arY26 dMPaeKImv6KEKAB5djc+GY7mOQagwe/cSnMozUFN75FIPrGzTIknaj5g8H80PDcF4pZDHgWFIk GBWwLITwjqhVee0PtEahOj44 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:33 -0800 IronPort-SDR: Pk0drcTuIsNgzB7Y5pRnML6EjQW+I+8odG3oGhfM7uUPu++ndvmrOHa+wsGsSVN32moqqk/VrK 6d9DUW6EwJnX4auBn1EQovCqZQY2p662U1DWCdyXcHBV1zEZZzqKFFUQrlMRG0Aqm554aMs66H hAP1/6p9dBykrRnTN+g7ZjyZSE/bGlTRGadltwerI5OqvnNCjNN9tOzyqoHGPaSRElSx1H33cq EWA42u09nW6fOyYfsy5olrzPyHTlp/MPmbhr2RdCzc+KQDEycTC8pTiVEu/uF18LBFXtagU3Tv Y+o= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:23 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 09/23] target/stat: remove unsed macro Date: Sat, 27 Feb 2021 21:56:31 -0800 Message-Id: <20210228055645.22253-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//iscsi/iscsi_target_stat.c:31: warning: macro "ISCSI_INST_LAST_FAILURE_TYPE" is not used [-Wunused-macros] #define ISCSI_INST_LAST_FAILURE_TYPE 0 Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/iscsi/iscsi_target_stat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target/iscsi/iscsi_target_stat.c index 35e75a3569c9..cce3a827059e 100644 --- a/drivers/target/iscsi/iscsi_target_stat.c +++ b/drivers/target/iscsi/iscsi_target_stat.c @@ -28,7 +28,6 @@ /* Instance Attributes Table */ #define ISCSI_INST_NUM_NODES 1 #define ISCSI_INST_DESCR "Storage Engine Target" -#define ISCSI_INST_LAST_FAILURE_TYPE 0 #define ISCSI_DISCONTINUITY_TIME 0 #define ISCSI_NODE_INDEX 1 From patchwork Sun Feb 28 05:56:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61D0FC433E0 for ; Sun, 28 Feb 2021 05:59:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 272C064E4A for ; Sun, 28 Feb 2021 05:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbhB1F7p (ORCPT ); Sun, 28 Feb 2021 00:59:45 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:2540 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbhB1F7n (ORCPT ); Sun, 28 Feb 2021 00:59:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614491984; x=1646027984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QvrZhvR2RwJAY+XI+wFrZuuLCAZRVw5n7M7KIGaG594=; b=BIyJ7jEA7NmvttJPp9ayO8feeQMMUYoGX8PzKCkUBT+DinaNtUte1FOu 7GxFJbL5E21eagZ/yyGVSG4++Hv8umL9G0Yk1WIOWBQOez9B1ora8xy2/ 1LpHRM7xyLR2Kv3DYdtIwyG3pp1mu4kzMfPexHAub7ckBM2mkkdx3AMOJ Rdsl96LPtwoeCqS/BgvR5HbLAvuQve1+Q77Cvzavo6tfwKmAcuHrukojZ CtCmoT7r8dGJhNlnO7LsKUFQitLB0Nh9vOzehRvbkJA9Dzg9FOc8ve6cx sH8C27ZOSvEEh1CzO+QmohEhbQ1+4hOY4JA9oe6LvLeld7u3KNFeciDnW A==; IronPort-SDR: KA5s8ZgOKQvSF3prb+fvVXd2iOl5X+ZAXYj/fZDl/aRFHSea90t+0xHAaZy73nUP+Wnh88Zogk BsPlKRu0Um9TjSHrvR2Fvvzc/SX9PY1Melmw5zCMr0awIMh3DQm7LScpRjWU9/qnKwIRToxFOC 4EdWLe8AuPIYSzS5RZ46W/2PrQTjXfWoEsa185nfPxwC+/GzAjFU4+E5agVWAEkI4N8+V9B3V1 gTFT0kS2IluB35HLX7nQDThs1ewjb/JafI8A7UfKzUF7prYXzMkiZmflTzqm5RBohYQviluyR3 DMI= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="162152825" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:31 +0800 IronPort-SDR: 6tfBvxKLI0XFh6LLTyw/4bBLEnE2n/sDpbMPE3JbNQb2z6l6kqq7Croebm7KBnTWsrv0ollOXR 4Sh4vYW+W88tJ59rWU3oz3Lb0Mom6RS13AgHfNOsKVkLN9PbKfW1F93Bwg+GMbP68EAq4MZcf1 fFnpsIdNdrp/H0neL5pADq1U8eFh+Piss7sRl/LLXX+C6OqSi2XndIRql3TrWjdwzQki6/Bm/n EZnPTxSnfnnoW6u1X7lZjXanrdo4SJ+Q5HZmYIKNGk2zCuPS+gLbl+MycNi+IhWKoWv66f9lcn DSQOodXLki002fKPDO6UJz7B Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:39:49 -0800 IronPort-SDR: 6hth63V4yCu2NcZQZmh0CBvH1bhkcN6LRj/dAjeTjayay2NaGXa9jEV1wE4rgvRlubnNeUStSO NPQXoEwXrA8Ust/O5rYa2D3Sjqt8Y9zoQu1qlyriNx5MtEcaYaEezNXIA4awMwEThlOhCEwP5W D7ATSbpHy6Uq8Ljc6TM+97zYAjFv/09n2avGF/DcfFR+zoF7K8EPXKNK1QUvqrW2m27CjBOdcY wPuSNyXmx8zLMPz4aVbUCWqZBSb8yr0WapJ704dlVuaadu0QA1xOV5Od1gCmSfv+ZgRbCNiE1t 3XA= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:30 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 10/23] target/iscsi: remove unsed macro TEXT_LEN Date: Sat, 27 Feb 2021 21:56:32 -0800 Message-Id: <20210228055645.22253-11-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//iscsi/iscsi_target_nego.c:31: warning: macro "TEXT_LEN" is not used [-Wunused-macros] #define TEXT_LEN 4096 Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/iscsi/iscsi_target_nego.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 8b40f10976ff..151e2949bb75 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c @@ -28,7 +28,6 @@ #include "iscsi_target_auth.h" #define MAX_LOGIN_PDUS 7 -#define TEXT_LEN 4096 void convert_null_to_semi(char *buf, int len) { From patchwork Sun Feb 28 05:56:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D60E3C433E6 for ; Sun, 28 Feb 2021 06:00:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC1E864E4A for ; Sun, 28 Feb 2021 06:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbhB1GAN (ORCPT ); Sun, 28 Feb 2021 01:00:13 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:6288 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbhB1GAK (ORCPT ); Sun, 28 Feb 2021 01:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492010; x=1646028010; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1wbH/tii0VH/dbuuyyUFSquAFgn70CaFzqbRksUlvyU=; b=ClzdxL617TOUdFz7/r9QLiEeDQ3Yu7s9mv+7F5Z774j6iXsauX9ClQFp zYGz2hwMHr/8UhH2dyyEYin8u8hMTkmy3KyLr1o3B+PXHt9UeqmAAWDBq /Wg0pdULMGUHaEnXli0mNcwZxaaxsCSO0mA8Q/X6VW35Mbs/OqDC/NKqi IiVksWKOMpsXT+I8xgK7aWfLrSaX3oYgG0BWo0+4UYyMbbRGz3kWp/OTc gFFyOlrSocF1W8COp46MYswLm44y7QQkRgyE7vbQhmb9LdXIE5WYdWkqV Mn+1GlthG1aFGYfnNodg0r/HKwh3OJrHlGphkfqozGm2e4K9iz9SqF224 Q==; IronPort-SDR: CVpfMFUhMSfR9rykoiBQR5mm6Ax7gH0LwHp6hih+I3M4dQsT6bBdrsqxFigudansQvREekRBKF kEm3rsPo327zvl6M60CXQoWnCOvBx5cw+p6mGrch7O9msj40ySGl6AWrv/VmOKsYsj5uMM09TW JY3GanO8ZAhVJkCQ5aNjdI/NdBR6DBRxhClKbJt1G1nn8qH9eoMrUAuJH9erQf4e9yedsJvNt0 mi7JzFJTNZmDKKAYHy41IvunHfWBJJTtUfqZpV/nCaWkutVE0TuF9xKxPaTgPgOdrcQtTxD2vw 8Lw= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="165466159" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:38 +0800 IronPort-SDR: CyXwvX5SI23vUzm0QmvOX8LwKyABxdo6ucA3vH49N5hyYJs6lt7ludImtmsj/+ObexR7BiyeYE 7Q/Gmo9Np2mXj7YqmY8R8ZKj2qCfFxg6K2/EcO4P4xaXcHBZX2uXA7WVgxxHL3QLwVTS2rYXWB 693TpkdQOWFs0vgx1ZTsZgPwvuXe8joGJh6EU9EOZk+neu/qZX6w3RpCF59rZuLtMqTZzmpxhe ycC7cIc+RdLhy5fHJJk6MF0rzd/Geuw+NGNst9cpm6mNqRHOaZis/NqsVGAsz5MWqBEaRNzelT I5OyvBEO7J+xOB1DiZ7BgLwW Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:48 -0800 IronPort-SDR: lJWeujZDKckaZd3TUpDcX/PyE2mZ/idmvqCXuP8lOwdHcpX84p4qLJzTgdIN2XP+irshYqkzxZ 52/KOqcc1Wqi06ZhsN27MecTIDzC2pkVMO2DrZgGFyYktUO87umUzCpzX2jdvso+1QK5hU++dT 3DaSBNCi229MHH6EHxmoE/rKJM9tz0elzooDiRQB0wioE5V3Lp1y6paDxgFhrdDq2n3EJKB9jI BU8CQigTgzO9od3HOyk3CRWwJ0Q1iZ5f2mZJr4CgFKjErYQ/WYv3yfM7buP0eunwiMu1ucQ3PZ ymE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:37 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 11/23] target/iscsi: remove unsed macro PRINT_BUF Date: Sat, 27 Feb 2021 21:56:33 -0800 Message-Id: <20210228055645.22253-12-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Remove the unused macro that fixes the following compilation warning:- drivers/target//iscsi/iscsi_target_util.c:31: warning: macro "PRINT_BUFF" is not used [-Wunused-macros] #define PRINT_BUFF(buff, len)     \ Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/iscsi/iscsi_target_util.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 9468b017b4a7..6dd5810e2af1 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c @@ -28,23 +28,6 @@ #include "iscsi_target_util.h" #include "iscsi_target.h" -#define PRINT_BUFF(buff, len) \ -{ \ - int zzz; \ - \ - pr_debug("%d:\n", __LINE__); \ - for (zzz = 0; zzz < len; zzz++) { \ - if (zzz % 16 == 0) { \ - if (zzz) \ - pr_debug("\n"); \ - pr_debug("%4i: ", zzz); \ - } \ - pr_debug("%02x ", (unsigned char) (buff)[zzz]); \ - } \ - if ((len + 1) % 16) \ - pr_debug("\n"); \ -} - extern struct list_head g_tiqn_list; extern spinlock_t tiqn_lock; From patchwork Sun Feb 28 05:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E0C6C433DB for ; Sun, 28 Feb 2021 05:59:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4D6D64E4A for ; Sun, 28 Feb 2021 05:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbhB1F7x (ORCPT ); Sun, 28 Feb 2021 00:59:53 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:36622 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhB1F7w (ORCPT ); Sun, 28 Feb 2021 00:59:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492696; x=1646028696; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vXAxN9MI62o8rzI8RxdTpG+7QbGBO45tb1tY17jlbrA=; b=RLFBF9uw9IzXbdI7pLoG2wb1Uvj++lm22wT3HHUwVamc+ouCcLW1BaE3 54GUUbSxqRUcbCUAB/LWIg1xuHwHnSyS+r3fDqsxszH1kdw45H8hLHFhO 5LZKG347d3uWvdbK/rQarDqUMS05yCdkm7yuoo1fHUx/hVrjRvoBYXgCt wWj9cfvggX6F0mstcJ+D4GeIxUjfOf4cTqItfTnr0c2YrBaB1NuueminC GLR74SDT/bY5fDTgW4b1zJBCpO/UWGICB4LB/23Cbg1QhGnEosUIXQPoS PS6xiFyMwyzBQOrXwkPZgONE05GsbpqotSGcz0ssgv2/6st0N92LU/mqX Q==; IronPort-SDR: isxWMgOGj72Ft+c+iPOEZMhV7jqRZJnleR+AkhAFYIvgHxuPfrvKZB02O+Up2Lzt6iM3AcsIFs LlCp16jaTSQx2VkSRsKOtPYnSA3fjZ2PR0GwgL+YgEQZkpQxNJQnVHdjG4wZg/CECcnQGMymD5 NELLEbw178flxDuwMSIgTNdnA5QZ7r3VfHZkQwHUrFrOhTbkcO3CJWVza4ftgTNZvIqxa/aLy+ WQnAs0QLI6SIsB1d+1GMeqU6Umyft8W6nmdYCzysGUEKaRH6MVt+oOe+qtEChJXcIvtxHZYxMd OKA= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="265236109" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:09:57 +0800 IronPort-SDR: dk0V30zFNCZIsK9q3X0OLldThY6E+pzYLKwhDXqKxSqMY+DtQWIbW4+rdKnLKD7LXKzqzi+M3I tJTcfC/vdEjLsWHS3s2Pzb0v5mgXPZuPu+r2g5JEalAdi0dG60ckYBY/ta+ygNkbEp0qzSbEGP 5/Rq5eXecpTzFvxNPuL67nhxd+u8DvLblMaVlXv2AHjFn0ymWPxcroDPTPIr4D7MnBESqP1MQq OoG2HIwZC2Em8G1Vikoyn+UNxxvuu8rGnqqsGqqRyA5UoCbqkaRVd8yWuFbcUhD+qtepWH3tA/ EvXI0qiCyVAoi0DJGTMnUXAl Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:05 -0800 IronPort-SDR: mPJJyq0aBsbsbuh1AqP7rtu1M/g+jB0syfjksUEaZ9/6wOR+FcZFn4rnYgCZA8bFIp43NOiuYQ YJ82RTp67xt5cZQCH9My5pZB+yVc7jID/uzII1wtbdLZKD+zDUGdGETkgIF110VOBAdlESGaPQ 5DnyFLy84m0kkxWvFrlgm7V1YTT03i8m/QdaOgoL4ljd2LviM0/2C/a0FlQhBOTyvkiEKk0mTC AvgCZAL4PA6ZHR9Iwne37nADzLg2S8/99YiyAh7wHcfRcFL+uJx0jyJaMlOqbqjbi3U9j0PXYf /kA= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:46 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 12/23] target/iscsi: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:34 -0800 Message-Id: <20210228055645.22253-13-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- drivers/target/iscsi/iscsi_target_configfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 0fa1d57b26fa..f4a24fa5058e 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -161,14 +161,13 @@ static struct se_tpg_np *lio_target_call_addnptotpg( char *str, *str2, *ip_str, *port_str; struct sockaddr_storage sockaddr = { }; int ret; - char buf[MAX_PORTAL_LEN + 1]; + char buf[MAX_PORTAL_LEN + 1] = { }; if (strlen(name) > MAX_PORTAL_LEN) { pr_err("strlen(name): %d exceeds MAX_PORTAL_LEN: %d\n", (int)strlen(name), MAX_PORTAL_LEN); return ERR_PTR(-EOVERFLOW); } - memset(buf, 0, MAX_PORTAL_LEN + 1); snprintf(buf, MAX_PORTAL_LEN + 1, "%s", name); str = strstr(buf, "["); From patchwork Sun Feb 28 05:56:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8479FC433E0 for ; Sun, 28 Feb 2021 06:00:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C23164E4A for ; Sun, 28 Feb 2021 06:00:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbhB1GAD (ORCPT ); Sun, 28 Feb 2021 01:00:03 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:2570 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhB1GAA (ORCPT ); Sun, 28 Feb 2021 01:00:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492000; x=1646028000; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4N5WSLuQ96Pzt5pgUszKyXKekxaJY3GUfENka9g0hdg=; b=gkyuiDS0m9OQQXCvz+wsZ3sr34kn3YWW263dqjd2ly8Uw99C9kSfSIKK 0/157pDK5Uzl9nOuX26fGo9Xy87QGInSbZjvlIER/rXVSNmVw5MiLsYIh AZ+J1l3huUH+pVE/qWztMG+2OoegtuHB0l0nTOgtA01nX3E0w0s+32J51 Y+YPLewJ0A10v6x5KVbe3dnTfkxU0MseVRw6dj84y/oeyXXtB4uLj4OWo n18MsK8UitepyUL//mCmDvzRubeDnxOMHYLdId8xwu6WZOOn2OdDkvGVA lBNi25eNoGZqFBtoZ1n9qWFBarFDgXF+EN+P7lmly1GBCkyLaAhQ4y6OC g==; IronPort-SDR: nvWrtM774bqnhVdGx5shrf4E/55+vWd1G3HK87SPj8FDaLdjBiLnvLMtvOZVP34hJEAD6xOxfe qiC5p4anJm/pWdo8v9yle4QLyKCKzXsqFictUDh1uOgymn9dwibhYmBMMxOKQSZSJSuNbecF/6 uN7Ikfb8n6hsoqKPxjXDNoVOr1K7QFvg04JgEVwGE+uDvcRvXkrS+Ce4SHAIM8bqzIpovjIrA6 b15BY9MU98W5hNa5Rxpr9QMGKnKVJo8FZ20vW+NWs52BD/aj98KASAbpZULlGG9uzJqMRsYDhB Zi8= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="162152839" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:58:55 +0800 IronPort-SDR: 76UZGPDJYsRi8ta8zoZrJANFoBCSM2GCbvMuENzmKMqIT1SZq/OlAvHNaEr4FRj0vMX0+YCEKI lE/eLbpCuCngY/AmQZOPGPSnYuyObZCNUGJIUgW6cl8R/FxD+1hmFhSObWzVyRXu/6FfexXjCg dJWeETzmnmZAClflMMfyDqbSRaaiYv3xCVhZlzl44x4/FnY958d4kAKTIA9rFXztYzdS5hPuVM mTd5dXHvk3l8aab6zfVDIRVSQD9KH2eIv8luVXB55dLum4R0bXr+qSgi9q2vQKcpOKz/kGxq47 KtmuvhSMq5PK7ojPglRFNiDk Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:13 -0800 IronPort-SDR: 7B1VclN92M6y6WZsDpdSuD1wzGyCrL2JMWKfEm0LOvIJkAilukmcAMPbkueU18APE/Wl8/aSt/ D7FeuF+MAiT3iVG4j0uOmiGPeKw/mGwsrlDDpuagllCrIHh97H0iNNAXgsnb005uwc211EP0dn mlBxP2N4eYpqjnoRe9vlZCwpw2UxhH6wYABLym9LIWF8rPzHn2YVC2YXcfD+q0cuefOfCVug1R DBz6xLTPdRs1IzB5r6maKeYrr2qeQ50l35Ow58sUvdRu57p8PoFu9nCPeeEkZqXgFmgNZ7GNMy xuk= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:58:54 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 13/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:35 -0800 Message-Id: <20210228055645.22253-14-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_configfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index f04352285155..56ea47f5cda9 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -1494,7 +1494,7 @@ static ssize_t target_wwn_vpd_unit_serial_store(struct config_item *item, { struct t10_wwn *t10_wwn = to_t10_wwn(item); struct se_device *dev = t10_wwn->t10_dev; - unsigned char buf[INQUIRY_VPD_SERIAL_LEN]; + unsigned char buf[INQUIRY_VPD_SERIAL_LEN] = { }; /* * If Linux/SCSI subsystem_api_t plugin got a VPD Unit Serial @@ -1536,7 +1536,6 @@ static ssize_t target_wwn_vpd_unit_serial_store(struct config_item *item, * Also, strip any newline added from the userspace * echo $UUID > $TARGET/$HBA/$STORAGE_OBJECT/wwn/vpd_unit_serial */ - memset(buf, 0, INQUIRY_VPD_SERIAL_LEN); snprintf(buf, INQUIRY_VPD_SERIAL_LEN, "%s", page); snprintf(dev->t10_wwn.unit_serial, INQUIRY_VPD_SERIAL_LEN, "%s", strstrip(buf)); From patchwork Sun Feb 28 05:56:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5897AC433E0 for ; Sun, 28 Feb 2021 06:00:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30BA964D5D for ; Sun, 28 Feb 2021 06:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbhB1GAL (ORCPT ); Sun, 28 Feb 2021 01:00:11 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:30790 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhB1GAI (ORCPT ); Sun, 28 Feb 2021 01:00:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492008; x=1646028008; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ffxg5rt34+0W+6X6+LGzDD7EK3QeprcJQQxUrjVzy7E=; b=LdVrm75Iz552jwnvTZv4+LZeaN23lCfgZS49Kp4f5sNUHL3pArb6f0pN Kn5Iu6wyMYBGcBwM9sJ/s0pAmNVQEX1RfTuxoRtYmQ+pvQ18PaA2J8dFY G0yJe+b/Yx/en/P3QsVf206W1BgHJ7oN0DoNu3CRurQ04BGpw2venoHjL reM2XoY2NxBFBkI7u1pLKYHu6g0W/eAItvAuqIexfMUHRDnHQBiLn7nbg OQp96XcqDagzeCpjK7Uhu+cDErvLIJhg8usDgMIxRkG62L2hXlpG3hSri zO8B0uddYcSchhI7HM44IxM0kbb7nMxbyd1E+ramKWO7DrtA/3/6OCGx6 w==; IronPort-SDR: M499dDfj3zTnC94vgio5sYXiOT9f4RhhQ3P5Wk+Pd6H5MxKk1TsgPthPb1Q+CEwj0oWX3dw8Ns DosdUvlOe6mH6oLAElNTH7r3r91DsciHNlQVLu0zIYPg8PQobQl5GTJ3YyOfYXgyY1gBIIpCXR +F2EoPLnMmjCwlvYH5tqCmNdrfANi17Y4LEBAGDDuww1cPC5QillhQiPKSmVHwcCtB8j76ZT09 9107cTDQVGAyQEV5+psgGjKY3sb39EKmMes1puY9qG3JsXBvRLlLxvv11TxU85G0GoIK/4Krkk GZY= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="160972989" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:59:00 +0800 IronPort-SDR: A2M3b2nAMe+Sa/gzZ5xD4yGLc1FvNm6Ay78i+a1Yu+FzUZAh4GYZMkxf1yEzaWY/CzrBWbxAFP OpZ0sDqkaTWldJFJ2DYHKedaRHY+ke1SJR7nQxFLX9bFAC86cY3z78nFUKk+eFemN6pQJgpvnY tEWXcO2/FngcPFd0eZnGbkqwweq6R2pELPh7wcHkgASDRG6oVPuBvdINdMj42vzdvQgG+hhroi 35ksoQJaXn7DUzSz5/OP7m5Mr7Je/RGOg/8/jmSHT4GJtY1W/PHlrnV9Oq/dGr8an2MnJTINle IyeA4py5FCzEIeIqSagZ2EkU Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:19 -0800 IronPort-SDR: ABHSs0K3IQ21uuNGTt0AqIeTiU0cshomPFgiSn7AvLgLPu8Plz1B3DxRkrjwqlnj394/0isRfW Xdku9QkzodfKsmRHRmyiJOgamSxqKu4GmMCjdzl3LLFYug44GQRNajHHlX3Fe9z692PUZkrI6A +2hlgdaHYjYmCTnrsmxpAH8w0F63SheTDuR1PpXWfexSTsaA+6UrMzlRhHH0wAyTmjadls96oB hcVOr3T10q666TAdmeifCd+IfNyY40/Z6EFpGk442i9TDrMo/zJFTA38zVGsuwezf90NO/TPun Cbw= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:00 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 14/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:36 -0800 Message-Id: <20210228055645.22253-15-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- 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 56ea47f5cda9..4c60334a1e9f 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -1555,11 +1555,9 @@ static ssize_t target_wwn_vpd_protocol_identifier_show(struct config_item *item, { struct t10_wwn *t10_wwn = to_t10_wwn(item); struct t10_vpd *vpd; - unsigned char buf[VPD_TMP_BUF_SIZE]; + unsigned char buf[VPD_TMP_BUF_SIZE] = { }; ssize_t len = 0; - memset(buf, 0, VPD_TMP_BUF_SIZE); - spin_lock(&t10_wwn->t10_vpd_lock); list_for_each_entry(vpd, &t10_wwn->t10_vpd_list, vpd_list) { if (!vpd->protocol_identifier_set) From patchwork Sun Feb 28 05:56:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 916EFC433DB for ; Sun, 28 Feb 2021 06:00:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65C8764E4A for ; Sun, 28 Feb 2021 06:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbhB1GA4 (ORCPT ); Sun, 28 Feb 2021 01:00:56 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:30790 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbhB1GAv (ORCPT ); Sun, 28 Feb 2021 01:00:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492050; x=1646028050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tCXTOesn64fsAQikVkAZ/PeVOCP1HPHoYAPxZhx39Vw=; b=kKZI5CLZPStnPOVtbKreQcxuR0u0ecq0vzFEB4ysLv5RAJ8NWxBtlqKP UzZWqASHRLIOJIdn6VY3DU9cqngDsG61A4DzpuaSbS14TYgJx9xgvwqUM sI1Y9DYdrAX0CXk+lY5aMhb5eJapKeXug+yKF/LKJU2j09PyJDDlbeFO0 36CELPzLCboSBQDfJOTddfSCkPxI4mGbhLImKrcH8v2dMgUyXVs05+ZWJ mVtlrC+NWStSN6r++CMo9saWY0HWL5dKUbVG98mxnxmNAtN2qZiBhzNgL fjXYpJJj0Ehl7V+yWbm40MW3ig5qrte2SIfmvTUSeNYXZGlwYq6MJRUbb w==; IronPort-SDR: YjztxMNDfgLOBpO31GV8qMlxErYP8DWIo4gb0igegenSQweY+FO3AzHkYt+V/i/1+KRwl6Wh2V lAP8pRsqbYxdgXeKjXgsIj5VSoykjsRcV440xm6gB1YyxG11AL3JwtKv9inP/76U4VzafiEWDX ypVUUmwyNOE4PpEZOav538Tgo9TZRNhNWlDiAyj2CJJW9qxdwDQxBDS7rJhKWGmeNDAroOGYCN dLjWUBy0qmDt/G2wDzwbTmiX1ANflkl09tVnqtmkqMF+xPNlF5/2NrKulDHe7FFLvfVX+sj6ad 89E= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="160972997" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:59:09 +0800 IronPort-SDR: +LxA4Iq0a6qVmcu1LyEan6GBB/HYWExt9bxCJ4T7YA4TDkADtZr/TTxuQYCL7iC/BIrau1D+FG Bg1Ek2qc946xQ2P4N2Ddt1cOlAJ+0dHy0yrsQvRmO2zduPIHkHkQt3stoit4wswvd8cz0w12rX 84SNxcA2goMmHV3+3fEdrS/tAdXLUWMh0uyEFtosiokYqPO7ydlP8X+ExFrTMCcFsgfqQ3Xcz/ jmWGEeTOycICO8qfJpG9tnGTxCIX47J3jmSfYVZUlOoIqtCNkkURGLO4ktMJdbTDSlbxpa4nF4 A95/TyjRa+kuARSwAG3x0EVe Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:28 -0800 IronPort-SDR: QwYpMdK3VfqdjcuEoXn05nm+JES2/a3sTUkMJApcrOjc/kMTHZatZ0+NjHqiALS9TWcs8yM2ed L4n95lorUa3QC2+ZRYgBft3dZTxsdhNXgtqORhEJDKWemJiTuiEe/O726AfE7tZwAK6OrfPvht 2xI6QIaEfipVTj9sWJxZ0Bx2wKL1swJGO9VgxlgqPZi2UTCcN5VvmHmw50XGr8mtjGwu5mxelp WH+iNZwef+9f4XdG5D6YX8x3V1MvBp5VywV/TLmifDv/8H1OxSDILwXKX319b07/1ANIQFZROz 3eQ= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:09 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 15/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:37 -0800 Message-Id: <20210228055645.22253-16-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_configfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 4c60334a1e9f..315791b5554a 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -2283,7 +2283,7 @@ static ssize_t target_dev_alua_lu_gp_store(struct config_item *item, struct se_hba *hba = dev->se_hba; struct t10_alua_lu_gp *lu_gp = NULL, *lu_gp_new = NULL; struct t10_alua_lu_gp_member *lu_gp_mem; - unsigned char buf[LU_GROUP_NAME_BUF]; + unsigned char buf[LU_GROUP_NAME_BUF] = { }; int move = 0; lu_gp_mem = dev->dev_alua_lu_gp_mem; @@ -2294,7 +2294,6 @@ static ssize_t target_dev_alua_lu_gp_store(struct config_item *item, pr_err("ALUA LU Group Alias too large!\n"); return -EINVAL; } - memset(buf, 0, LU_GROUP_NAME_BUF); memcpy(buf, page, count); /* * Any ALUA logical unit alias besides "NULL" means we will be From patchwork Sun Feb 28 05:56:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CADFC433E0 for ; Sun, 28 Feb 2021 06:00:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E74164E4A for ; Sun, 28 Feb 2021 06:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbhB1GA3 (ORCPT ); Sun, 28 Feb 2021 01:00:29 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:23195 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhB1GAV (ORCPT ); Sun, 28 Feb 2021 01:00:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492021; x=1646028021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=feaqJwNnP7EHgX/qxcCklxVwpQTYvYQWDP0TbE2wIfs=; b=UD1GRdMhTTaEIsrXB7y4wh2ne4n7LATZSbDm/qGuc5r9JQikEKjvothR ylIC9b4xTUD7ppdu/hTXxWjcrbkU/ZEidFZvg0JZsz6LiJRtUO0asKuQR 6BdV+2YCXxshbna6MEv7IARYuFo0y827k8QtPfLnNp9G1f4C0jgD4qgn4 3NIda1TjProGjUNBSxVNbcDTTHQrI5svhoK1UUKkTNAjDDX0OFWMh4c20 iz5NIaGCB3JTezhYkcjWQn1Iq8K4C8TVunpxpHCqiFIo4ZzqadHFp0Y9g L1JT35kwRclM4lSNQ0rYuJb5JQvemRRrVAjs/Ov3pJx7mQ1iw+t+CpClC Q==; IronPort-SDR: AUKOrtjMIyjkP/Wa3LCIKEM4b9Pvf4xGFrPX23Y/1ubnTWegv2ZZfGkNLqE5W+aMqWoNYpyFFd a6xJbbkaUVUVhqxO8ZU/YwoISgOrdvolyEYkPVuA/FnE40aEjdNjC/qFv7pPyAM2vHiL7+SKId GWTJ2ACQcNqciVF2Ng/A7gTLpB90i1211T0Xp9Fbs5X6RTJt1/Ef52tjkcVOehB9tsLvUs0cAX Lb2Eh3+AmV47yYQTZEypqYJE5YciTgJYMTdNvXR8oYX32ewmsh5pIQmQ/hn9afbMOkpD/0ufsQ 4WQ= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564110" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:59:15 +0800 IronPort-SDR: YHtLpvbc+v6eAkNOjfJ0yAT5TzjuDy1dRcfUHl/1yWR/cYaZqUB2rtx6h2/ZP20Dfl9jnEfvrP R2f8gGOxb45/syIJn4EDJuuLJ8xLG4ifDLLZVVuycFg7ctgfmWhXrRDjNrRmOo1ovk2EYR86w/ ieDkKcBJqK/VveONnd7bUoA0kjH4DyQM5ciFGL9WG6XRPlCD8s/nI8kMR/LCAC+aOz/v1ZGj98 p8M5T61yB0MtrSmVXof05hjZuG//nfZkg6PT3lh902BiwozXjbDLCnyoSqX3/d/bVYIZ1UaxGU 7jguONO0uMpZ3MdcJEYhXEcS Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:34 -0800 IronPort-SDR: g5jzM4czVp4/qdlRh1bY5i51iufh5JD1TtqrMfVIGHyLV4npe/6N7vlR0qHfpimmmjwvHkBOZW ji4u1XnjAg0zky5GUL+E/IYCVeLarAtXG98ju5Le/NPmhXwkisT30rCf8EV8RjaieVWZOQILPv 6nAA0l3q3ocAcNl5G3XowVpKLObjAFeMyyHZ2a5nIf2CrQ02jGqgQOCV52nfEsBLfsZ5Pnsif1 kIBi7mUnvIN0C+2dzhMQkE66zYJ8IomOx2uH2U6XqbBLtSO0Pp6ODkzKFdJGbCL5EKikJC9mhO 6Ig= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:15 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 16/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:38 -0800 Message-Id: <20210228055645.22253-17-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- 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 315791b5554a..ca5b083d2958 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -1660,9 +1660,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(struct se_device *dev, { struct se_node_acl *se_nacl; struct t10_pr_registration *pr_reg; - char i_buf[PR_REG_ISID_ID_LEN]; - - memset(i_buf, 0, PR_REG_ISID_ID_LEN); + char i_buf[PR_REG_ISID_ID_LEN] = { }; pr_reg = dev->dev_pr_res_holder; if (!pr_reg) From patchwork Sun Feb 28 05:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A88C433E0 for ; Sun, 28 Feb 2021 06:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EA8864E4A for ; Sun, 28 Feb 2021 06:00:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbhB1GAg (ORCPT ); Sun, 28 Feb 2021 01:00:36 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:18184 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhB1GAd (ORCPT ); Sun, 28 Feb 2021 01:00:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492032; x=1646028032; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+jBH3B9Q6pKVBaot5iX6d5s0M0bipagzFsfwsamEsDc=; b=n9i7yDlz6q6UIG73+8kNHVnH0k0mo00zn7702v/4X7Y6Kf4bRY7y/Kt0 r3mN9fKabp1P1tGQzfbDE9Dvj7FZymyNSyAZA7Gq8PS8DU776BoSFPZO9 Lcrwlumy+qwp8ByV7OigCgQ7HwuMLoXneL6OYVRdVbpLoxJic6poZCg73 lflmeN8/k2DltEV9pYnMkADqjfeVXdeEl6XrYoQpymRpoAsJqRSLWZJQd +uvfH9ZcTJxsTFeOmgQuiFtycKfExDKH0aXCCPqdbofqd7jR3UWlu7SC7 NQ3WN8XlAnjQIJ/QXBLz4jbwOuWhMrzzgxu1lAY0bo6rlVtVpT5y/OZzc g==; IronPort-SDR: fhPe+NGfsvL5Mv5CleOTYciBvNPqedGQrn5hvbmKgBQh5lVCTBD0R3WenIraIRwwn4iwGworfG GFHCKM2zLz3pol/jjn+zgxNe9Ygb13OKwWXxEe/W9YqIjuYAjfAqtXV/qZLDzP0SeZNOc2Fpwx Ty7dYhnvP9JrzVvKul9jLSelTDFNsc4tPXIi2bvOgUubTDrXda0KVgTQwA7I34vX9npoDFf5m/ 0tFpJ2Ym3WyAegfIwFat5vh+aPt90oWHpkUx4/8p/d+Bc60fcHX6Q1VIP2bItUccJkG8VnWjjg GrE= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="165466175" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:59:27 +0800 IronPort-SDR: A77fSMUn9ccD3QB3jTi5SoUpB4zMII5ziS6WVXKYJHHBbbaUHBHs2i0eWzFeuGRxHnf8bTUMUD 6RlOWSWHTIEeh4IFPidexfWxeRJA8stoJ1rD2VSablrJuNTxPwspOUO0Ih2ATHSpD8xb3qVV73 5wt1nbQ4ii2y/kMv9mMv3jJANYXkLay52ZaeEB8i9u+591/SLy/n8dmv39Be3yKX4/RHLruCuM +JzCNngEtMmq9ghHj8t7B3tFVSRHy7YdDdQipZHvQBAi61OE0Pk7JTQht8jsIIN8abNtt4iuF9 Ypv6FZT6qiYKgoH0H/eibFKg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:40:46 -0800 IronPort-SDR: UunuyBAsdL1uuIPhzM9KiEkV8SxB3D4QGxm9ibJ5BzxqqzQmaUl3d5c4y99zb8dte/QBnUrvyJ JBAA+bBu/9rvIUvdBaykVk3u+sGCMnMZVwRBcbCeWt+kqJJ9WbrjqiuCsaHNpCqt2m7zfLCljJ PdNP5CQMr3m+BENPDe8NmTIk2sP4kM400zj0hphqjbD/zcip/519Uk4KdH/0yCx3jbAolRb6i9 U81ST/Wmy51dV6mKKwfBkey8EwGdc+aB23CFF59RUGVJHiT9O9jW7CdQPgTdEyIGyZcdpqI+BS wF4= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:27 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 17/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:39 -0800 Message-Id: <20210228055645.22253-18-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- 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) { From patchwork Sun Feb 28 05:56:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 852E0C433DB for ; Sun, 28 Feb 2021 06:00:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 638FD64E4A for ; Sun, 28 Feb 2021 06:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbhB1GAd (ORCPT ); Sun, 28 Feb 2021 01:00:33 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:34894 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhB1GA3 (ORCPT ); Sun, 28 Feb 2021 01:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492753; x=1646028753; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SwHsfOqG91kLjVw37UarQdw/6ZH3LIQ3j1mjt+uZRbk=; b=CMT8ZoSdKsa5OdwqgrBNYO4Jnrwd2nlgPdkPU//1zNuTizkZYMDDtofH jmS/xO64/a74kY5VQSxUgDS9avsLLkvRrzOGb4HdPt8/UcqSMCBBoBV81 s0vns8CLwcXxcwmaaDSuQKzenhu+YnYfPvb4bFhfbor8yE0PKcV2ZvFEC BQ3wUyZHdFVfBEJ7hft8s+aUeIN4Rdh9/KW3xVus44HKmkA09VY/kZTDP xQnIwICLXHqz22W+nPSpoEFQvq+OEr6OMfdAMu16dNuOFoPIBE6aIXmjU JifoymE14pi5fZEqDOhbeRHuu4kM7gOiuINP2OY8RS6EcPSZsKOy1xOg9 Q==; IronPort-SDR: NYWSrsjH1UNFYIi81sZWI/ZjWyu+5ZRDQXtIzwxmzO3O4oH56GEO2CyA8T0at2VLZ8pjDOeair 4nsuK9yUnsGfvPXuhoU0gLF+/Qjw2zvjmKOxNq50o8Ocx2nXfNxlBw/8HO9TRf1Wh6aQv4ZHjt p+b5DDN+kng1IbAO0rttLEAy7ChRgMmGUEJx7V6b0sYhUC+V6Q2jsTQGZp8d5xkP79ubsdHsZo L60/2YTOZnMbzNyn8htAN88aRH2IKiox8v79rc+XKKdERSekgvtyhQZNjLKg3mw+iuWscL6uiF kz4= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="265236161" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:11:26 +0800 IronPort-SDR: cNNKsrMHh9GjKdozlC596EKftgXv3wNHJm7K82MPl8XqnuWr59BGxXoqB2VtedGwskkORXow4N pIs8I0K9O+ljMHYG3IRTNRgD58aTrEgu57bNXYJpSJvPsFwmq5+f/8RjfG4g7QDh/YlWJYezYO y7+Q+GZt00X8+ihwxWXscu0yT2EIZxdHxMB/bkYZ4xlE+ZjLT5xBSbUVGEANYB7w+lVEAFKh6B otWvXyp43D1wCC7qw/1U/n0xf7jh/SHUa+SaxjfVgNBEw4WyWKYmQv+jOyCln7OYOMqGRhodI8 wWpKNlebkMB6OTEpXi/iovO0 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:42:55 -0800 IronPort-SDR: C/GK5K0aI462st4U0ckjwUZEdLgWnVBk4MnT37Mu25aDzubU06z42e03vt58s2U4JJRJ/xt3rj HG7JWYZwzivMJhsc7jZhxRMtnTZcQuj+pRKuGLcrPcpTzC8QFp+3qFx6fmSbqYjHvmvYh2X35+ +agzrGik2kSTtYcgbu+FaHqBhrbvfsZAAsfgCN/yjMOGP27fBRhifNtR6Rcovsci6VuNAKEcRJ uKgrF7KzxqY+WhoTvzC05vrO23I+9wDt3iZ0NzGBATJISjMfUIwuwpsjhzouyWURt97LzLRAFy tto= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:45 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 18/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:40 -0800 Message-Id: <20210228055645.22253-19-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- 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 0ec9fe1ebade..d6554468ef65 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -3012,9 +3012,7 @@ static ssize_t target_tg_pt_gp_members_show(struct config_item *item, struct t10_alua_tg_pt_gp *tg_pt_gp = to_tg_pt_gp(item); struct se_lun *lun; ssize_t len = 0, cur_len; - unsigned char buf[TG_PT_GROUP_NAME_BUF]; - - memset(buf, 0, TG_PT_GROUP_NAME_BUF); + unsigned char buf[TG_PT_GROUP_NAME_BUF] = { }; spin_lock(&tg_pt_gp->tg_pt_gp_lock); list_for_each_entry(lun, &tg_pt_gp->tg_pt_gp_lun_list, From patchwork Sun Feb 28 05:56:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D965C433E0 for ; Sun, 28 Feb 2021 06:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57D8E64E51 for ; Sun, 28 Feb 2021 06:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbhB1GBZ (ORCPT ); Sun, 28 Feb 2021 01:01:25 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:23239 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhB1GBA (ORCPT ); Sun, 28 Feb 2021 01:01:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492060; x=1646028060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Wng4eyKHQVoNSBh/6v3kyiCfAzNiavkALjRIlkS4Lyo=; b=n0dPjJNCPe6e/CSiUpINUygFbIQyNzaDVCw5Cji+a7Fm4/AumlQDmdc2 6v7zHsnTeKfMlvwS5pVS2M7uDyChtQCiMIMGJF1rXRQbeQMsfx4gIsQKf KehZrqp+UaX6aQmejbPX5wLRar7jvDhTbdGvZPrljTJCZV0EJULoLWkDF kwCQkyo+ZKEi3cQFQH8T0s9rheRWalswT0XlGi9gmqYqCGoWz988MmSx/ 2i/AVxKImjHXD83MGynhLUQ2zWvBgzuPbzK6IejDoGBZCtlTY+P1wsA68 hRGYKbTVr0qwLJNCxyzlmbY+mb6h6uic28AkL/q2u88wEu3fBfhRAwcyM w==; IronPort-SDR: rZ8NYANNBtz47ya8W2EfC3mqe/XwLdLVJGyzxA09Hzy1faDEgkCejUZY5ZGQ2/F8HN3G8Va+l1 uivVaZBq2g1tJWtfMqnNNMuy3na+2irW3IZHFGNk5GXD/xvo7/wsdm7jEu+CP/jTlBHvO/GsER IIezdXBMDX+THSgcfWWVSozyun4YZ+s98mmDSISRIssTu9lAKo1ARUAKczFnTGNxHg/ake3sbT c9thirQrcmAZMBq0KcMBBbamfkwagCsbWdEmY58F61WdGYrQuQIsaag/Xw9GbVgdtUUyw6WPJ6 z9U= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564157" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 13:59:55 +0800 IronPort-SDR: /dzT1vWvnsw8QgFFH2Uzz6cx9tvpXeGTnPRE7bCmWPmwDkT8aeKTkl9Nrbh8t+DtCCSRFs4jF8 HVsz2gTBMkzf5/oQtwYL6+vN1TUxtNUtKv7Yq2ZAwIXIzZaeNgZ5gv3s0U6vqgViyifqkm+pkt ZBg4W/hxBlgB01AQ8THTB3Z8w0cN2asPEVUNcf9Tkid03HxoI03apIQozeDfzPYGqK48mzMQ+q kYaizZNkJrwddJarYlK1xp2h9CBQSBXZCuuglbbiZJwANLvzVXrpKtamEGQMG4bvNHBiAla3Hj quznifBGdsLEDxjd2C8z8rfR Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:13 -0800 IronPort-SDR: nph52jcAk2WvGgXmmuguTs4rozAIt1x1piyNM+/Q76++gzd1dZyXTAGe/oZNCGiawkmf/UhoM0 wIMJ6gzEslwWgdSG8Qfa/CAWtJlCxz046C7k+07zf3h+rCCS8XljsxXOTCqItJJzZgJdNP/9gp xlVCHp0x9tkdRzyhXFlcO2q3JLOaQQ/VnAZMDZUzh28GkCqWtCEtQpFE66afDxFZptaGORgfx8 ujDZkhgq9p88ix0QfhRUQv2MlbPEjnyDekrIxNVPRqQOCHV7R+4J8Zz88henmd6yNfUuN255AD 4Ak= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 21:59:55 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 19/23] target/configfs: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:41 -0800 Message-Id: <20210228055645.22253-20-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_configfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index d6554468ef65..9cb1ca8421c8 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -3399,11 +3399,10 @@ static struct config_group *target_core_call_addhbatotarget( { char *se_plugin_str, *str, *str2; struct se_hba *hba; - char buf[TARGET_CORE_NAME_MAX_LEN]; + char buf[TARGET_CORE_NAME_MAX_LEN] = { }; unsigned long plugin_dep_id = 0; int ret; - memset(buf, 0, TARGET_CORE_NAME_MAX_LEN); if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) { pr_err("Passed *name strlen(): %d exceeds" " TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name), From patchwork Sun Feb 28 05:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08C6BC433E6 for ; Sun, 28 Feb 2021 06:00:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D719564E4A for ; Sun, 28 Feb 2021 06:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbhB1GA6 (ORCPT ); Sun, 28 Feb 2021 01:00:58 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:6288 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhB1GAw (ORCPT ); Sun, 28 Feb 2021 01:00:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492051; x=1646028051; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8uB//Kn2n+THYymqLSeHI1vUIKf7/S2S7TxLp17BUvk=; b=qpjPCktad55M1erVe0BC7S1hTYVUk8UTAUtljLJD6eZbfsUxGffdDgQJ ks3kt23CZuTmV8TskwfSgjK00OIXTnS3c6z1hgZ+R3YcW9ImGMPxtqSGH p8Z0qVEeMLt/3ASdSAICHVE6yZqZ6JTrn648BBneylg+sCMQaSIjBXAiM QJtyyPerlWpi84thN0uikuDwuM9BqotHxXwQnO6sb9hpuX7iECCu/5MRM GXWJMY2YoQjtA3+FC+jZoDP8npMsjsThjygQAOz+V5UDC9zwutuh0MzEx Run11/4WsjcHRMwd9y+6hm92avWL+cpA0yNw5ZN6QYAe41tZImZx+bbnJ g==; IronPort-SDR: 6s/GT+EFR0Uermz3L7u3wM03RFGHJQ6hsOsbNOglKwPbu/Iyl35RedzBYh6jgF9aRDfLgNNrMG kJdg18v0oOHCwo+AmDDgDLOxu0gBkp7jmTZMceZTicZZkCrf6XMf1iszk0hf71u6kH0XZNhFLW gCSRc8wvhO/1lu+US+5Kzzh784iWFDg8jI9wO8w/IqJHoAjYu1IRycOb/cSiKRrlbDJ/b+FNMc 5snFEuCGVoTn6B5vIb+Q4pYemotBnsRewo9MXBQd6A8mIji3yhN1jp2MW6bEbe2VJSpowsbJf1 YtQ= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="165466212" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:00:04 +0800 IronPort-SDR: Zw7xtLchFkOKT7a5slKcemJqn+0UdxOPiPLPbdnCk04hiQcSi9ivO1WbVfYqv9atHO9KzYq/3f YgEMsFcA7WyB3Ek/UaCbEbeT206n0mJzGSlJULFJEkdb+fvaVgFmChE6y6rAL60SRTJASEhqo1 rd6duQ+1MIntmWGKywOmXGQwzjGcC2WlcfOTONqQ3nJoMy3+NZjGbRB2J4gpGGYk4ihDi3Qi8Q myOOmzLd+Vt4quYi/nrvL0ONtncsBjwwC/lN2KwRP6qGW0L56zUUg61iexj3D/f1lceEKpnPph Bq8EO7T2ryXWChRlcgRVb4O9 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:43:14 -0800 IronPort-SDR: BYpPm5xe0UNSKGBamMTRvAZ4BX2ix+q/W3TJ+sQFkm0uYp6aoG2KHL24p0Ql5nf2Z+z+nwrNCE +rS00+pGeBTBQ0BAgD7+EjJAAMfuKM9+W1Il8LwNgZrBXPjcgrqV92KBKoLQ3dL8a+avgsDbNJ WRUgHBirrzjH6Of87A2XJwZfcVP3s4//6bVk/AAc1GQhHXQJvCXiZJiLDPGZSaQGMgX/Bk0Okd 1AROBTNiV3PRinsdFOrMmIA6BgYCZ2zq6ol9ew9UH0LJ7VIIlOH04hXZWi8yAMi1zVPbT/JfWy J+E= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 22:00:04 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 20/23] target/pr: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:42 -0800 Message-Id: <20210228055645.22253-21-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_pr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 14db5e568f22..942b93d12295 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -928,12 +928,10 @@ static int __core_scsi3_check_aptpl_registration( { struct t10_pr_registration *pr_reg, *pr_reg_tmp; struct t10_reservation *pr_tmpl = &dev->t10_pr; - unsigned char i_port[PR_APTPL_MAX_IPORT_LEN]; - unsigned char t_port[PR_APTPL_MAX_TPORT_LEN]; + unsigned char i_port[PR_APTPL_MAX_IPORT_LEN] = { }; + unsigned char t_port[PR_APTPL_MAX_TPORT_LEN] = { }; u16 tpgt; - memset(i_port, 0, PR_APTPL_MAX_IPORT_LEN); - memset(t_port, 0, PR_APTPL_MAX_TPORT_LEN); /* * Copy Initiator Port information from struct se_node_acl */ From patchwork Sun Feb 28 05:56:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAEE7C433DB for ; Sun, 28 Feb 2021 06:01:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A276064E0F for ; Sun, 28 Feb 2021 06:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbhB1GB0 (ORCPT ); Sun, 28 Feb 2021 01:01:26 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:23195 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbhB1GBJ (ORCPT ); Sun, 28 Feb 2021 01:01:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492068; x=1646028068; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mDfhgYvCsUBpfe6h7Sy6Z6rwnG2TX7oz1s2rwqccbKk=; b=jhN+cYt64+1BfHU73uj7SiOYqZmSQ4+Y6nk7VM9FG3ql3WiJ19N9+vvW vvzjZyhZLXf1YZLCwKSWBd+2scxHAuApo3OSsWAFgfX3+mmR1Eaq/taR8 A60ZJbf+qSIp+hgHZsvwZqV5NpNL+dvCt9RBh50J2UFGwjJ8HSVIWehuh 5O1DTHZibwKCulfKN06zRfush0xcFUoKVVXLspPBPaHzauZTwJ7dd8D5U RHMj5CVj4dovyKN5k3/Rr7HNVukBv8uATG41DkSC4GnGA7WQ5qx4CvTyR HeJMl2tQ6qkqDuahlg/ZQS8KnYnR4IVF1dLDpZsKTyoCiff6/NaYQXluT w==; IronPort-SDR: sQ0H+IS+BljVkEG9SxBpGoh2fClbhI/wg86WX3Bbg56egah233Y+uTW5y5cbAetIWFv4U8zNTa O3VFmmD7Rinhga2M9GZLx84AvVAA5/DcWzgRf5n03hlFMjy3pFU/THZYWRKbilBuFVST3Ff0hU QJiinLbGng9JtzFckRHhXvli1HfDQ/RIZcpcSyb2CxEUFYYx0rwfXu7LdaDVYlmqfGB9zx5rM5 lXdx1DUL/+Kw4ZkrXDaROdN9u6QYfvHE88DdhIR21by3+Qg/tG7KFpgE+uO1idFRk9FXRQ2Ibb 0NU= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564180" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:00:14 +0800 IronPort-SDR: lp0ihUvwsgRbyJ/C7XrVDxyCNOR7V4cbzJjO02OsHM7WxLLJIhcOjkqsBQSlWcEHCJoQb31nPW 6oXkwu0YB42g2Yll4lC/PIzrsOr5ThiVcYWRScHizOK0QAbh1CEZjQb6sUYnX7YoVR5k0zYrm6 xQyVgXIUFJmU2yDLtMf/zNiLklqylqX3WB89xEH9Vzx9FYOM7Bp9O9Px4Ehl1zUvpwogY6kFQO 1HUiLi9WtAIgS7uzEV8MIjVbmMe7+saT9796WG5drBrMDtCNraPQnlZCn1CsDhWF039kLHsI65 PdDQ92UkZbkU10rgA4Ks3onk Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:43:24 -0800 IronPort-SDR: JXkKii/dA5B9Bd0EKSrhcb0usHXMbjDb9796XCctEJk9xgtHLlF10iCOa1MuNtLwJm7mcWCCIc JJZStGnIiwUeQe3pKMpeFtgXOvJuCnRLKG3m8y9jpBSaLRhKIVGaYG8Zp2IFwKX4M33bcxLufs Ss0l3iTvxJilx695aTBEDYdd+jXEllrWkoas/25dxe7oX4mHGzSKnrtPwAUtN5uykzoRwo5Ap/ t9yx2NxVZc2bmNveEkLyRLKGz3Gb4IzOLmwLgRQHoCgRqe3TVnmcr97dhWwlWNLbWY+hrjhMYI wlI= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 22:00:14 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 21/23] target/pr: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:43 -0800 Message-Id: <20210228055645.22253-22-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- 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]; From patchwork Sun Feb 28 05:56:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3832CC433E9 for ; Sun, 28 Feb 2021 06:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 115CE64E4A for ; Sun, 28 Feb 2021 06:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbhB1GB1 (ORCPT ); Sun, 28 Feb 2021 01:01:27 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:23274 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhB1GBU (ORCPT ); Sun, 28 Feb 2021 01:01:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492079; x=1646028079; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q9fOr4vcTb78Z/6ksHocIr7ake9JHd9N3cFm8gyqUu4=; b=dPe2W5vwMGJjSzmCts4RIeBo/M9ifhb12DQ6FdbCflS9l9gQTqcqP44c 7gKNHZxQ1hWG4IjPRnXuqT4IxyrQ+pfO0vqMyvjfNZ14KggMVxVMxf/+4 odVZ0IAiguUeGkTqfo8sYqHUG32XUDwoQCB+lGC9Z7h2v2UNyBBGJCFrh e9FYpsIfTr2v+U7yh+1wM6jucXnh2u8G8ZefhLFSwZRsJpHEq4xNQes1I WaN2g0QX28hVP9B46eKi/FUal5xc9QrmPBh51ZpZISYrm0SxcCr0EOQ7V s0neP8YIoHfSDckcMjq5nHWnErTrtq5H8waVkZKGthe3OvcHAqygpgfZ6 w==; IronPort-SDR: LNrOIzGWEW+1dbf/1i0CQ8sEeebwG1MDAMtHylf1fYoMACgaOZ3uP4mC8RXBJ41Gx7Fb1U17nc Z11q6YQToDIxxUO+icx5udnnA0fgWc4D00SJEbeRxQn5yY2XSehQlGn1gSwF9H5Ljtm1rZB3lP 3476Sh83W/v7wDVVvzvLt7WSc2ayktVzgi2EIBCg5TbsIW5U8keBpMweDVZFY2lEK98kE0EdxQ u9mexBFcoOiH3nIefZqTQJ37JGQlFavh/AcfJ516d8EFx2vdsqmENaa4D9KNI5z/GmXNUFbyra VPU= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="271564194" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:00:24 +0800 IronPort-SDR: jlLyEmQ7MnWpCp5cidiOJ+Z5eJeyyhaUdYaqMITKmypsZkj0EFYHy+lzo2za13fo52D8t45Dsz i4wimf31SHMPkNFltd+dArckltMXORgYYVsBtc2vvqn0JD+kLnkZdIOtF1RSkeSrljFB9dFBO2 wUrFJeB5V53Yd5enTDXuNlRKoyMfFpaKrfAZhaRpwB0RerJuOrp0HdPupWIM0Tll7SH5NoY7b5 uB9yd3Feu/BUGUZJ7qRF/8rs7eET6gBo4mHdSSBwA72f2rnW8NL4kGevnL84yJxxIsDcbcxDPA f5q6tdeT2FgBOgNGRUQhqlN2 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:42 -0800 IronPort-SDR: puhgLlV5fXGevrQevSzsIkCuOGC5HZ5Xel723RCpoFHGFrFKa0hPtT6yxzKueGRYKu3ZZtxc36 kN5eKqnZGb0ImNyDECEwe02lC90kItqjVIL6HGn1Pu5gVa5v97cY0+o6l4J/o0Uxp8/Tib18QF phpY7RPzu7OYy0QoorpegXpgpVGRnEAf5UvyBS9mk6+e1TS8j63egfwTXo3WBGnbUnky//wyBT SGaQtH7odmZ27DM/f7RYCdzK7FMmDaIOU7JP00iD7NzGtfknz+1TKjTSRWnw0yik3TQAggPJww QOA= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 22:00:24 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 22/23] target/pr: remove the memset with declare-init Date: Sat, 27 Feb 2021 21:56:44 -0800 Message-Id: <20210228055645.22253-23-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org 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 Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_pr.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 3644d2642929..894cda06261c 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -896,9 +896,8 @@ static void core_scsi3_aptpl_reserve( struct se_node_acl *node_acl, struct t10_pr_registration *pr_reg) { - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; - memset(i_buf, 0, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); spin_lock(&dev->dev_reservation_lock); @@ -1021,9 +1020,8 @@ static void __core_scsi3_dump_registration( enum register_type register_type) { struct se_portal_group *se_tpg = nacl->se_tpg; - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; - memset(&i_buf[0], 0, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); pr_debug("SPC-3 PR [%s] Service Action: REGISTER%s Initiator" @@ -1283,11 +1281,10 @@ static void __core_scsi3_free_registration( struct t10_reservation *pr_tmpl = &dev->t10_pr; struct se_node_acl *nacl = pr_reg->pr_reg_nacl; struct se_dev_entry *deve; - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; lockdep_assert_held(&pr_tmpl->registration_lock); - memset(i_buf, 0, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); if (!list_empty(&pr_reg->pr_reg_list)) @@ -2057,7 +2054,8 @@ core_scsi3_emulate_pro_register(struct se_cmd *cmd, u64 res_key, u64 sa_res_key, struct se_portal_group *se_tpg; struct t10_pr_registration *pr_reg, *pr_reg_p, *pr_reg_tmp; struct t10_reservation *pr_tmpl = &dev->t10_pr; - unsigned char isid_buf[PR_REG_ISID_LEN], *isid_ptr = NULL; + unsigned char isid_buf[PR_REG_ISID_LEN] = { }; + unsigned char *isid_ptr = NULL; sense_reason_t ret = TCM_NO_SENSE; int pr_holder = 0, type; @@ -2068,7 +2066,6 @@ core_scsi3_emulate_pro_register(struct se_cmd *cmd, u64 res_key, u64 sa_res_key, se_tpg = se_sess->se_tpg; if (se_tpg->se_tpg_tfo->sess_get_initiator_sid) { - memset(&isid_buf[0], 0, PR_REG_ISID_LEN); se_tpg->se_tpg_tfo->sess_get_initiator_sid(se_sess, &isid_buf[0], PR_REG_ISID_LEN); isid_ptr = &isid_buf[0]; @@ -2280,11 +2277,9 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key) struct se_lun *se_lun = cmd->se_lun; struct t10_pr_registration *pr_reg, *pr_res_holder; struct t10_reservation *pr_tmpl = &dev->t10_pr; - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; sense_reason_t ret; - memset(i_buf, 0, PR_REG_ISID_ID_LEN); - if (!se_sess || !se_lun) { pr_err("SPC-3 PR: se_sess || struct se_lun is NULL!\n"); return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; @@ -2455,12 +2450,11 @@ static void __core_scsi3_complete_pro_release( int unreg) { const struct target_core_fabric_ops *tfo = se_nacl->se_tpg->se_tpg_tfo; - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; int pr_res_type = 0, pr_res_scope = 0; lockdep_assert_held(&dev->dev_reservation_lock); - memset(i_buf, 0, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); /* * Go ahead and release the current PR reservation holder. @@ -2766,11 +2760,10 @@ static void __core_scsi3_complete_pro_preempt( { struct se_node_acl *nacl = pr_reg->pr_reg_nacl; const struct target_core_fabric_ops *tfo = nacl->se_tpg->se_tpg_tfo; - char i_buf[PR_REG_ISID_ID_LEN]; + char i_buf[PR_REG_ISID_ID_LEN] = { }; lockdep_assert_held(&dev->dev_reservation_lock); - memset(i_buf, 0, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); /* * Do an implicit RELEASE of the existing reservation. @@ -3156,7 +3149,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, struct t10_reservation *pr_tmpl = &dev->t10_pr; unsigned char *buf; const unsigned char *initiator_str; - char *iport_ptr = NULL, i_buf[PR_REG_ISID_ID_LEN]; + char *iport_ptr = NULL, i_buf[PR_REG_ISID_ID_LEN] = { }; u32 tid_len, tmp_tid_len; int new_reg = 0, type, scope, matching_iname; sense_reason_t ret; @@ -3168,7 +3161,6 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; } - memset(i_buf, 0, PR_REG_ISID_ID_LEN); se_tpg = se_sess->se_tpg; tf_ops = se_tpg->se_tpg_tfo; /* From patchwork Sun Feb 28 05:56:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12108111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B711C433DB for ; Sun, 28 Feb 2021 06:01:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F253464E0F for ; Sun, 28 Feb 2021 06:01:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbhB1GBp (ORCPT ); Sun, 28 Feb 2021 01:01:45 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:30790 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhB1GBg (ORCPT ); Sun, 28 Feb 2021 01:01:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1614492095; x=1646028095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xtQnv3V07SWR9jK26U/cYEcspOo5BaukAClUamTYQao=; b=h9tLIlrhalIjxcqQ/Si/wxiUc2aBclpuoOlNiTVp5M2QqUpftN94JuoT wZCCmOL1kxlVlTwAArj4EkSl43dEEZHIQ1dzOq6scy4lBHke/FBecY7fl cUm6RbyjyrrieO1Ib7zfixysrb3xm1HQ9e1Zf0yWE/tkAuuVW4pzhTelD bqDziA4NXbiEJnPU8zCOqQIIfQbgYB8YKL1qbiDG/ohcJjiFjRELZCCvo 1IMcqV4Oi9ystV0He+PTTk8FKvPIWppdaVtvWYFhi+tVaqeJQXS4GkUH+ cO1ANhldzAOMC3XlMNILO2rOil8Fw3yF9orudkaU3ratGbvvLIeFJcTQD A==; IronPort-SDR: tOUScKfnEW/ZZ6LlKdvuoYfKu2X1UP8359z9PCcAu7g47BOnZuap+BjZ7KnVHqstmOzSSDOz/L K6wO739GNLRJBdPL2d8wSv9Zfdcr6mgSltqkrd1itvYwZLUSo1kF64t+MG8sODYLdq2vbENpWi F1y17AmB4NMFYa+k9BH9VaBCNY/Hzqiehp53KXZglivQet2GkGzEHSknhSB+mKqihJ9oLuSIC+ NqOVxqrDfF9fJREyAxbEg3ZIQWAy9TWxCfXrX2DK3ZSk87JwBb0WwHi8544TMYIEEJa0WtNmd2 314= X-IronPort-AV: E=Sophos;i="5.81,211,1610380800"; d="scan'208";a="160973086" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2021 14:00:33 +0800 IronPort-SDR: goUMcAYGdcCq3YsdCLKX02O2KC1L5A0c6nhC4q58lTehz463wcbGTmKNTa8OwfX53iDP7/LXbE dk3uTTAmv9TfHOMEebAY/KW6Gjl1ViZEBKkJDlpxgPcI7L8AVTsq8Rh/9cMk7Sbk4QIZPXGbbb Wz0+84HxK5Fm+NX0HSTgXGR2WKLVaWleGqDcrIJy//JHtfpR4DWvKL5R0CWvGvAHpsch8290pp dy7JyisJjTMBbKZlctBdumoPtrOHnCRM49Dht3REWv84YwOobmxRczjB4rlBxxPZbTy0TrCJlu C0NMz+YBvAXddsvAqEOeVGDF Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2021 21:41:51 -0800 IronPort-SDR: JamS46YIsxrQudnalu4I0e/yXjsSucaG7mpJCvZac3RrtXAbFDsxx/ZelHF/QOQNQh19HR62J6 v6kmcQsgMPkD7h2Hz7q5gSWyo8Awo2jIwlkveDQ1R6EfV4DikySY9yCqK5YvwVpjxIXILrPE2b gw4o9fT/Xs+O35ESZDGEYzaXetC0ewQqIoRxIGJ0xU2Iu5f6hkabMlfGQGzqk5QizrXu7RrcVg +UOXJqqscQ9vDpAoKnwzE5vZfm+BCP7Cnmg5HJoAyZFn0Dw+9A1tmhxWX1xRK+kU+mXlYTUfE0 Egk= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Feb 2021 22:00:33 -0800 From: Chaitanya Kulkarni 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 Subject: [PATCH 23/23] target/core: don't duplicate memset 0xff Date: Sat, 27 Feb 2021 21:56:45 -0800 Message-Id: <20210228055645.22253-24-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1.dirty In-Reply-To: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> References: <20210228055645.22253-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org The function fd_do_prot_fill() is called from two callers fd_do_prot_unmap() and fd_format_prot(). Both the callers initialize the passed buffer with memset to 0xff with its length. Instead of duplicating the memset call, move the memset call to the fd_do_prot_fill(). Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/target/target_core_file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 5a66854def95..ef4a8e189fba 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -498,6 +498,7 @@ fd_do_prot_fill(struct se_device *se_dev, sector_t lba, sector_t nolb, prot_length = nolb * se_dev->prot_length; + memset(buf, 0xff, bufsize); for (prot = 0; prot < prot_length;) { sector_t len = min_t(sector_t, bufsize, prot_length - prot); ssize_t ret = kernel_write(prot_fd, buf, len, &pos); @@ -523,7 +524,6 @@ fd_do_prot_unmap(struct se_cmd *cmd, sector_t lba, sector_t nolb) pr_err("Unable to allocate FILEIO prot buf\n"); return -ENOMEM; } - memset(buf, 0xff, PAGE_SIZE); rc = fd_do_prot_fill(cmd->se_dev, lba, nolb, buf, PAGE_SIZE); @@ -882,7 +882,6 @@ static int fd_format_prot(struct se_device *dev) (unsigned long long)(dev->transport->get_blocks(dev) + 1) * dev->prot_length); - memset(buf, 0xff, unit_size); ret = fd_do_prot_fill(dev, 0, dev->transport->get_blocks(dev) + 1, buf, unit_size); vfree(buf);