[{"id":23021,"web_url":"https://patchwork.libcamera.org/comment/23021/","msgid":"<165282972353.2416244.7220552676856501886@Monstersaurus>","date":"2022-05-17T23:22:03","subject":"Re: [libcamera-devel] [PATCH v8 2/4] cam: event_loop: Rename\n\taddEvent to addFDEvent","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Eric Curtin via libcamera-devel (2022-05-05 16:18:49)\n> Since we now have two types of events addFDEvent and addTimerEvent.\n> \n\nI think this could be expanded a little:\n\n\"\"\"\nWith the addition of addTimerEvent, the naming of addEvent is specific\nto the management of an fd, while the naming is generic.\n\nUpdate the name to make the naming scheme consistent in specifying the\ntype of event to be added.\n\"\"\"\n\nBut that's optional, and could be adapted as best fits.\n\nIt looks like the change is fine so:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> ---\n>  src/cam/drm.cpp        | 4 ++--\n>  src/cam/event_loop.cpp | 4 ++--\n>  src/cam/event_loop.h   | 4 ++--\n>  3 files changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp\n> index 46e34eb5..421cd61a 100644\n> --- a/src/cam/drm.cpp\n> +++ b/src/cam/drm.cpp\n> @@ -432,8 +432,8 @@ int Device::init()\n>         if (ret < 0)\n>                 return ret;\n>  \n> -       EventLoop::instance()->addEvent(fd_, EventLoop::Read,\n> -                                       std::bind(&Device::drmEvent, this));\n> +       EventLoop::instance()->addFDEvent(fd_, EventLoop::Read,\n> +                                         std::bind(&Device::drmEvent, this));\n>  \n>         return 0;\n>  }\n> diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> index 181c971c..0c2176c7 100644\n> --- a/src/cam/event_loop.cpp\n> +++ b/src/cam/event_loop.cpp\n> @@ -64,8 +64,8 @@ void EventLoop::callLater(const std::function<void()> &func)\n>         event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n>  }\n>  \n> -void EventLoop::addEvent(int fd, EventType type,\n> -                        const std::function<void()> &callback)\n> +void EventLoop::addFDEvent(int fd, EventType type,\n> +                          const std::function<void()> &callback)\n>  {\n>         std::unique_ptr<Event> event = std::make_unique<Event>(callback);\n>         short events = (type & Read ? EV_READ : 0)\n> diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> index 89215dce..d921cd8f 100644\n> --- a/src/cam/event_loop.h\n> +++ b/src/cam/event_loop.h\n> @@ -36,8 +36,8 @@ public:\n>  \n>         void callLater(const std::function<void()> &func);\n>  \n> -       void addEvent(int fd, EventType type,\n> -                     const std::function<void()> &handler);\n> +       void addFDEvent(int fd, EventType type,\n> +                       const std::function<void()> &handler);\n>  \n>         void addTimerEvent(const std::chrono::milliseconds d,\n>                            const std::function<void()> &handler);\n> -- \n> 2.35.1\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 BA56FC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 23:22:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F18F965657;\n\tWed, 18 May 2022 01:22:07 +0200 (CEST)","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 D7FF16150E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 01:22:05 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F4E44A8;\n\tWed, 18 May 2022 01:22:05 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652829728;\n\tbh=2Xh9rSF2+PyJDygZN0V0DgT3C/WqAsXujCFuwWz9S3A=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=lhVyZLcCmUZjtgg6PEB3ZV0UPZX6RR7Dg2QAVZSQHYW6/kVh/y+divjtDOqqH54Gz\n\t3JSqCcGzxAdsjJWaq6u2cC9jnqo2hUqvM8Kly/9aSjXcX7pYAI0XX+KIl+DLw5QiO3\n\tsdABYzsBihpiZG1iJT1j1TClD15fWxid5QJCFpW9/Ww82ajcY+VGKdvwvlKiEErzuI\n\t9aC9sLT7CXRDTJzMxnQBMZmYo5xnsA2O4ZtN4elsnZkrudpp3FVJcFcA5UBHIvC41d\n\tTTtfdiOVHoLrYLml4TOq3j/vCYC+x8f9KiMN3Dj+O2bRxIxYy1sP2YyMKU65NwQKvf\n\tfkONx/8DdqoMg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652829725;\n\tbh=2Xh9rSF2+PyJDygZN0V0DgT3C/WqAsXujCFuwWz9S3A=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Kt5xAEw4cDSjDYy07IPLc99oKEAwd5bASxU+BHqslzK3Zfg2s5+Zy8WCKKYRQRcIQ\n\tlmW/azH9iGCwhrjTpzIyKkIrSiZ5VbxMRvCV+NMr5OKhDSZ5bVqqhdwgsaNnkFnqn0\n\tvyIJlFCDlYRhpc2W9O1ylUhF6bCo94NYqYVE2RKs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Kt5xAEw4\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220505151851.2421-2-ecurtin@redhat.com>","References":"<20220505151851.2421-1-ecurtin@redhat.com>\n\t<20220505151851.2421-2-ecurtin@redhat.com>","To":"Eric Curtin <ecurtin@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Wed, 18 May 2022 00:22:03 +0100","Message-ID":"<165282972353.2416244.7220552676856501886@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v8 2/4] cam: event_loop: Rename\n\taddEvent to addFDEvent","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23073,"web_url":"https://patchwork.libcamera.org/comment/23073/","msgid":"<YoVI4tgT8MzGODjH@pendragon.ideasonboard.com>","date":"2022-05-18T19:28:34","subject":"Re: [libcamera-devel] [PATCH v8 2/4] cam: event_loop: Rename\n\taddEvent to addFDEvent","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, May 18, 2022 at 12:22:03AM +0100, Kieran Bingham via libcamera-devel wrote:\n> Quoting Eric Curtin via libcamera-devel (2022-05-05 16:18:49)\n> > Since we now have two types of events addFDEvent and addTimerEvent.\n> \n> I think this could be expanded a little:\n> \n> \"\"\"\n> With the addition of addTimerEvent, the naming of addEvent is specific\n> to the management of an fd, while the naming is generic.\n> \n> Update the name to make the naming scheme consistent in specifying the\n> type of event to be added.\n> \"\"\"\n\nLooks good to me.\n\nI would actually have moved this patch first in the series, but that\nrequires rewording the commit message, it's not worth the effort at this\npoint.\n\n> But that's optional, and could be adapted as best fits.\n> \n> It looks like the change is fine so:\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> \n> > Signed-off-by: Eric Curtin <ecurtin@redhat.com>\n> > ---\n> >  src/cam/drm.cpp        | 4 ++--\n> >  src/cam/event_loop.cpp | 4 ++--\n> >  src/cam/event_loop.h   | 4 ++--\n> >  3 files changed, 6 insertions(+), 6 deletions(-)\n> > \n> > diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp\n> > index 46e34eb5..421cd61a 100644\n> > --- a/src/cam/drm.cpp\n> > +++ b/src/cam/drm.cpp\n> > @@ -432,8 +432,8 @@ int Device::init()\n> >         if (ret < 0)\n> >                 return ret;\n> >  \n> > -       EventLoop::instance()->addEvent(fd_, EventLoop::Read,\n> > -                                       std::bind(&Device::drmEvent, this));\n> > +       EventLoop::instance()->addFDEvent(fd_, EventLoop::Read,\n> > +                                         std::bind(&Device::drmEvent, this));\n> >  \n> >         return 0;\n> >  }\n> > diff --git a/src/cam/event_loop.cpp b/src/cam/event_loop.cpp\n> > index 181c971c..0c2176c7 100644\n> > --- a/src/cam/event_loop.cpp\n> > +++ b/src/cam/event_loop.cpp\n> > @@ -64,8 +64,8 @@ void EventLoop::callLater(const std::function<void()> &func)\n> >         event_base_once(base_, -1, EV_TIMEOUT, dispatchCallback, this, nullptr);\n> >  }\n> >  \n> > -void EventLoop::addEvent(int fd, EventType type,\n> > -                        const std::function<void()> &callback)\n> > +void EventLoop::addFDEvent(int fd, EventType type,\n\nThe function should be named addFdEvent().\n\nWith this changed and the commit message updated,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > +                          const std::function<void()> &callback)\n> >  {\n> >         std::unique_ptr<Event> event = std::make_unique<Event>(callback);\n> >         short events = (type & Read ? EV_READ : 0)\n> > diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h\n> > index 89215dce..d921cd8f 100644\n> > --- a/src/cam/event_loop.h\n> > +++ b/src/cam/event_loop.h\n> > @@ -36,8 +36,8 @@ public:\n> >  \n> >         void callLater(const std::function<void()> &func);\n> >  \n> > -       void addEvent(int fd, EventType type,\n> > -                     const std::function<void()> &handler);\n> > +       void addFDEvent(int fd, EventType type,\n> > +                       const std::function<void()> &handler);\n> >  \n> >         void addTimerEvent(const std::chrono::milliseconds d,\n> >                            const std::function<void()> &handler);","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 51EAEC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 19:28:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E55E6565B;\n\tWed, 18 May 2022 21:28:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F95E65656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 21:28:42 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CB8A21BBB;\n\tWed, 18 May 2022 21:28:41 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652902123;\n\tbh=KaAufvttEEFvwNHPPrK2bM+QbO4VJdiFSbtDjhWEOS4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=IIxIw65+LC2DsSVflK/JMnBpgpGBElEFIV+YwqPK/iSYne3e7PUkxCDmVVFhG+ZIv\n\tRTrkZuRbwn4CEZ/N/5WyHUWDkNcBmuz6LG94ebzT3wHaJOMKUZpmryNU1cg7gJWtJX\n\tUm5YezNSrP5Nve2azVjGTFebM9EQbZqc1sXYDHzdZP0Sw3xMgm44JZRYJxPi0kCCU9\n\tfAszvBL20Ylge3ctSAtJGtCF/H2uatU4QlpsWHmlwufMznhmQ9fa02lWmp4p2fW4Z4\n\tJ1ICAQIkZpikZUU5gKKtOvfaWCYAp2YBjJPEac+pUlmv2mu88FjvdIqojB9e2/3456\n\tgzPMpJB5mlVkA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652902122;\n\tbh=KaAufvttEEFvwNHPPrK2bM+QbO4VJdiFSbtDjhWEOS4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uQTa6QskYKVLu2s1TApU1VUVfAoR9X3+hyPFLD+3DEsrZNLwB4GqCFbGB5EiZZqNg\n\t/AhauUwWEU0YGive4ZdC0oHs5yf/gYpX/+8T0sLl7PkSi7JT/iCX39aRWWfnG3CcQg\n\tIesvx6uVfQCWQY126sflCUF/KsOpeNJeuBsDE3j8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"uQTa6Qsk\"; dkim-atps=neutral","Date":"Wed, 18 May 2022 22:28:34 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YoVI4tgT8MzGODjH@pendragon.ideasonboard.com>","References":"<20220505151851.2421-1-ecurtin@redhat.com>\n\t<20220505151851.2421-2-ecurtin@redhat.com>\n\t<165282972353.2416244.7220552676856501886@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<165282972353.2416244.7220552676856501886@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v8 2/4] cam: event_loop: Rename\n\taddEvent to addFDEvent","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]