Message ID | 20190331020838.26683-1-erosca@de.adit-jv.com |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Zy07iTbp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44XCfW6fWSz9sQt for <incoming@patchwork.ozlabs.org>; Sun, 31 Mar 2019 22:19:13 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 7A1DCC21E70; Sun, 31 Mar 2019 11:19:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 85B0DC21C2C; Sun, 31 Mar 2019 11:19:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 13BB2C21C2C; Sun, 31 Mar 2019 02:09:29 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by lists.denx.de (Postfix) with ESMTPS id 38148C21C27 for <u-boot@lists.denx.de>; Sun, 31 Mar 2019 02:09:28 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id y7so7264664wrn.11 for <u-boot@lists.denx.de>; Sat, 30 Mar 2019 19:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZbwamNxO1Op+o9tCPLGjiRMv+505m8jtH8Q7yzIswHM=; b=Zy07iTbpgVr5cQ02ffCnrZjOzguwSyeDMAiN5WKMgdKQRtyiqRRnibMXFJ5pxuwsYr nefUwCcpI2XzEi6vpf8tfR9LecTpQf6xS+earz7fTVxRNm1kTgps1PaYzXTYK2wlWv0W VyZgn/mTu7FUOKW8eYyUYID2VUo7JOz/p9CUDtidbNRHWNeAoQw6uWd+fsMkE07lln5x Zo6xq2iKEACZjWuKJRIzy1e+kpH+NlTf6VhPlswp+rj42cigqH9332NhMWtMRwbacHkn xV0aXSN7ihsmO4WBxW4BfNLpoJsrkLZ6EakycYrYQh27n4dfJkBABK4vyydL9K8H8mw9 9ppg== 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:mime-version :content-transfer-encoding; bh=ZbwamNxO1Op+o9tCPLGjiRMv+505m8jtH8Q7yzIswHM=; b=HtE/w1TkCRCNicFBq2jAq0Vd9gPjVjokJih621ydtxJe6lJTakyEIRg5XX1JOm6J/g cZWbZpprAg91InqEGMRd2aJKdmaPSpAd+OuqE/PcvW8b6cuV9tolcFJT87wAt6LHYGLg hmGz0SdbVrHG26BwsiyWIKKbpx6xAJy1rbOqWtICsGvGYm+QCdx5epGwUuAHcT61kJwg gvOBv15WvQ6i+nfey6go1d9AknuBMJHD4Ep0tM3k+rB0dcpB3+M7rOReuefeHlEfM6M3 OmCE4EwB0NGyeWU2J+FnJLOPhcuN1YMCikB3myH44qKa3BjcEEauL1IQ6SlqsGzlTW1/ 5Bcg== X-Gm-Message-State: APjAAAXR6m5bmkjN+xwYJIGQbwR+2zNhZlmuDxtoNuDW3H3Zg/Iz+NMm l3ZF6H0bQS3tK+Mo55hVNec= X-Google-Smtp-Source: APXvYqx7Fbo6TYUZGhS7fHitXSOgrChHEswELx0sbEj9v+7bY/+4Vo840cJXLE/rxCjqsg65EwOkrw== X-Received: by 2002:a5d:488d:: with SMTP id g13mr23041565wrq.119.1553998167755; Sat, 30 Mar 2019 19:09:27 -0700 (PDT) Received: from localhost.localdomain (ipb218f541.dynamic.kabel-deutschland.de. [178.24.245.65]) by smtp.gmail.com with ESMTPSA id e193sm10228733wmg.18.2019.03.30.19.09.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 19:09:27 -0700 (PDT) From: Eugeniu Rosca <roscaeugeniu@gmail.com> X-Google-Original-From: Eugeniu Rosca <erosca@de.adit-jv.com> To: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>, Masahiro Yamada <yamada.masahiro@socionext.com>, Stefan Roese <sr@denx.de>, Sam Protsenko <semen.protsenko@linaro.org>, Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>, Marek Vasut <marex@denx.de>, George McCollister <george.mccollister@gmail.com>, Alexey Brodkin <abrodkin@synopsys.com>, Alexander Graf <agraf@suse.de>, York Sun <york.sun@nxp.com>, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Shawn Guo <shawn.guo@linaro.org>, Paul Kocialkowski <contact@paulk.fr>, Pantelis Antoniou <pantelis.antoniou@konsulko.com>, Michal Simek <michal.simek@xilinx.com>, Max Krummenacher <max.krummenacher@toradex.com>, Marcel Ziswiler <marcel.ziswiler@toradex.com>, Joe Hershberger <joe.hershberger@ni.com>, Joakim Tjernlund <joakim.tjernlund@infinera.com>, Heiko Schocher <hs@denx.de>, Hannes Schmelzer <oe5hpm@oevsv.at>, Hannes Schmelzer <hannes.schmelzer@br-automation.com>, Daniel Schwierzeck <daniel.schwierzeck@gmail.com>, Bin Meng <bmeng.cn@gmail.com>, u-boot@lists.denx.de Date: Sun, 31 Mar 2019 04:08:33 +0200 Message-Id: <20190331020838.26683-1-erosca@de.adit-jv.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 31 Mar 2019 11:19:00 +0000 Cc: Eugeniu Rosca <erosca@de.adit-jv.com>, Eugeniu Rosca <roscaeugeniu@gmail.com> Subject: [U-Boot] [PATCH 1/6] fdt: boot_get_fdt: remove redundant zeroing out X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
[U-Boot,1/6] fdt: boot_get_fdt: remove redundant zeroing out
|
expand
|
jFTR, this is superseded by https://patchwork.ozlabs.org/cover/1072785/ ("[v2,0/5] boot_get_fdt: clean up and use 'fdtaddr' as fallback for Android")
diff --git a/common/image-fdt.c b/common/image-fdt.c index 01186aeac7a4..1817ce6bce30 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -489,8 +489,6 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, no_fdt: ok_no_fdt = 1; error: - *of_flat_tree = NULL; - *of_size = 0; if (!select && ok_no_fdt) { debug("Continuing to boot without FDT\n"); return 0;
Paranoid programming [1] lies at the foundation of proper software development, but the repetitive zeroint-out of output arguments in the context of the same function rather clutters the code and inhibits further refactoring/optimization than is doing any good. In boot_get_fdt(), we already perform zero/NULL-initialization of *of_flat_tree and *of_size at the beginning of the function, so doing the same at function error-out is redundant/superfluous. Moreover, keeping the code unchanged might encourage the developers to update *of_flat_tree and *of_size during some interim computations, which is against the current design of boot_get_fdt(). Currently, writing useful data into these arguments happens just before successfully returning from boot_get_fdt() and it should better stay so. [1] https://blog.regehr.org/archives/1106 Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> --- common/image-fdt.c | 2 -- 1 file changed, 2 deletions(-)