Message ID | 20210923115558.31107-1-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Laurent, On Thu, Sep 23, 2021 at 02:55:58PM +0300, Laurent Pinchart wrote: > The FrameBuffer class has no constructor that takes an rvalue reference > to planes. The std::move() is thus misleading as a copy will still take > place. Drop it to clarify the code, no functional change is introduced. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Indeed! Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > --- > src/libcamera/v4l2_videodevice.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > index 9b3ee88757be..ba5f88cd41ed 100644 > --- a/src/libcamera/v4l2_videodevice.cpp > +++ b/src/libcamera/v4l2_videodevice.cpp > @@ -1376,7 +1376,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) > } > } > > - return std::make_unique<FrameBuffer>(std::move(planes)); > + return std::make_unique<FrameBuffer>(planes); > } > > FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index, > > base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf > -- > Regards, > > Laurent Pinchart >
Hi Laurent, Thank you for the patch. On 9/23/21 5:25 PM, Laurent Pinchart wrote: > The FrameBuffer class has no constructor that takes an rvalue reference > to planes. The std::move() is thus misleading as a copy will still take > place. Drop it to clarify the code, no functional change is introduced. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/libcamera/v4l2_videodevice.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > index 9b3ee88757be..ba5f88cd41ed 100644 > --- a/src/libcamera/v4l2_videodevice.cpp > +++ b/src/libcamera/v4l2_videodevice.cpp > @@ -1376,7 +1376,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) > } > } > > - return std::make_unique<FrameBuffer>(std::move(planes)); > + return std::make_unique<FrameBuffer>(planes); Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> > } > > FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index, > > base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf
Hi Laurent, On Thu, Sep 23, 2021 at 02:55:58PM +0300, Laurent Pinchart wrote: > The FrameBuffer class has no constructor that takes an rvalue reference > to planes. The std::move() is thus misleading as a copy will still take > place. Drop it to clarify the code, no functional change is introduced. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/libcamera/v4l2_videodevice.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp > index 9b3ee88757be..ba5f88cd41ed 100644 > --- a/src/libcamera/v4l2_videodevice.cpp > +++ b/src/libcamera/v4l2_videodevice.cpp > @@ -1376,7 +1376,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) > } > } > > - return std::make_unique<FrameBuffer>(std::move(planes)); > + return std::make_unique<FrameBuffer>(planes); > } > > FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index, > > base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf > -- > Regards, > > Laurent Pinchart >
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 9b3ee88757be..ba5f88cd41ed 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1376,7 +1376,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) } } - return std::make_unique<FrameBuffer>(std::move(planes)); + return std::make_unique<FrameBuffer>(planes); } FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index,
The FrameBuffer class has no constructor that takes an rvalue reference to planes. The std::move() is thus misleading as a copy will still take place. Drop it to clarify the code, no functional change is introduced. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/libcamera/v4l2_videodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 2cc4303b172a76ac5b431c4fb4df8a083f7d3fcf