From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbcAMQjZ (ORCPT ); Wed, 13 Jan 2016 11:39:25 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38318 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbcAMQjY (ORCPT ); Wed, 13 Jan 2016 11:39:24 -0500 Subject: Re: [PATCH-v2 2/4] ib_srpt: Convert acl lookup to modern get_initiator_node_acl usage To: Bart Van Assche , "Nicholas A. Bellinger" , target-devel References: <1452457724-10629-1-git-send-email-nab@daterainc.com> <1452457724-10629-3-git-send-email-nab@daterainc.com> <56941FF6.5090003@sandisk.com> Cc: linux-scsi , lkml , Sagi Grimberg , Christoph Hellwig , Hannes Reinecke , Andy Grover , Vasu Dev , Vu Pham , Nicholas Bellinger From: Sagi Grimberg Message-ID: <56967DB8.5000401@dev.mellanox.co.il> Date: Wed, 13 Jan 2016 18:39:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56941FF6.5090003@sandisk.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > The "goto try_again" statement is executed at most once. Since the above loop > can be unfolded with only a very minor code duplication I think it should > be unfolded, e.g. as follows: > > se_acl = core_tpg_get_initiator_node_acl(&sport->port_tpg_1, ch->sess_name); > if (!se_acl) > se_acl = core_tpg_get_initiator_node_acl(&sport->port_tpg_1, ch->sess_name + strlen("0x")); > if (!se_acl) { > pr_info("Rejected login because no ACL has been" > " configured yet for initiator %s.\n", > ch->sess_name); > [ ... ] > } > I tend to agree, and it would be a bit cleaner to hide this behind srpt_get_initiator_node_acl wrapper.