From patchwork Wed Jul 18 15:16:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 945748 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="LfocTEAg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41W14X6ylvz9s3R for ; Thu, 19 Jul 2018 01:18:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 88CA3C21F18; Wed, 18 Jul 2018 15:17:17 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 A2770C21E0D; Wed, 18 Jul 2018 15:17:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 89318C21E52; Wed, 18 Jul 2018 15:17:03 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by lists.denx.de (Postfix) with ESMTPS id C0228C21E29 for ; Wed, 18 Jul 2018 15:16:59 +0000 (UTC) Received: by mail-wm0-f42.google.com with SMTP id o11-v6so3169217wmh.2 for ; Wed, 18 Jul 2018 08:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kEA56UyRr4eyosQHCn4Lfyo73OcEzbU/k9GXSSRGiU4=; b=LfocTEAgyqa5otugrBAo32HP9hwIR9cZjuQIZnjx6KGr4RxXBOEHbos9xpfTH+m5zc WXas4mSN2w/9WSsO2nrox71q6ttcOomchAx4hHO684XqmEe8moOjTYWQqJikZg/GWD39 5Fkw4u3J9QH9lKN2sXgVJVeTQDdjQb3e3w1RhKl8zTYmFYSBrKC9ejUR1z3ukBKipfXp 64S8YAYtFkn/P7K8iUm6Zibb9+ZoJvKGna+qIEYxb1sQb2Wnz7p1vGpYOMkabYjevFsH +3bymyP9Q6h9s9WD8GydIKmN8Q12HcB+8YnLjte7df/lbqm2KNubi6nRPMNreLSMR7fY Ly+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=kEA56UyRr4eyosQHCn4Lfyo73OcEzbU/k9GXSSRGiU4=; b=ETdeGpae0HOr2JUAo8jdP1rXN+l2X7IjX2KM7ztWRldX19h6no0KV3lop1YuLauywq 7ydc3FWmoQULd4Se4gV+PQUas7SVPb1DFaRnOlW6uli8oigWk3OuER1fe7tIG0pld5LP BothH5VhshMK8xDOkjoQEJVHzdZysvKAxejqYO4oyTE+Y3Lpz2fPBmCq9itn8W+iLTYm 9lgXRW+59LaoMGsb5OWMentO/g/RiyH4sWuPbLk3A1Ne1BRPG7NP0nzhLSyV75tqCsPD 45YCV1DsV9t6WntCA2ufISj6D1dkSie+dnsUym6dQDEwKSvjjXaouZvV/wxU2DPObCYe JsLg== X-Gm-Message-State: AOUpUlEoHoIQCugMxOpFl3zAKebv7lD//wQsKkAzWJ14B7FrHzNd7Rox Q49vswISuhNGbu0DzOc6FqNbsJP6 X-Google-Smtp-Source: AAOMgpf+VmAog9TFfn0CqPNqWFmT6ETYFK64OVU9Nxdu1JhwVrYc4avQlwGzq6X+On5XeKYVj/bEpQ== X-Received: by 2002:a1c:b484:: with SMTP id d126-v6mr1895484wmf.17.1531927019153; Wed, 18 Jul 2018 08:16:59 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id w9-v6sm5561318wrr.77.2018.07.18.08.16.58 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 18 Jul 2018 08:16:58 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, Marek Vasut , Simon Glass , Tom Rini Date: Wed, 18 Jul 2018 17:16:40 +0200 Message-Id: <4a585f1789ecabf5d57c5f4e9f8aaf64c7b6dbe1.1531926958.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Subject: [U-Boot] [RFC PATCH 02/15] cmd: fpga: Move error handling to do_fpga() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Clean fpga_get_op() error handling by moving checking/print to do_fpga. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- cmd/fpga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/fpga.c b/cmd/fpga.c index 791fe5cb7718..abe683720285 100644 --- a/cmd/fpga.c +++ b/cmd/fpga.c @@ -74,6 +74,9 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) op = (int)fpga_get_op(argv[1]); switch (op) { + case FPGA_NONE: + printf("Unknown fpga operation \"%s\"\n", argv[1]); + return CMD_RET_USAGE; #if defined(CONFIG_CMD_FPGA_LOADFS) case FPGA_LOADFS: if (argc < 9) @@ -360,9 +363,6 @@ static int fpga_get_op(char *opstr) op = FPGA_LOADS; #endif - if (op == FPGA_NONE) - printf("Unknown fpga operation \"%s\"\n", opstr); - return op; }