From patchwork Tue Apr 26 13:04:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8938581 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBF05BF29F for ; Tue, 26 Apr 2016 13:07:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2743B20166 for ; Tue, 26 Apr 2016 13:07:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FDCB20148 for ; Tue, 26 Apr 2016 13:07:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av2fn-0003GT-6I; Tue, 26 Apr 2016 13:05:03 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av2fl-0003GK-EX for xen-devel@lists.xen.org; Tue, 26 Apr 2016 13:05:01 +0000 Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id 20/3A-02833-C776F175; Tue, 26 Apr 2016 13:05:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsVyMXThId2adPl wg0vzuSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyL130LbnFXbPmb2cD4jaOLkYtDSGAio8TN dyvYQBwWgXZmiT9H14I5EgLvWCSeLD8M5HAAOTESpw7rdTFyApnlEhvn7mcHsYUEFCR+TzjEB DFpMpPEvHv9YAk2AQ2JJ79msIHYIgLSEtc+X2YEsZkFCiRmPdnOAmILC9hK7Dl9gQnEZhFQlT j26j5YnFfAQeLQn3ZWiL1yEgve+0xg5FvAyLCKUaM4tagstUjX0FAvqSgzPaMkNzEzB8gz0ct NLS5OTE/NSUwq1kvOz93ECAwSBiDYwXhmhfMhRkkOJiVR3j+T5cKF+JLyUyozEosz4otKc1KL DzHKcHAoSfCuipAPFxIsSk1PrUjLzAGGK0xagoNHSYT3H0iat7ggMbc4Mx0idYrRkmPL72trm Tg+bbwDJLdNvbeWSYglLz8vVUqctwakQQCkIaM0D24cLKYuMcpKCfMyAh0oxFOQWpSbWYIq/4 pRnINRSZh3EsgUnsy8Eritr4AOYgI66PIhWZCDShIRUlINjEwpp1/4Ks62e7U0kvOyFWeN89o lCuVC77sfTH9zfOK0J5cc3wntec4xg2Nb+r7v011n3j1ak2BnYDLPdU3u34u/K6N2my+z+xZ2 1TvBZEfcXLGWhZ712+31nh+Tfr7hxOGzrv/az7W5rPu7TTuSV5+Jhc9j0RorufxQbyWRJY7F3 yp65YsWVymxFGckGmoxFxUnAgAoFr6ZpAIAAA== X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1461675899!34155466!1 X-Originating-IP: [209.85.161.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 61886 invoked from network); 26 Apr 2016 13:04:59 -0000 Received: from mail-yw0-f194.google.com (HELO mail-yw0-f194.google.com) (209.85.161.194) by server-8.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 26 Apr 2016 13:04:59 -0000 Received: by mail-yw0-f194.google.com with SMTP id o63so1899623ywe.0 for ; Tue, 26 Apr 2016 06:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id; bh=laJYmXPSplpFQZvhoXSAgFg4+7iOByMSiWaHweLoC48=; b=ef/NDOyUxg3f0yR+V1qw8pLqHCDATd6yUFqCXvUHRBqkg5Ju/k4TzCvZRk5mc2mutI 4snLAmABYCAOcIUFFhDzDa0YK4DAaXrLbYUh4Vtr/PeS4f7sPe0fEoZQFdZ0Ch5ilXaz CA3gyXWOq/JL3FnBYhiDHTdl1MtmMtZMtq9SY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=laJYmXPSplpFQZvhoXSAgFg4+7iOByMSiWaHweLoC48=; b=XyX9ArO3nZe0VWDFjXufLaZ98ax7DCUZIuhutw9XQsuMWCDY4AO8YajHFSp+GF27dY Ok6thZayJn9A5G5/NW0d3thPSuFSmG2tmzMFYUEl1yBRs8jhJpjNu7IwrtUMyWk4TS6d hfKUL+TorVXwy3VWQTsrkKUd8mgd4TEi8gwYGs560fdn5EDh1ZED+97BRlyd/xKTGPaN lDhA+d5LhVCuzieTSxdeL4nj0Avie02CRRzP78bDmBPnc/6FZONAAKpfjRDLU81HiDgd 3RM1I1aZPQfBBUjyzipKYwenEIXoC2rTaZDiAjBHrm23Fx6fDmvY7A2+qs5X2DuwWQcH oGmw== X-Gm-Message-State: AOPr4FWNCdN6CdXft8Q135OYPocVs3h7K9Yt2aXpNXTCRt9yrV9QLklqcLybbY+0UTaLEw== X-Received: by 10.13.207.5 with SMTP id r5mr1353830ywd.284.1461675898717; Tue, 26 Apr 2016 06:04:58 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id z9sm15171806ywz.11.2016.04.26.06.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Apr 2016 06:04:57 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Tue, 26 Apr 2016 08:04:46 -0500 Message-Id: <1461675886-4275-1-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 Cc: Wei Liu , Ian Jackson , Doug Goldstein Subject: [Xen-devel] [PATCH] blktap2: use abort() instead of custom crash X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of trying to write a snippet of code that crashes the process just use abort() directly. This is to fix the build on clang which detects that the snippet of code will crash and fails to compile. At the same time removed extraneous whitespace in the macro. Signed-off-by: Doug Goldstein Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- Honestly this whole macro could get replaced with assert(3) but I wanted to make the smallest change possible. If that's preferrable I'll do that. The man page claims that assert(3) will print the following to stderr: "assertion \"%s\" failed: file \"%s\", line %d\n", \ "expression", __FILE__, __LINE__); --- tools/blktap2/drivers/tapdisk-vbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/blktap2/drivers/tapdisk-vbd.c b/tools/blktap2/drivers/tapdisk-vbd.c index 31bc2fe..e2e9cd5 100644 --- a/tools/blktap2/drivers/tapdisk-vbd.c +++ b/tools/blktap2/drivers/tapdisk-vbd.c @@ -49,18 +49,18 @@ #define DBG(_level, _f, _a...) tlog_write(_level, _f, ##_a) #define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a) -#if 1 +#if 1 #define ASSERT(p) \ do { \ if (!(p)) { \ DPRINTF("Assertion '%s' failed, line %d, " \ "file %s", #p, __LINE__, __FILE__); \ - *(int*)0 = 0; \ + abort(); \ } \ } while (0) #else #define ASSERT(p) ((void)0) -#endif +#endif #define TD_VBD_EIO_RETRIES 10