From patchwork Sun Oct 9 13:30:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Syromyatnikov X-Patchwork-Id: 9369137 X-Patchwork-Delegate: snitzer@redhat.com 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 62CFE60487 for ; Mon, 10 Oct 2016 08:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5560729325 for ; Mon, 10 Oct 2016 08:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A53F2933B; Mon, 10 Oct 2016 08:33:25 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E131129325 for ; Mon, 10 Oct 2016 08:33:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9A8Uq2v013001; Mon, 10 Oct 2016 04:30:52 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u99DV13f016660 for ; Sun, 9 Oct 2016 09:31:01 -0400 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u99DV13j005617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 9 Oct 2016 09:31:01 -0400 Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A11DC03BD5C; Sun, 9 Oct 2016 13:31:00 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id p80so5475190lfp.1; Sun, 09 Oct 2016 06:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/0UqOZrinuWC3UupsOyKZBoaB7P3sTUT1xSjA624MCg=; b=kqUCOdq+k0aTpDZIHsrhed9+MwGrwEmWf+d+AmVfDGFJsFpOqEgLFUNkkseD+60fVl nehRmbL5XtaXrmOgfVo20cb0N+Q37tQbdFTFmBgH9Q2K9PCeifMC+zY0n5PA7IZ2X6o7 Hvim5WxkZL+KV3vLN2PFLl2gU9dku8iwT4BfNZz86W1WsZlUDhRmre8CwHM1zbIFhqJY g3ABbOJOSC5yQ23YJ+7R0bL6X26peGLz4m7SRLDI0lANacEr4Fwi7RH2cabHC+JIkrNa OqQ0CVkG0USoObZVc/JHRZnX69VCHeJqiwBNknhO3l2+mfj14TGhg5hWGSHg+R0FhlG3 PSYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/0UqOZrinuWC3UupsOyKZBoaB7P3sTUT1xSjA624MCg=; b=hOHN9524aPpRUzHniiBfoNnqxH0GRW4vIP5esQ4fy87lPJK08L/1r3Jj+Bct/oz6z+ 0NbQtPPcSXvyEEIbD/kTgulYYdYNFEUc3u6BwcZjfQqaKQsH2Dx2EQwlChd/sMemKBVg zXvZ7fYCzz+Zcl/AJ5rqGMhG179jliRyy6voqnA4QnE76QGE3ktNXVw7l4+DZwPLOJUC pTKnwYh917vjLQs8bN8PyojaRZ2RPvxxGiRM8BtVaQshmS/ItUHZ6sk4i4Kwk6EwNahU F3XxGrC+IBniVxSSvfRuHzd2FcNVVJobjDkB3Rq0c5ZQLdZCW7r0QtGumnteAmEQDDnz 3yLA== X-Gm-Message-State: AA6/9RnI9fNnOZM5nfXafhaMqFHVlJNArkjjBZj5nfhzvmlbVk2WFgTHc2GnAZfhbhBHlg== X-Received: by 10.25.20.228 with SMTP id 97mr3675697lfu.93.1476019858643; Sun, 09 Oct 2016 06:30:58 -0700 (PDT) Received: from obsidian (broadband-46-188-15-144.2com.net. [46.188.15.144]) by smtp.gmail.com with ESMTPSA id z67sm5221914lfa.2.2016.10.09.06.30.57 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 09 Oct 2016 06:30:57 -0700 (PDT) Date: Sun, 9 Oct 2016 16:30:56 +0300 From: Eugene Syromyatnikov To: strace-devel@lists.sourceforge.net Message-ID: <20161009133056.GA3900@obsidian> References: <20161005.192828.566127461630656590.yamato@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161005.192828.566127461630656590.yamato@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 09 Oct 2016 13:31:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 09 Oct 2016 13:31:00 +0000 (UTC) for IP:'209.85.215.67' DOMAIN:'mail-lf0-f67.google.com' HELO:'mail-lf0-f67.google.com' FROM:'evgsyr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.17 * (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.215.67 mail-lf0-f67.google.com 209.85.215.67 mail-lf0-f67.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 10 Oct 2016 04:29:54 -0400 Cc: dm-devel@redhat.com, mpatocka@redhat.com, yamato@redhat.com Subject: [dm-devel] [PATCH 14/21] dm: replace abbrev branching with goto X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP --- dm.c | 78 ++++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/dm.c b/dm.c index 73a9b57..814d7d2 100644 --- a/dm.c +++ b/dm.c @@ -350,52 +350,54 @@ dm_known_ioctl(struct tcb *tcp, const unsigned int code, long arg) } } } - if (abbrev(tcp)) + + if (abbrev(tcp)) { tprints(", ..."); - else - switch (code) { - case DM_DEV_WAIT: - case DM_TABLE_STATUS: - if (entering(tcp) || syserror(tcp)) - break; - dm_decode_dm_target_spec(tcp, ioc, extra, extra_size); - break; - case DM_TABLE_LOAD: - if (!entering(tcp)) - break; - dm_decode_dm_target_spec(tcp, ioc, extra, extra_size); + goto skip; + } + + switch (code) { + case DM_DEV_WAIT: + case DM_TABLE_STATUS: + if (entering(tcp) || syserror(tcp)) break; - case DM_TABLE_DEPS: - if (entering(tcp) || syserror(tcp)) - break; - dm_decode_dm_target_deps(ioc, extra, extra_size); + dm_decode_dm_target_spec(tcp, ioc, extra, extra_size); + break; + case DM_TABLE_LOAD: + if (!entering(tcp)) break; - case DM_LIST_DEVICES: - if (entering(tcp) || syserror(tcp)) - break; - dm_decode_dm_name_list(ioc, extra, extra_size); + dm_decode_dm_target_spec(tcp, ioc, extra, extra_size); + break; + case DM_TABLE_DEPS: + if (entering(tcp) || syserror(tcp)) break; - case DM_LIST_VERSIONS: - if (entering(tcp) || syserror(tcp)) - break; - dm_decode_dm_target_versions(ioc, extra, extra_size); + dm_decode_dm_target_deps(ioc, extra, extra_size); + break; + case DM_LIST_DEVICES: + if (entering(tcp) || syserror(tcp)) break; - case DM_TARGET_MSG: - if (entering(tcp)) { - dm_decode_dm_target_msg(ioc, extra, - extra_size); - } else if (!syserror(tcp) && - ioc->flags & DM_DATA_OUT_FLAG) { - dm_decode_string(ioc, extra, extra_size); - } + dm_decode_dm_name_list(ioc, extra, extra_size); + break; + case DM_LIST_VERSIONS: + if (entering(tcp) || syserror(tcp)) break; - case DM_DEV_RENAME: - case DM_DEV_SET_GEOMETRY: - if (!entering(tcp)) - break; + dm_decode_dm_target_versions(ioc, extra, extra_size); + break; + case DM_TARGET_MSG: + if (entering(tcp)) { + dm_decode_dm_target_msg(ioc, extra, + extra_size); + } else if (!syserror(tcp) && ioc->flags & DM_DATA_OUT_FLAG) { dm_decode_string(ioc, extra, extra_size); - break; } + break; + case DM_DEV_RENAME: + case DM_DEV_SET_GEOMETRY: + if (!entering(tcp)) + break; + dm_decode_string(ioc, extra, extra_size); + break; + } skip: tprints("}");