From patchwork Thu Mar 1 22:26:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10252739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DFD760365 for ; Thu, 1 Mar 2018 22:26:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F02727816 for ; Thu, 1 Mar 2018 22:26:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33ACB286A9; Thu, 1 Mar 2018 22:26:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B41B027816 for ; Thu, 1 Mar 2018 22:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162534AbeCAW0g (ORCPT ); Thu, 1 Mar 2018 17:26:36 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41196 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162537AbeCAW0e (ORCPT ); Thu, 1 Mar 2018 17:26:34 -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=1519943194; x=1551479194; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9qtmiwoXv9FvqBVT4X59slK/xJX3jedjYvJkKEe7sVQ=; b=Q6fKu3YOjDvoYi5oJ4JYKbbUZWBz7VaIKIUHtK7ItPDzfYZfF7K/Zrn3 Sup6/nZS8Zbe6ZFzS0ZnRpBc0I8Bk7/U64REcZCiD1nYvh8z8B1aD4SVs P/hPiXHHrs7cPwn9WNcK2SBosZjy3FhCWb6/yWI8q9jO9pPMhRSFP/9sV EQGoulTn9otQk/s2EynZAy9kVaL3X0jum6/EaV270LrzLICB6aqmmoPSi GYKCc1FCc/VJ6Yw3tI5vmt5jUF9H3vtiJbtLdfDJDRkx8pAn7LLp2TArb 0T2q/9N6XnR//5dU7yWVFjDa1947y/DJURTs2AA1ZI7qrzzg0urocWKae g==; X-IronPort-AV: E=Sophos;i="5.47,409,1515427200"; d="scan'208";a="72564588" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Mar 2018 06:26:33 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 01 Mar 2018 14:20:37 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Mar 2018 14:26:33 -0800 From: Bart Van Assche To: Nicholas Bellinger Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Mike Christie Subject: [PATCH 02/14] target: Use config_item_name() instead of open-coding it Date: Thu, 1 Mar 2018 14:26:20 -0800 Message-Id: <20180301222632.31507-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180301222632.31507-1-bart.vanassche@wdc.com> References: <20180301222632.31507-1-bart.vanassche@wdc.com> Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some target code uses config_item_name() while other code accesses .ci_name directly. Make the target code consistent by switching to config_item_name(). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Mike Christie --- drivers/target/target_core_configfs.c | 4 ++-- drivers/target/target_core_sbc.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 3f4bf126eed0..5e712112f513 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -261,8 +261,8 @@ static struct config_group *target_core_register_fabric( &tf->tf_discovery_cit); configfs_add_default_group(&tf->tf_disc_group, &tf->tf_group); - pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric:" - " %s\n", tf->tf_group.cg_item.ci_name); + pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric: %s\n", + config_item_name(&tf->tf_group.cg_item)); return &tf->tf_group; } diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index b054682e974f..ebac2b49b9c6 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -978,9 +978,10 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) } case COMPARE_AND_WRITE: if (!dev->dev_attrib.emulate_caw) { - pr_err_ratelimited("se_device %s/%s (vpd_unit_serial %s) reject" - " COMPARE_AND_WRITE\n", dev->se_hba->backend->ops->name, - dev->dev_group.cg_item.ci_name, dev->t10_wwn.unit_serial); + pr_err_ratelimited("se_device %s/%s (vpd_unit_serial %s) reject COMPARE_AND_WRITE\n", + dev->se_hba->backend->ops->name, + config_item_name(&dev->dev_group.cg_item), + dev->t10_wwn.unit_serial); return TCM_UNSUPPORTED_SCSI_OPCODE; } sectors = cdb[13];