From patchwork Thu Apr 4 19:44:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10886161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 089B018E8 for ; Thu, 4 Apr 2019 19:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC08E285C7 for ; Thu, 4 Apr 2019 19:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E035028684; Thu, 4 Apr 2019 19:45:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E2A2D285C7 for ; Thu, 4 Apr 2019 19:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730380AbfDDTpC (ORCPT ); Thu, 4 Apr 2019 15:45:02 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46376 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfDDTo7 (ORCPT ); Thu, 4 Apr 2019 15:44:59 -0400 Received: by mail-pf1-f193.google.com with SMTP id 9so1852188pfj.13 for ; Thu, 04 Apr 2019 12:44:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=snOtwTqx9ijqKGK9LVtqRBG2NZWgKNSoP0Xpeb9Z3yk=; b=mDIF97CdjrwMt5pFh3ANX45oCM9xD3tdqvUfph271OPn6bq4kfEW/G15eLZrD1iC9Z w68iz1afOegE3ZKahzvLyLygedol79jEZoJodOrBBVmBRHildrsq3aupAEiksPY4jtwi sg20OVLLAwg9uw2mnF+8e/yoe7CD7ABaDPO9TMXBbDYmcymcmkN51bKKUxKqGyHeUfII JPzmtLMC4gaB5C9w8Ja2PBSGmjLHCUgmX+vMiBgXuTjI1+m1xhdbq70NX4jWPweysc7m yma+UJrFNpxg7JE+f8jZj2Y194eaz54UsBjCrtEJOOoBK617EWsTr3xrjoum9cLD8jmE p/tA== X-Gm-Message-State: APjAAAU7bxX8/cpPV4krUUfjE1zrFJoeiOXZFmZkja+YZQK98iTOwhe9 n+KEb4kgmoaidEPN5DL+A2k= X-Google-Smtp-Source: APXvYqx4fJkyZoNpBXeJ+LdwVoC5ewJcCr5AyXrRcc/nA5LiSMtls0eiLYLpKF+dM0qp4//NaKlu6g== X-Received: by 2002:a63:2b4c:: with SMTP id r73mr7864599pgr.181.1554407098956; Thu, 04 Apr 2019 12:44:58 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id g4sm29404285pfo.38.2019.04.04.12.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 12:44:58 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Himanshu Madhani , Giridhar Malavali Subject: [PATCH 02/11] qla2xxx: Change a stack variable into a static const variable Date: Thu, 4 Apr 2019 12:44:39 -0700 Message-Id: <20190404194448.121489-3-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190404194448.121489-1-bvanassche@acm.org> References: <20190404194448.121489-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make qla2x00_get_host_fabric_name() slightly faster by changing a stack array into a static array. Declare that array const now that the wwn_to_u64() argument pointer has been declared const. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index da64fe54f59e..b8706ed3ae1d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2723,8 +2723,9 @@ static void qla2x00_get_host_fabric_name(struct Scsi_Host *shost) { scsi_qla_host_t *vha = shost_priv(shost); - uint8_t node_name[WWN_SIZE] = { 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF}; + static const uint8_t node_name[WWN_SIZE] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }; u64 fabric_name = wwn_to_u64(node_name); if (vha->device_flags & SWITCH_FOUND)