[{"id":13201,"web_url":"https://patchwork.libcamera.org/comment/13201/","msgid":"<20201014122945.45jujcqeqifaop3r@oden.dyn.berto.se>","date":"2020-10-14T12:29:45","subject":"Re: [libcamera-devel] [PATCH 07/10] test: v4l2_videodevice: Prevent\n\tvariable aliasing of format","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Kieran,\n\nOn 2020-10-13 16:12:38 +0100, Kieran Bingham wrote:\n> Rename the scoped usage of the variable format while iterating the formats\n> as it aliases the outer scoped format which is used for specific testing.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  test/v4l2_videodevice/formats.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/test/v4l2_videodevice/formats.cpp b/test/v4l2_videodevice/formats.cpp\n> index 043732dcaba1..e3283cf92bff 100644\n> --- a/test/v4l2_videodevice/formats.cpp\n> +++ b/test/v4l2_videodevice/formats.cpp\n> @@ -55,10 +55,10 @@ protected:\n>  \t\t\t{ V4L2_PIX_FMT_Y16_BE, \"Y16 -BE\" }\n>  \t\t};\n>  \n> -\t\tfor (const auto &format : formats) {\n> -\t\t\tif (V4L2PixelFormat(format.first).toString() != format.second) {\n> +\t\tfor (const auto &fmt : formats) {\n> +\t\t\tif (V4L2PixelFormat(fmt.first).toString() != fmt.second) {\n>  \t\t\t\tcerr << \"Failed to convert V4L2PixelFormat\"\n> -\t\t\t\t     << utils::hex(format.first) << \"to string\"\n> +\t\t\t\t     << utils::hex(fmt.first) << \"to string\"\n>  \t\t\t\t     << endl;\n>  \t\t\t\treturn TestFail;\n>  \t\t\t}\n> -- \n> 2.25.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C5C62BEEE0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Oct 2020 12:29:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9285460E79;\n\tWed, 14 Oct 2020 14:29:48 +0200 (CEST)","from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 578C560354\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Oct 2020 14:29:47 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id c21so2937593ljn.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Oct 2020 05:29:47 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tg14sm1078733lfb.307.2020.10.14.05.29.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 14 Oct 2020 05:29:46 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"CQ6Bp3JS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=JY3iy53zSY4VYNWVjqydeWJ0LiMVpYsTwVOCN47mSkY=;\n\tb=CQ6Bp3JS7iUu3vNICSgX5EEyy74YlyrX+ETzOzsFKBaPW/L7JOQ0F6tIF5ns8KVEPg\n\tqeo251m9jeLBed05vajujFdGEpPSW97yC75YYfocncWmU07q9RLZV2qfQ9uBoObvDmkt\n\tAxvc9n322kOX8JQ4ozf7/sw0cLzphlW92WzfPxlEJpol2C3xwchzMuId+57lkBW9jTM5\n\tI+lq+OoywN6T+RmBCI7vTeWgUzCGwtqSpgVHc+m0SGvrXKFf3m8XMCyvXpk0SF8kB9fi\n\tH78Uum5JYdlLloV3O55bhKnrEWUDoT0jSNVYS31GCmTsGS7ghlfdNnYqAx22HpqsJzTu\n\tpPew==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=JY3iy53zSY4VYNWVjqydeWJ0LiMVpYsTwVOCN47mSkY=;\n\tb=oIQKkvdor+TvvGQZU6DV4ytXrP99Uwh8a/THLPNV2JRo66EYGOPXiM4P8EqSx4U6Cx\n\tKxewefaPq5MwQcdtxBuYW7E2NWxH2x2JD0iUFzQ+iva9Ki47Mh9LTk50fE6EoBUyha6v\n\tr9sP446ObX41HYeB16+k6lfH/vsCEVO+pQOhcl0DLInxyZW8R6O4IQ5pktbCAa9Tj+w9\n\t0SdbMVMcWLTJ4WAR26Da7SDNGEO8BUbX1UPRqhU6rqhJRQu+aNYmEnBNRPoTBs4kITpt\n\tGsn3B0sJ5xHdEhhx8aF+jll3BlKMrE6kdZIJRQY1AI2KU1L5/+0nNeE1IC321Z93fq0Z\n\tVGcA==","X-Gm-Message-State":"AOAM5302rkXe9thu9H7CvnzbNpixWSXKEPwfshXFtyCn+IuWhJ6GAsaa\n\tl9kfII23cKOsTCSCXMAVI/OKEw==","X-Google-Smtp-Source":"ABdhPJwQREsgQceN5gkX7XYEtYh5Zp+CV9vnvEzOr4CYNU7OtdVlhUw3x9uFfkuPl2fkU//4aW420Q==","X-Received":"by 2002:a2e:504b:: with SMTP id\n\tv11mr1653900ljd.138.1602678586832; \n\tWed, 14 Oct 2020 05:29:46 -0700 (PDT)","Date":"Wed, 14 Oct 2020 14:29:45 +0200","From":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20201014122945.45jujcqeqifaop3r@oden.dyn.berto.se>","References":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>\n\t<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 07/10] test: v4l2_videodevice: Prevent\n\tvariable aliasing of format","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":13213,"web_url":"https://patchwork.libcamera.org/comment/13213/","msgid":"<20201015133923.GD3957@pendragon.ideasonboard.com>","date":"2020-10-15T13:39:23","subject":"Re: [libcamera-devel] [PATCH 07/10] test: v4l2_videodevice: Prevent\n\tvariable aliasing of format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Tue, Oct 13, 2020 at 04:12:38PM +0100, Kieran Bingham wrote:\n> Rename the scoped usage of the variable format while iterating the formats\n> as it aliases the outer scoped format which is used for specific testing.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  test/v4l2_videodevice/formats.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/test/v4l2_videodevice/formats.cpp b/test/v4l2_videodevice/formats.cpp\n> index 043732dcaba1..e3283cf92bff 100644\n> --- a/test/v4l2_videodevice/formats.cpp\n> +++ b/test/v4l2_videodevice/formats.cpp\n> @@ -55,10 +55,10 @@ protected:\n>  \t\t\t{ V4L2_PIX_FMT_Y16_BE, \"Y16 -BE\" }\n>  \t\t};\n>  \n> -\t\tfor (const auto &format : formats) {\n> -\t\t\tif (V4L2PixelFormat(format.first).toString() != format.second) {\n> +\t\tfor (const auto &fmt : formats) {\n> +\t\t\tif (V4L2PixelFormat(fmt.first).toString() != fmt.second) {\n>  \t\t\t\tcerr << \"Failed to convert V4L2PixelFormat\"\n> -\t\t\t\t     << utils::hex(format.first) << \"to string\"\n> +\t\t\t\t     << utils::hex(fmt.first) << \"to string\"\n>  \t\t\t\t     << endl;\n>  \t\t\t\treturn TestFail;\n>  \t\t\t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1B8FEBE174\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Oct 2020 13:40:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DBC8360E8D;\n\tThu, 15 Oct 2020 15:40:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 87CDB605BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Oct 2020 15:40:09 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 26A6D556;\n\tThu, 15 Oct 2020 15:40:09 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CS+vqmKg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1602769209;\n\tbh=tYNhreWxbcR2ggh1cPdmAqG8K32trDryRSmbLLQrX2Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CS+vqmKgMCm4FKAAPafLuMjprtnKHi+iy5rTOnJPzfjHHLo/bnzvwCdyQkIT9CImh\n\tMFx20pKR8fQBq2cyR+hty7z8LiyATw2NqSCKin0wk+Pd9piww1bhtauHZ8N9RmfZx3\n\t0f/B1stlrFxL2wrM+LgiqNA9gAn0y4HxClDkd4XE=","Date":"Thu, 15 Oct 2020 16:39:23 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20201015133923.GD3957@pendragon.ideasonboard.com>","References":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>\n\t<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 07/10] test: v4l2_videodevice: Prevent\n\tvariable aliasing of format","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]