[{"id":1760384,"web_url":"http://patchwork.ozlabs.org/comment/1760384/","msgid":"<CAAdtpL6kjOHOXF2L7qr5YTqrOvbSaE1Qyu_mccD=BHVRshq7qA@mail.gmail.com>","list_archive_url":null,"date":"2017-08-30T17:37:15","subject":"Re: [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious\n\tNULL check","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On Wed, Aug 30, 2017 at 1:57 PM, Jeff Cody <jcody@redhat.com> wrote:\n> 'tag' is already checked in the lines immediately preceding this check,\n> and set to non-NULL if NULL.  No need to check again, it hasn't changed.\n>\n> Signed-off-by: Jeff Cody <jcody@redhat.com>\n> ---\n>  block/sheepdog.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/block/sheepdog.c b/block/sheepdog.c\n> index abb2e79..bbbfa72 100644\n> --- a/block/sheepdog.c\n> +++ b/block/sheepdog.c\n> @@ -1632,7 +1632,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,\n>      if (!tag) {\n>          tag = \"\";\n>      }\n> -    if (tag && strlen(tag) >= SD_MAX_VDI_TAG_LEN) {\n> +    if (strlen(tag) >= SD_MAX_VDI_TAG_LEN) {\n\nyou can even prepend an 'else'! :D\n\n>          error_setg(errp, \"value of parameter 'tag' is too long\");\n>          ret = -EINVAL;\n>          goto err_no_fd;\n> --\n> 2.9.5\n>\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"FgHnNGcT\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjCtb36d6z9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 03:59:03 +1000 (AEST)","from localhost ([::1]:51969 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn7GX-0003K3-5u\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 13:59:01 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42992)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dn6vW-0000Oj-1f\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:37:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dn6vV-0004s8-8o\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 13:37:18 -0400","from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:37890)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dn6vV-0004rs-47; Wed, 30 Aug 2017 13:37:17 -0400","by mail-io0-x241.google.com with SMTP id m40so1484671ioi.5;\n\tWed, 30 Aug 2017 10:37:16 -0700 (PDT)","by 10.2.76.68 with HTTP; Wed, 30 Aug 2017 10:37:15 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=HxIVezkEPJyt/Po3ReTFCQu5jegK6d2vKImPjPxzudQ=;\n\tb=FgHnNGcTguBBmYiNgyJw7chBR5KAQYniat8FKnJAS+4NNkQgZlT0MYr8lVU/Dip7MD\n\t6cG1PGlSTpyYuzHrmFPvtR2MZKBNvrcmJI7u/ce/ldyJeascz3ED5G15UMr4DeJqRyTw\n\txSLk4ezLO93HZI/ynyK37xCq49BEIqlWVB5cB9G8A6eiNJs+YUJv+6c9eo4iXdCYthaJ\n\tD/4YYofcYyzct9YLCvPH+CUne+EoKvp1UAPFGd4NizLLgxSSEY2XoYMXNb+nAV8RusUi\n\txdlYyf7JOD+JRonOUcKEDnj206DPtcUXhVbWnA9x+o8tm3N/lItbJ+tVsAmU0PKiH4RJ\n\tg24A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=HxIVezkEPJyt/Po3ReTFCQu5jegK6d2vKImPjPxzudQ=;\n\tb=eZB93288WPVWtzoyrU/PnXvd68dQdu3RrZBDrUdo6UyrtlQD2PHCbDBaKuO46vEvw1\n\tyvV4erXfStdM3svhoLtLWcaA2wmn7iRQTdTlcEvJnPgw5Qw1XGpi0QNL8LIVbZmzVIIo\n\t4hMY/DvIoktTDuZ1qrmBNpmj6ZXHv7swREmY05hUQ8jc/4SkNWV5iGct7kuz6stlWERL\n\tyJQiF+rHGCWi5V+r7i5QTbzY70oone+qfOCl7toGCp0rN0GRnZhKN4Jtq6uGtjJrxTFO\n\tgBk9z6rN6nPOMLMr/OB2/j8Z+35CxRZLv/Y1+z+lBH8qFfPKYlaF4K2TFXvv+0KUPiSk\n\thU7g==","X-Gm-Message-State":"AHYfb5g8ipMl1I+3RuGNJJifMA1Jx2zzGplafGOLTLL35bhxSht90EyP\n\t+VB1jsgUrqiWPRwdsO3W6Zae6qxE0w==","X-Received":"by 10.36.124.21 with SMTP id a21mr2410472itd.19.1504114636394;\n\tWed, 30 Aug 2017 10:37:16 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<8fe8ddad6b924b460ca4ed4a7e401c18d24c246f.1504112061.git.jcody@redhat.com>","References":"<cover.1504112061.git.jcody@redhat.com>\n\t<8fe8ddad6b924b460ca4ed4a7e401c18d24c246f.1504112061.git.jcody@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Date":"Wed, 30 Aug 2017 14:37:15 -0300","X-Google-Sender-Auth":"RPdM0VXccFpbXicZZJzfHDTzjOM","Message-ID":"<CAAdtpL6kjOHOXF2L7qr5YTqrOvbSaE1Qyu_mccD=BHVRshq7qA@mail.gmail.com>","To":"Jeff Cody <jcody@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:4001:c06::241","Subject":"Re: [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious\n\tNULL check","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>,\n\t\"open list:Block layer core\" <qemu-block@nongnu.org>,\n\tHitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>,\n\t\"qemu-devel@nongnu.org Developers\" <qemu-devel@nongnu.org>,\n\trjones@redhat.com, Liu Yuan <namei.unix@gmail.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1760436,"web_url":"http://patchwork.ozlabs.org/comment/1760436/","msgid":"<cfbf937b-8619-da88-bb17-66ab1990f4bd@redhat.com>","list_archive_url":null,"date":"2017-08-30T19:42:51","subject":"Re: [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious\n\tNULL check","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 08/30/2017 11:57 AM, Jeff Cody wrote:\n> 'tag' is already checked in the lines immediately preceding this check,\n> and set to non-NULL if NULL.  No need to check again, it hasn't changed.\n> \n> Signed-off-by: Jeff Cody <jcody@redhat.com>\n> ---\n>  block/sheepdog.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nReviewed-by: Eric Blake <eblake@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjGCC5Qh6z9t2M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 05:43:35 +1000 (AEST)","from localhost ([::1]:52403 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn8th-0006md-Sa\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 15:43:33 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46480)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dn8t9-0006l3-IA\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 15:43:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dn8t8-0008VT-Dm\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 15:42:59 -0400","from mx1.redhat.com ([209.132.183.28]:36718)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dn8t3-0008UF-RR; Wed, 30 Aug 2017 15:42:54 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C624020276;\n\tWed, 30 Aug 2017 19:42:52 +0000 (UTC)","from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id C609718B86;\n\tWed, 30 Aug 2017 19:42:51 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C624020276","To":"Jeff Cody <jcody@redhat.com>, qemu-devel@nongnu.org","References":"<cover.1504112061.git.jcody@redhat.com>\n\t<8fe8ddad6b924b460ca4ed4a7e401c18d24c246f.1504112061.git.jcody@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<cfbf937b-8619-da88-bb17-66ab1990f4bd@redhat.com>","Date":"Wed, 30 Aug 2017 14:42:51 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<8fe8ddad6b924b460ca4ed4a7e401c18d24c246f.1504112061.git.jcody@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"q2ebsgJ2nhVeTdx1gkuON6122PFuk9Ggq\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tWed, 30 Aug 2017 19:42:52 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious\n\tNULL check","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"mitake.hitoshi@lab.ntt.co.jp, namei.unix@gmail.com, qemu-block@nongnu.org,\n\trjones@redhat.com, kwolf@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]