[libcamera-devel,v2] libcamera: request: Rename Private::reuse() to Private::reset()
diff mbox series

Message ID 20220830133321.1107312-1-umang.jain@ideasonboard.com
State Accepted
Delegated to: Umang Jain
Headers show
Series
  • [libcamera-devel,v2] libcamera: request: Rename Private::reuse() to Private::reset()
Related show

Commit Message

Umang Jain Aug. 30, 2022, 1:33 p.m. UTC
The Request::Private::reuse() is different from Request::reuse().
It reset the members of Request::Private to default values hence,
rename it to more appropriate Request::Private::reset().

Update the usage and documentation accordingly.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes in v2:
- Overhaul the patch by renaming Private::reuse() to reset()

v1: [PATCH] libcamera: request: Fix doxygen warning
---
 include/libcamera/internal/request.h | 2 +-
 src/libcamera/request.cpp            | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Kieran Bingham Aug. 31, 2022, 1:30 p.m. UTC | #1
Quoting Umang Jain via libcamera-devel (2022-08-30 14:33:21)
> The Request::Private::reuse() is different from Request::reuse().
> It reset the members of Request::Private to default values hence,

s/reset/resets/

> rename it to more appropriate Request::Private::reset().

/it to more/it to a more/

> 
> Update the usage and documentation accordingly.
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Looks good to me, the very trivial minors above could be fixed before
applying, no need for a v3 I don't think.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
> Changes in v2:
> - Overhaul the patch by renaming Private::reuse() to reset()
> 
> v1: [PATCH] libcamera: request: Fix doxygen warning
> ---
>  include/libcamera/internal/request.h | 2 +-
>  src/libcamera/request.cpp            | 9 ++++++---
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
> index 9dadd6c6..8c92a27a 100644
> --- a/include/libcamera/internal/request.h
> +++ b/include/libcamera/internal/request.h
> @@ -37,7 +37,7 @@ public:
>         bool completeBuffer(FrameBuffer *buffer);
>         void complete();
>         void cancel();
> -       void reuse();
> +       void reset();
>  
>         void prepare(std::chrono::milliseconds timeout = 0ms);
>         Signal<> prepared;
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index d2af1d22..949c556f 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -158,9 +158,12 @@ void Request::Private::cancel()
>  }
>  
>  /**
> - * \copydoc Request::reuse()
> + * \brief Reset the request internal data to default values
> + *
> + * After calling this function, all request internal data will have default
> + * values as if the Request::Private instance had just been constructed.
>   */
> -void Request::Private::reuse()
> +void Request::Private::reset()
>  {
>         sequence_ = 0;
>         cancelled_ = false;
> @@ -380,7 +383,7 @@ void Request::reuse(ReuseFlag flags)
>  {
>         LIBCAMERA_TRACEPOINT(request_reuse, this);
>  
> -       _d()->reuse();
> +       _d()->reset();
>  
>         if (flags & ReuseBuffers) {
>                 for (auto pair : bufferMap_) {
> -- 
> 2.37.2
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
index 9dadd6c6..8c92a27a 100644
--- a/include/libcamera/internal/request.h
+++ b/include/libcamera/internal/request.h
@@ -37,7 +37,7 @@  public:
 	bool completeBuffer(FrameBuffer *buffer);
 	void complete();
 	void cancel();
-	void reuse();
+	void reset();
 
 	void prepare(std::chrono::milliseconds timeout = 0ms);
 	Signal<> prepared;
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index d2af1d22..949c556f 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -158,9 +158,12 @@  void Request::Private::cancel()
 }
 
 /**
- * \copydoc Request::reuse()
+ * \brief Reset the request internal data to default values
+ *
+ * After calling this function, all request internal data will have default
+ * values as if the Request::Private instance had just been constructed.
  */
-void Request::Private::reuse()
+void Request::Private::reset()
 {
 	sequence_ = 0;
 	cancelled_ = false;
@@ -380,7 +383,7 @@  void Request::reuse(ReuseFlag flags)
 {
 	LIBCAMERA_TRACEPOINT(request_reuse, this);
 
-	_d()->reuse();
+	_d()->reset();
 
 	if (flags & ReuseBuffers) {
 		for (auto pair : bufferMap_) {