From patchwork Tue May 18 12:41:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12264757 X-Patchwork-Delegate: jgg@ziepe.ca 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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 59B00C433ED for ; Tue, 18 May 2021 12:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39D0D611CE for ; Tue, 18 May 2021 12:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349289AbhERMmN (ORCPT ); Tue, 18 May 2021 08:42:13 -0400 Received: from mga18.intel.com ([134.134.136.126]:53511 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349285AbhERMmN (ORCPT ); Tue, 18 May 2021 08:42:13 -0400 IronPort-SDR: 4FAgMFK7rHv8c1Xxo2/7SUW9dfcyCTXPaV7rRXYpUwjF5mrqQneW3VEYZ/QbVIiLVrDAGQf9zB 5sD/IbntMhbw== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="188109671" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="188109671" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 05:40:54 -0700 IronPort-SDR: sgggo7ok56IsqNjKGpzCvHMUBi/XmWmxVBdqawlmROTrG0Hvs0QHaEvwXDv+HgO2oh5jBlGM7P zk+xuEcfUn+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="544093527" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 18 May 2021 05:40:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5526312F; Tue, 18 May 2021 15:41:14 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe Subject: [PATCH v1 1/1] infiniband: hf1: Use string_upper() instead of open coded variant Date: Tue, 18 May 2021 15:41:11 +0300 Message-Id: <20210518124111.20030-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Use string_upper() from string helper module instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/infiniband/hw/hfi1/efivar.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/efivar.c b/drivers/infiniband/hw/hfi1/efivar.c index c22ab7b5163b..197cbd620662 100644 --- a/drivers/infiniband/hw/hfi1/efivar.c +++ b/drivers/infiniband/hw/hfi1/efivar.c @@ -45,7 +45,8 @@ * */ -#include +#include + #include "efivar.h" /* GUID for HFI1 variables in EFI */ @@ -154,7 +155,6 @@ int read_hfi1_efi_var(struct hfi1_devdata *dd, const char *kind, char prefix_name[64]; char name[64]; int result; - int i; /* create a common prefix */ snprintf(prefix_name, sizeof(prefix_name), "%04x:%02x:%02x.%x", @@ -170,10 +170,7 @@ int read_hfi1_efi_var(struct hfi1_devdata *dd, const char *kind, * variable. */ if (result) { - /* Converting to uppercase */ - for (i = 0; prefix_name[i]; i++) - if (isalpha(prefix_name[i])) - prefix_name[i] = toupper(prefix_name[i]); + string_upper(prefix_name, prefix_name); snprintf(name, sizeof(name), "%s-%s", prefix_name, kind); result = read_efi_var(name, size, return_data); }