From patchwork Tue Sep 5 12:39:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 9938625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A625600CB for ; Tue, 5 Sep 2017 12:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79701212E8 for ; Tue, 5 Sep 2017 12:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C3582897B; Tue, 5 Sep 2017 12:40:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09D37212E8 for ; Tue, 5 Sep 2017 12:40:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91ACA6E44A; Tue, 5 Sep 2017 12:40:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from johanna3.inet.fi (mta-out1.inet.fi [62.71.2.234]) by gabe.freedesktop.org (Postfix) with ESMTP id CD5F96E44A for ; Tue, 5 Sep 2017 12:40:00 +0000 (UTC) RazorGate-KAS: Status: not_detected RazorGate-KAS: Rate: 0 RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29 RazorGate-KAS: Lua profiles 69136 [Nov 12 2014] RazorGate-KAS: Method: none Received: from hufflepuff.adrinael.net (84.248.197.237) by johanna3.inet.fi (9.0.002.03-2-gbe5d057) id 59A30C4900E1A662; Tue, 5 Sep 2017 15:39:59 +0300 Received: from adrinael by hufflepuff.adrinael.net with local (Exim 4.84_2) (envelope-from ) id 1dpD95-0003TT-Q4; Tue, 05 Sep 2017 15:39:59 +0300 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Tue, 5 Sep 2017 15:39:49 +0300 Message-Id: <1504615189-13315-1-git-send-email-petri.latvala@intel.com> X-Mailer: git-send-email 2.1.4 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH i-g-t] intel_l3_parity: More helpful output in case of errors X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP When no action is specified on the command line, print the usage help text and exit with failure instead of SIGABRT. Fix some typos on the usage text. Keep the abort() call in places where they can only be reached by expanding the tool and forgetting to handle new parameters, with an error message printed. CC: Ben Widawsky Signed-off-by: Petri Latvala --- tools/intel_l3_parity.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c index eb00c50..1a4fae5 100644 --- a/tools/intel_l3_parity.c +++ b/tools/intel_l3_parity.c @@ -172,9 +172,9 @@ static void usage(const char *name) " -l, --list List the current L3 logs\n" " -a, --clear-all Clear all disabled rows\n" " -e, --enable Enable row, bank, subbank (undo -d)\n" - " -d, --disable= Disable row, bank, subbank (inline arguments are deprecated. Please use -r, -b, -s instead\n" - " -i, --inject [HSW only] Cause hardware to inject a row errors\n" - " -u, --uninject [HSW only] Turn off hardware error injectection (undo -i)\n" + " -d, --disable= Disable row, bank, subbank (inline arguments are deprecated. Please use -r, -b, -s instead)\n" + " -i, --inject [HSW only] Cause hardware to inject a row error\n" + " -u, --uninject [HSW only] Turn off hardware error injection (undo -i)\n" " -L, --listen Listen for uevent errors\n", name); } @@ -301,6 +301,7 @@ int main(int argc, char *argv[]) action = c; break; default: + fprintf(stderr, "Internal error: Unhandled flag %c\n", c); abort(); } } @@ -374,7 +375,12 @@ int main(int argc, char *argv[]) break; case 'L': break; + case '0': + /* No action given */ + usage(argv[0]); + exit(EXIT_FAILURE); default: + fprintf(stderr, "Internal error: Unhandled action %d\n", action); abort(); } }