[RFC,v1,19/27] py: cam: Remove unnecessary check
diff mbox series

Message ID 20260618123844.656396-20-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • Misc. changes before request-buffer split
Related show

Commit Message

Barnabás Pőcze June 18, 2026, 12:38 p.m. UTC
The `create_request` method will throw an exception if the request
could not be created, it never returns `None`.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/py/cam/cam.py | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jacopo Mondi June 22, 2026, 1:46 p.m. UTC | #1
On Thu, Jun 18, 2026 at 02:38:36PM +0200, Barnabás Pőcze wrote:
> The `create_request` method will throw an exception if the request
> could not be created, it never returns `None`.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  src/py/cam/cam.py | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py
> index ff4b7f663e..73764a8af7 100755
> --- a/src/py/cam/cam.py
> +++ b/src/py/cam/cam.py
> @@ -206,10 +206,6 @@ class CameraContext:
>          for buf_num in range(num_bufs):
>              request = self.camera.create_request(self.idx)
>
> -            if request is None:
> -                print('Can not create request')
> -                exit(-1)
> -
>              for stream in self.streams:
>                  buffers = self.allocator.buffers(stream)
>                  buffer = buffers[buf_num]
> --
> 2.54.0
>
Laurent Pinchart June 23, 2026, 9:52 p.m. UTC | #2
On Thu, Jun 18, 2026 at 02:38:36PM +0200, Barnabás Pőcze wrote:
> The `create_request` method will throw an exception if the request
> could not be created, it never returns `None`.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/py/cam/cam.py | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py
> index ff4b7f663e..73764a8af7 100755
> --- a/src/py/cam/cam.py
> +++ b/src/py/cam/cam.py
> @@ -206,10 +206,6 @@ class CameraContext:
>          for buf_num in range(num_bufs):
>              request = self.camera.create_request(self.idx)
>  
> -            if request is None:
> -                print('Can not create request')
> -                exit(-1)
> -
>              for stream in self.streams:
>                  buffers = self.allocator.buffers(stream)
>                  buffer = buffers[buf_num]
>

Patch
diff mbox series

diff --git a/src/py/cam/cam.py b/src/py/cam/cam.py
index ff4b7f663e..73764a8af7 100755
--- a/src/py/cam/cam.py
+++ b/src/py/cam/cam.py
@@ -206,10 +206,6 @@  class CameraContext:
         for buf_num in range(num_bufs):
             request = self.camera.create_request(self.idx)
 
-            if request is None:
-                print('Can not create request')
-                exit(-1)
-
             for stream in self.streams:
                 buffers = self.allocator.buffers(stream)
                 buffer = buffers[buf_num]