[{"id":13739,"web_url":"https://patchwork.libcamera.org/comment/13739/","msgid":"<CAEmqJPp_ca0ZGq0BMaZj1JPfVD4VX3wy8JuENxxp=bo=8J1aWw@mail.gmail.com>","date":"2020-11-17T10:58:45","subject":"Re: [libcamera-devel] [PATCH 08/10] libcamera: src: ipa:\n\traspberrypi: agc: Fix uninitialised members in status_","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nOn Mon, 16 Nov 2020 at 16:49, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> Use memset in the constructor, it is tidier and initialises\n> everything.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/ipa/raspberrypi/controller/rpi/agc.cpp | 13 ++++++-------\n>  1 file changed, 6 insertions(+), 7 deletions(-)\n>\n> diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> index 7c7944e8..1037f968 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n> @@ -157,14 +157,13 @@ Agc::Agc(Controller *controller)\n>           exposure_mode_(nullptr), constraint_mode_(nullptr),\n>           frame_count_(0), lock_count_(0)\n>  {\n> +       // Setting status_.total_exposure_value_ to zero initially tells us\n> +       // it's not been calculated yet (i.e. Process hasn't yet run).\n> +       memset(&status_, 0, sizeof(status_));\n>         ev_ = status_.ev = 1.0;\n> -       flicker_period_ = status_.flicker_period = 0.0;\n> -       fixed_shutter_ = status_.fixed_shutter = 0;\n> -       fixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0;\n> -       // set to zero initially, so we can tell it's not been calculated\n> -       status_.total_exposure_value = 0.0;\n> -       status_.target_exposure_value = 0.0;\n> -       status_.locked = false;\n> +       flicker_period_ = 0.0;\n> +       fixed_shutter_ = 0;\n> +       fixed_analogue_gain_ = 0.0;\n>\n\nMinor nit, but could these be initialised by the constructor's initialiser\nlist?  Apart from that:\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n>  }\n>\n>  char const *Agc::Name() const\n> --\n> 2.20.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\n>","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 18AC8BE081\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Nov 2020 10:59:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6DBF63329;\n\tTue, 17 Nov 2020 11:59:03 +0100 (CET)","from mail-lf1-x134.google.com (mail-lf1-x134.google.com\n\t[IPv6:2a00:1450:4864:20::134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D7F263320\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Nov 2020 11:59:02 +0100 (CET)","by mail-lf1-x134.google.com with SMTP id d17so29467432lfq.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Nov 2020 02:59:02 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"gsxlc9SN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=kIx5D5vz91L2gr27Mj1470RI0uCCtf3sCXSg1M5AmSE=;\n\tb=gsxlc9SNOBcf8QaHWCoz5ivh4VZnzkViWiknT2T6KxRKo7jtO+zoDS0oUALA6fHYiv\n\tNMsr+vqODYBrYhumoKucNxUAXUdjPHXCShxeqA1EVIkeEzbPmSL33lCO5uH9Vht7i/1u\n\tTWr79EXldL6qQErQ9V9X6kQnvOSoxVmnNtxvUp85RIf395JCtr0+u9RYcmT3IgUO5s05\n\th4YGrxGdFSNp4AfVagrvLxBLUw8ZJrmf+LH4O5ff49qvEmXa8xOY5o+DN474GKREJ4RX\n\tS1NTsKLfyEsJ9ahPHAPqbmjPGXTthpfqjSzTB6rMIgOMlQS8sa0lph48xUgNZocsj2/m\n\tzcNQ==","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:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=kIx5D5vz91L2gr27Mj1470RI0uCCtf3sCXSg1M5AmSE=;\n\tb=sr6i9v3UvVW1ZHc3mlTpT4T29ZoNfuULo1E6keJoaHjJgxVSh/8JFA/YO24Tz/bShL\n\tvqDfngYuMuTAxH85hdqKhkhVEF6evjeiXgGSbCKNKb5bE3IxtyodtDJ9Rn7tqvom1fA5\n\tEAZO2p9ZRT/IlkGCHWI9v23LVJO5SgWt6bmucrd9Iw5Mi9hYQLbm52+rb6kIWedm2C56\n\tnfKqZdvxsWHmnOFzFPXyJI9wKyIq8hcsMPUbw8renaArb+se5pbJ8bLqMiFHuDx+y5cl\n\tk16nSYUuD7Or8SqCPKHh9cqn7RFx1d4KxSoBMfY2h7B0GtVzrRX1G4DjUzkvi1NVWYwm\n\t2HIw==","X-Gm-Message-State":"AOAM533vCYBe6evE1Jt4yoRu+65UwBgWBKZTobkHz/41lvTgFY22ci+6\n\tDqJYiwYyFUJSN0Sxy8NmIuUjpP58rcaCB27Rn0AxAY8WFDc=","X-Google-Smtp-Source":"ABdhPJx/gPurmhIIDbC2gRI/qIeN3+Qs9YUxLEnMNV31GYWaRrv/2xINlB5ug451FO3woH1iQaXlh2YUqmng4AgSSYg=","X-Received":"by 2002:ac2:53ad:: with SMTP id\n\tj13mr1420926lfh.177.1605610741790; \n\tTue, 17 Nov 2020 02:59:01 -0800 (PST)","MIME-Version":"1.0","References":"<20201116164918.2055-1-david.plowman@raspberrypi.com>\n\t<20201116164918.2055-9-david.plowman@raspberrypi.com>","In-Reply-To":"<20201116164918.2055-9-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 17 Nov 2020 10:58:45 +0000","Message-ID":"<CAEmqJPp_ca0ZGq0BMaZj1JPfVD4VX3wy8JuENxxp=bo=8J1aWw@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 08/10] libcamera: src: ipa:\n\traspberrypi: agc: Fix uninitialised members in status_","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@lists.libcamera.org","Content-Type":"multipart/mixed;\n\tboundary=\"===============8054097643265535381==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]