From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B51A2C4332F for ; Thu, 13 Oct 2022 16:12:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5CA2484D55; Thu, 13 Oct 2022 18:12:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Lv4fXXB9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9256284D2B; Thu, 13 Oct 2022 18:12:49 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 5BD8F84DC0 for ; Thu, 13 Oct 2022 18:12:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 274ACB81E91; Thu, 13 Oct 2022 16:12:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B542AC433D6; Thu, 13 Oct 2022 16:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665677563; bh=JUE9+Ckn9gP8dDu8uXBo6GF8PqwZ4SGo6z3bsQC+0h0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Lv4fXXB92fawAN6k5sKxPH2yqp3PF0eq0EruNp29Oncy/XHb9NeKU2kj8u1ddtaei dzto7gcabfoVFP6h/dG3Gd0HQ898JmfAAVF97eGFkO63CwgU6aj+h32r+rl2QohOfH +L/aPH3CuXehJM7yK1lZDKUbj4ptHNCUuCjhfkQ17YmM2DRm5jOcWa4FE7gh5b1arJ YaABjWxkhkCUuk4mSRY/kUFvbHqyPEtTMJwmGZc0oto6bosSK/3d0NJ/Xpu59rgMbO HuRvGZrDSW9P3WJIRoArq/yLU00slhEE13xCQdutonwGqZgll/4Ji1Op26sM9MeREr bdXPNVyEHesuw== Date: Thu, 13 Oct 2022 18:12:36 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Heinrich Schuchardt Cc: Wolfgang Denk , u-boot@lists.denx.de Subject: Re: [PATCH 1/1] powerpc: fix fdt_fixup_liodn_tbl_fman() Message-ID: <20221013181236.0c5e94d8@thinkpad> In-Reply-To: <20221012171311.42881-1-heinrich.schuchardt@canonical.com> References: <20221012171311.42881-1-heinrich.schuchardt@canonical.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean On Wed, 12 Oct 2022 19:13:11 +0200 Heinrich Schuchardt wrote: > Builiding with GCC 12.2 fails: > > arch/powerpc/cpu/mpc85xx/liodn.c: In function 'fdt_fixup_liodn_tbl_fman': > arch/powerpc/cpu/mpc85xx/liodn.c:340:35: error: the comparison will > always evaluate as 'false' for the address of 'compat' > will never be NULL [-Werror=address] > 340 | if (tbl[i].compat == NULL) > | > > Remove the superfluous check. > > Fixes: 97a8d010e029 ("net/fman: Support both new and legacy FMan Compatibles") > Signed-off-by: Heinrich Schuchardt > --- > arch/powerpc/cpu/mpc85xx/liodn.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/powerpc/cpu/mpc85xx/liodn.c b/arch/powerpc/cpu/mpc85xx/liodn.c > index a084002494..2d55916841 100644 > --- a/arch/powerpc/cpu/mpc85xx/liodn.c > +++ b/arch/powerpc/cpu/mpc85xx/liodn.c > @@ -337,9 +337,6 @@ static void fdt_fixup_liodn_tbl_fman(void *blob, > for (i = 0; i < sz; i++) { > int off; > > - if (tbl[i].compat == NULL) > - continue; > - > /* Try the new compatible first. > * If the node is missing, try the old. > */ This is the wrong fix, IMO. Instead we should do something like diff --git a/arch/powerpc/cpu/mpc85xx/liodn.c b/arch/powerpc/cpu/mpc85xx/liodn.c index a084002494..41b7d53ec3 100644 --- a/arch/powerpc/cpu/mpc85xx/liodn.c +++ b/arch/powerpc/cpu/mpc85xx/liodn.c @@ -337,7 +337,7 @@ static void fdt_fixup_liodn_tbl_fman(void *blob, for (i = 0; i < sz; i++) { int off; - if (tbl[i].compat == NULL) + if (tbl[i].compat[0] == NULL) continue; /* Try the new compatible first. @@ -345,7 +345,7 @@ static void fdt_fixup_liodn_tbl_fman(void *blob, */ off = fdt_node_offset_by_compat_reg(blob, tbl[i].compat[0], tbl[i].compat_offset); - if (off < 0) + if (off < 0 && tbl[i].compat[1] != NULL) off = fdt_node_offset_by_compat_reg(blob, tbl[i].compat[1], tbl[i].compat_offset);