From patchwork Thu Jun 4 20:01:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1303712 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=konsulko.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49dGrd4GNPz9sSF for ; Fri, 5 Jun 2020 06:01:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D794F819A6; Thu, 4 Jun 2020 22:01:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B58A6819A6; Thu, 4 Jun 2020 22:01:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2583881C91 for ; Thu, 4 Jun 2020 22:01:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qv1-f68.google.com with SMTP id y9so3577600qvs.4 for ; Thu, 04 Jun 2020 13:01:46 -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; bh=luqzfsAvk7PymRdhGv86q5Q/3UrWy2O9Kzij4bpgGqA=; b=NcWFkFW30+q6MxeyJNzZCFx2ycfXXFsCZqp1v1zAQw25bLPuFGmQ3NMW6IvOO7UjEb XQ7CUCvRinrBW2DbIbeSlSuS1NcFTDJGGrS+mLF+P9LdvePqCYCc/oD/hFVAcOd0eSST 7B3lkjOZ2Qc0G/Kn6GYug/O+xYO/sMQB9V2DQlOY2pElqenQ152lYXzXNSe2i0te93s3 kf9B2Rj0VJVBiyqf0hzxuPvF9gjrkee5Urg+M25AujbuJmS1voKyDrWAvJZtHozeD/cZ zYX6dsSTPUDIwlPHSyFwfR63hiAsTGz0dtaxgtP0B3IPSkmn+5RPeFo8/Yf8puQRSDpv 4E+A== X-Gm-Message-State: AOAM531fMhBuuwDM8ELNaiMKvH4USOr+xUAHmktQfG0a65tkMPQhKmfo ihbvlPEJw1qCH3ZUXngdh0E4L3UDVA== X-Google-Smtp-Source: ABdhPJxb1otBAMOyx674ZGyKvwitGyHclO93Nmyjn/fbX6U/TjQslrra982ujZFcz2ZO5dEo6R+KGQ== X-Received: by 2002:ad4:46c7:: with SMTP id g7mr6259245qvw.245.1591300902691; Thu, 04 Jun 2020 13:01:42 -0700 (PDT) Received: from bill-the-cat.local (2606-a000-1401-826f-79c7-9e70-bb1f-ea59.inf6.spectrum.com. [2606:a000:1401:826f:79c7:9e70:bb1f:ea59]) by smtp.gmail.com with ESMTPSA id n75sm5333615qke.52.2020.06.04.13.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:01:42 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Lokesh Vutla Subject: [PATCH] gpio: omap_gpio: Fix unused function warning in non-DM case Date: Thu, 4 Jun 2020 16:01:39 -0400 Message-Id: <20200604200139.4868-1-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean In the case of non-DM_GPIO the function get_gpio_index() will never be called, and clang will warn about this. Move this to be with the other non-DM code for easier removal later. Cc: Lokesh Vutla Signed-off-by: Tom Rini Reviewed-by: Lokesh Vutla --- drivers/gpio/omap_gpio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c index 4249850f4bf9..c986ef03805c 100644 --- a/drivers/gpio/omap_gpio.c +++ b/drivers/gpio/omap_gpio.c @@ -41,11 +41,6 @@ struct gpio_bank { #endif -static inline int get_gpio_index(int gpio) -{ - return gpio & 0x1f; -} - int gpio_is_valid(int gpio) { return (gpio >= 0) && (gpio < OMAP_MAX_GPIO); @@ -122,6 +117,10 @@ static int _get_gpio_value(const struct gpio_bank *bank, int gpio) } #if !CONFIG_IS_ENABLED(DM_GPIO) +static inline int get_gpio_index(int gpio) +{ + return gpio & 0x1f; +} static inline const struct gpio_bank *get_gpio_bank(int gpio) {