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=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 AF7D0C07E95 for ; Sat, 10 Jul 2021 14:51:52 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E02E461248 for ; Sat, 10 Jul 2021 14:51:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E02E461248 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B93B832B4; Sat, 10 Jul 2021 16:51:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625928710; bh=jV0f7mAsvV5Sf7Qa5zsWTOnRVN/4uSraSMDbmVFhA98=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=PwYuW+BYmtwKu11xkqJazaqH54y6EU+3bpukL1J84QYUaD0JYc0ZPC5AppD2LZG0f 99Xv6I2yKCYMRp9qHt/WJzzXjubqVVVzpH4sZXbffDboWR/V0naugqNmrZXBn8IQoD KbYFw9JYLgSS4ZRaFirF9Q+8EsuWqp+xDkvQ8wSpndLCOHwOAuvSjbrKSvvHkNqI/Y dmT8ZAYCTOrbF6+IeaJpvovtvK9DwkUV+4ZDQsPFQJD3OGABCkrIPYh5o6V/n5TN0s ySC1gC1l5MmN2mygU8xUvFtqT6GlkY1CsDaD6cqvC96ef4cEEjpfmPc7OTdQWWD4mO sNnPPAdp8mNpA== Received: by phobos.denx.de (Postfix, from userid 109) id 83056832BF; Sat, 10 Jul 2021 16:51:48 +0200 (CEST) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C4FC0832B4 for ; Sat, 10 Jul 2021 16:51:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4GMXzg377fz1qtQY; Sat, 10 Jul 2021 16:51:43 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4GMXzg2tlnz1qqkX; Sat, 10 Jul 2021 16:51:43 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id RVTMkTHBq7jH; Sat, 10 Jul 2021 16:51:42 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sat, 10 Jul 2021 16:51:41 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id D17FB4540A53; Sat, 10 Jul 2021 16:51:40 +0200 (CEST) Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 8H4ahPEpvDob; Sat, 10 Jul 2021 16:51:38 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 3B4EC4540561; Sat, 10 Jul 2021 16:51:38 +0200 (CEST) From: Stefano Babic To: u-boot@lists.denx.de Cc: Stefano Babic Subject: [PATCH] spi: mxc_spi: fix warnings if CLK_ENABLED not set Date: Sat, 10 Jul 2021 16:51:35 +0200 Message-Id: <20210710145135.1873012-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean Following warnings (unused variables) are raised: drivers/spi/mxc_spi.c: In function 'mxc_spi_probe': drivers/spi/mxc_spi.c:595:14: error: unused variable 'blob' [-Werror=unused-variable] 595 | const void *blob = gd->fdt_blob; | ^~~~ drivers/spi/mxc_spi.c:594:6: error: unused variable 'node' [-Werror=unused-variable] 594 | int node = dev_of_offset(bus); Move the variable declaration inside the code where they are used. Signed-off-by: Stefano Babic --- drivers/spi/mxc_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index f3dddbdbd7..a80c3e737d 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -591,8 +591,6 @@ void spi_release_bus(struct spi_slave *slave) static int mxc_spi_probe(struct udevice *bus) { struct mxc_spi_slave *mxcs = dev_get_plat(bus); - int node = dev_of_offset(bus); - const void *blob = gd->fdt_blob; int ret; int i; @@ -629,6 +627,8 @@ static int mxc_spi_probe(struct udevice *bus) mxcs->max_hz = clk_get_rate(&clk); #else + int node = dev_of_offset(bus); + const void *blob = gd->fdt_blob; mxcs->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", 20000000); #endif -- 2.25.1