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 BF4D1C2B9F8 for ; Mon, 24 May 2021 15:47:40 +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 9C648619A7 for ; Mon, 24 May 2021 15:47:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C648619A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com 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 90B8382C95; Mon, 24 May 2021 17:47:37 +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 C3E1282E98; Mon, 24 May 2021 17:47:35 +0200 (CEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 20FF882AB1 for ; Mon, 24 May 2021 17:47:33 +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-qt1-f173.google.com with SMTP id 1so20957687qtb.0 for ; Mon, 24 May 2021 08:47:33 -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:subject:date:message-id; bh=86kQqaCiTgSFLnuT/lDmilVhJt5pk1pCpfabbAjYR4w=; b=Ss8vbY3epFxqQmg+58J5tb2GqRnvGArRsyRvn6e7P7TvaFxj292zClh8lf2eSN68yo GiYK22LXpemAcYIkJy6VaLVX47tofmJl3RpZrWwIxAcjX7Ecd5lnr9WJ61p0A+A84M3a i/1VGpsmWGy9SFcFB0MrK1hb1qkIuM1xoK8H6BOi6OGKcj3jqG6MhRQHbosm0JeayN3X BMU8Y73pSGyz918owF6wxSg9v8h70/ziP5vIyj7T+DIYExdz0yHfmHniRpFy735SLMPM e5HygIFvtKnwp0OjFjbWNQSafKZ93pT+6tVfqKZ3DnGyaRwCvBVluRPlLL+IbIxbqslI dXFg== X-Gm-Message-State: AOAM530WaNVqyyB2tuWWWhKKPgvijKBohK6y+qdxoSj4Getn8reTXpHG 10/2CI5xU2OJXUDBj2g8lwRAtpu2iw== X-Google-Smtp-Source: ABdhPJyMRsIkL20BeFYte0TD5DocS9izLr2RPCKMXERv7HUOq1jb5IdGSkjbfWtb0FjVELj+AKGwug== X-Received: by 2002:a05:622a:5c9:: with SMTP id d9mr27352249qtb.177.1621871251361; Mon, 24 May 2021 08:47:31 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-9576-eca8-4e25-8149.res6.spectrum.com. [2603:6081:7b01:cbda:9576:eca8:4e25:8149]) by smtp.gmail.com with ESMTPSA id j16sm10453769qtr.27.2021.05.24.08.47.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 08:47:30 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH] pylibfdt: Rework "avoid unused variable warning" lines Date: Mon, 24 May 2021 11:47:27 -0400 Message-Id: <20210524154727.30163-1-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 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.102.4 at phobos.denx.de X-Virus-Status: Clean Clang has -Wself-assign enabled by default under -Wall and so when building with -Werror we would get an error here. Inspired by Linux kernel git commit a21151b9d81a ("tools/build: tweak unused value workaround") make use of the fact that both Clang and GCC support casting to `void` as the method to note that something is intentionally unused. Signed-off-by: Tom Rini --- scripts/dtc/pylibfdt/libfdt.i_shipped | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped index 1d69ad38e2e3..27c29ea2603a 100644 --- a/scripts/dtc/pylibfdt/libfdt.i_shipped +++ b/scripts/dtc/pylibfdt/libfdt.i_shipped @@ -1010,7 +1010,7 @@ typedef uint32_t fdt32_t; } $1 = (void *)PyByteArray_AsString($input); fdt = $1; - fdt = fdt; /* avoid unused variable warning */ + (void)fdt; /* avoid unused variable warning */ } /* Some functions do change the device tree, so use void * */ @@ -1021,7 +1021,7 @@ typedef uint32_t fdt32_t; } $1 = PyByteArray_AsString($input); fdt = $1; - fdt = fdt; /* avoid unused variable warning */ + (void)fdt; /* avoid unused variable warning */ } /* typemap used for fdt_get_property_by_offset() */ -- 2.17.1