[{"id":2235,"web_url":"https://patchwork.libcamera.org/comment/2235/","msgid":"<20190712202000.GB31080@localhost.localdomain>","date":"2019-07-12T20:20:00","subject":"Re: [libcamera-devel] [PATCH] libcamera: ipa_module: Fix open\n\tsource licence verification","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Niklas,\n\nThanks for the patch.\n\nOn Sat, Jul 13, 2019 at 04:42:07AM +0900, Niklas Söderlund wrote:\n> The second argument to std::array is the size of the array, not of the\n> elements it contains. Fix this by turning the std::array into a simple\n> array of const char pointers.\n\nSorry about that :/\n\n> Fixes: 099815b85377ac68 (\"libcamera: ipa_module: add isOpenSource\")\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nThat's much better than what I had :)\n\nLooks good to me.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/libcamera/ipa_module.cpp | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\n> index 93bb4889023bb433..f9e0896cb84eab0d 100644\n> --- a/src/libcamera/ipa_module.cpp\n> +++ b/src/libcamera/ipa_module.cpp\n> @@ -22,6 +22,7 @@\n>  \n>  #include \"log.h\"\n>  #include \"pipeline_handler.h\"\n> +#include \"utils.h\"\n>  \n>  /**\n>   * \\file ipa_module.h\n> @@ -478,7 +479,7 @@ bool IPAModule::match(PipelineHandler *pipe,\n>   */\n>  bool IPAModule::isOpenSource() const\n>  {\n> -\tstatic std::array<const char *, sizeof(char *)> osLicenses = {\n> +\tstatic const char *osLicenses[] = {\n>  \t\t\"GPL-2.0-only\",\n>  \t\t\"GPL-2.0-or-later\",\n>  \t\t\"GPL-3.0-only\",\n> @@ -489,8 +490,11 @@ bool IPAModule::isOpenSource() const\n>  \t\t\"LGPL-3.0-or-later\",\n>  \t};\n>  \n> -\treturn std::find(osLicenses.begin(), osLicenses.end(), info_.license)\n> -\t       != osLicenses.end();\n> +\tfor (unsigned int i = 0; i < ARRAY_SIZE(osLicenses); i++)\n> +\t\tif (!strcmp(osLicenses[i], info_.license))\n> +\t\t\treturn true;\n> +\n> +\treturn false;\n>  }\n>  \n>  } /* namespace libcamera */\n> -- \n> 2.22.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4B1261607\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Jul 2019 22:20:16 +0200 (CEST)","from localhost.localdomain (softbank126209254147.bbtec.net\n\t[126.209.254.147])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2359A2B2;\n\tFri, 12 Jul 2019 22:20:07 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1562962809;\n\tbh=Aou9wkFUxRVd9pcIaM4aLSZs65N3oLGeg9DL3tahhwY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LG36RCnfl9P1VYDt8HL+gn8zHE3NBDnS7TjDBVLnvN9wsEEQhY9+/QCbLJYI6XlEL\n\ttwSRERnEJxT9dMDr3NegSuu3w0zTyu/ArWxCzcfbPvJ32WzSCqPI8CdqknWv0GQhZV\n\tkIf6p8zrQYTOSOIed6aEC49z0+DGCPtDCZnzlKe0=","Date":"Sat, 13 Jul 2019 05:20:00 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190712202000.GB31080@localhost.localdomain>","References":"<20190712194207.2806-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190712194207.2806-1-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: ipa_module: Fix open\n\tsource licence verification","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Fri, 12 Jul 2019 20:20:17 -0000"}},{"id":2237,"web_url":"https://patchwork.libcamera.org/comment/2237/","msgid":"<20190713041053.GF9317@wyvern>","date":"2019-07-13T04:10:53","subject":"Re: [libcamera-devel] [PATCH] libcamera: ipa_module: Fix open\n\tsource licence verification","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi,\n\nOn 2019-07-13 05:20:00 +0900, Paul Elder wrote:\n> Hi Niklas,\n> \n> Thanks for the patch.\n> \n> On Sat, Jul 13, 2019 at 04:42:07AM +0900, Niklas Söderlund wrote:\n> > The second argument to std::array is the size of the array, not of the\n> > elements it contains. Fix this by turning the std::array into a simple\n> > array of const char pointers.\n> \n> Sorry about that :/\n> \n> > Fixes: 099815b85377ac68 (\"libcamera: ipa_module: add isOpenSource\")\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> That's much better than what I had :)\n> \n> Looks good to me.\n> \n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\nThanks, I have pushed this with your tag.\n\n> \n> > ---\n> >  src/libcamera/ipa_module.cpp | 10 +++++++---\n> >  1 file changed, 7 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\n> > index 93bb4889023bb433..f9e0896cb84eab0d 100644\n> > --- a/src/libcamera/ipa_module.cpp\n> > +++ b/src/libcamera/ipa_module.cpp\n> > @@ -22,6 +22,7 @@\n> >  \n> >  #include \"log.h\"\n> >  #include \"pipeline_handler.h\"\n> > +#include \"utils.h\"\n> >  \n> >  /**\n> >   * \\file ipa_module.h\n> > @@ -478,7 +479,7 @@ bool IPAModule::match(PipelineHandler *pipe,\n> >   */\n> >  bool IPAModule::isOpenSource() const\n> >  {\n> > -\tstatic std::array<const char *, sizeof(char *)> osLicenses = {\n> > +\tstatic const char *osLicenses[] = {\n> >  \t\t\"GPL-2.0-only\",\n> >  \t\t\"GPL-2.0-or-later\",\n> >  \t\t\"GPL-3.0-only\",\n> > @@ -489,8 +490,11 @@ bool IPAModule::isOpenSource() const\n> >  \t\t\"LGPL-3.0-or-later\",\n> >  \t};\n> >  \n> > -\treturn std::find(osLicenses.begin(), osLicenses.end(), info_.license)\n> > -\t       != osLicenses.end();\n> > +\tfor (unsigned int i = 0; i < ARRAY_SIZE(osLicenses); i++)\n> > +\t\tif (!strcmp(osLicenses[i], info_.license))\n> > +\t\t\treturn true;\n> > +\n> > +\treturn false;\n> >  }\n> >  \n> >  } /* namespace libcamera */\n> > -- \n> > 2.22.0\n> > \n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-pg1-x541.google.com (mail-pg1-x541.google.com\n\t[IPv6:2607:f8b0:4864:20::541])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E40D96156A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2019 06:10:59 +0200 (CEST)","by mail-pg1-x541.google.com with SMTP id q4so5397046pgj.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Jul 2019 21:10:59 -0700 (PDT)","from localhost (softbank126209254147.bbtec.net. [126.209.254.147])\n\tby smtp.gmail.com with ESMTPSA id\n\tj16sm8086877pjz.31.2019.07.12.21.10.56\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tFri, 12 Jul 2019 21:10:57 -0700 (PDT)"],"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\t:user-agent; bh=VTdAvnHQODiLaE1LgaPvpS8x5N96yUeSsiOLOyirQeI=;\n\tb=LCKZCG+9+iNR5fxmPxXwsh44Ob0RE5Bn1OqTMn8tpXHwls/meCaJiczqUPWMfMrsux\n\t9BGjxfG57sgw+TmsYNPwpZQFRlsBYJlmto4MBLzLhB4KbH6Z9l03OS26r73c2Z9UezoT\n\tjRdRCQEg4tj0GPb9ZF5kvA1nLawtim8492R3uN44BOUtvH8N/H5ZGhwXok73R9fEL2h4\n\tHv4yw0t8dnsnqadEqSlxoZHHuqB2FMcGZxae1db9+xr1VT/K0JRU3OJSnQGM3Qr/crV8\n\tqYwqCB+d/MUZg/OmVnGdGUjgQw/GOcWkY+dZLbKWp8uGS68HKhr7yf0DgwKVWmbWRQOv\n\tsqXg==","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:user-agent;\n\tbh=VTdAvnHQODiLaE1LgaPvpS8x5N96yUeSsiOLOyirQeI=;\n\tb=JRieRc4OYuZ97op/dLbJYb4J99x88u9KDINCCiyYp6BZkB3m7LAXnpBLifnYM5l+8r\n\tdJJf/oQ6KKDl4UI46N5ZyD7pd5vI/GqpElqFHFiYyddYNZbiI7ZtBvN5zJT0c217asNJ\n\tipve85qV/8bV9uX+VAZMNd0vIg+0r5fHfsxRltogFAc6POpob8nzm/Y9x0mfoB8r0Ir8\n\tD46CagrDOPFLXI9ToqJQByP+NSbecXi1YI1OwI7lN+IM59b/rOCwR7bpc7+R9U42t4PZ\n\t9wbQ/Z5scacXGdicw+edwNLpph182cyVLsCnDMg/y8FbRH4w9qzKHEVztmWpdJIl2gO9\n\tbO+Q==","X-Gm-Message-State":"APjAAAXUeFRamexgZpGDc4vRc4Hpl6m3OBFy7aKdse0nCt8sK2fWTec0\n\tKh5iL6LdhdxhKmjDUgeRrUs=","X-Google-Smtp-Source":"APXvYqxXsVTgYmHiUD18YbH/IgRrsN6xseVn9g0Kx8R9p1qM0vvAhRL4gzilcoIU4oumF6WVRl4dXg==","X-Received":"by 2002:a63:1908:: with SMTP id\n\tz8mr14554617pgl.433.1562991057970; \n\tFri, 12 Jul 2019 21:10:57 -0700 (PDT)","Date":"Sat, 13 Jul 2019 13:10:53 +0900","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190713041053.GF9317@wyvern>","References":"<20190712194207.2806-1-niklas.soderlund@ragnatech.se>\n\t<20190712202000.GB31080@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190712202000.GB31080@localhost.localdomain>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: ipa_module: Fix open\n\tsource licence verification","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Sat, 13 Jul 2019 04:11:00 -0000"}}]