All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Martiros Shakhzadyan <vrzh@vrzh.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH 4/8] staging: media: atomisp: Replace goto with immediate return in sh_css_pipe_get_grid_info()
Date: Tue, 20 Apr 2021 14:57:43 +0200	[thread overview]
Message-ID: <1b0dc225-a62d-bbc9-6374-1c64bfc571fc@xs4all.nl> (raw)
In-Reply-To: <20210419192602.498815-5-vrzh@vrzh.net>

On 19/04/2021 21:25, Martiros Shakhzadyan wrote:
> Replace centralized exit goto with an immediate exit log and return, in
> order for the log macro to properly display the file line.
> 
> Signed-off-by: Martiros Shakhzadyan <vrzh@vrzh.net>
> ---
>  drivers/staging/media/atomisp/pci/sh_css.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c
> index 4d4f030e0fe0..87438b5948ba 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css.c
> @@ -5181,8 +5181,10 @@ sh_css_pipe_get_grid_info(struct ia_css_pipe *pipe,
>  
>  	if (binary) {
>  		err = ia_css_binary_3a_grid_info(binary, info, pipe);
> -		if (err)
> -			goto ERR;
> +		if (err) {
> +			IA_CSS_LEAVE_ERR_PRIVATE(err);
> +			return err;
> +		}
>  	} else {
>  		memset(&info->s3a_grid, 0, sizeof(info->s3a_grid));
>  	}
> @@ -5207,7 +5209,6 @@ sh_css_pipe_get_grid_info(struct ia_css_pipe *pipe,
>  
>  	info->vamem_type = IA_CSS_VAMEM_TYPE_2;
>  
> -ERR :
>  	IA_CSS_LEAVE_ERR_PRIVATE(err);
>  	return err;
>  }
> 

Hmm, I'm skipping this patch. It doesn't really change anything since
there is only one place where an error can occur, so there is no confusion
about what caused the error.

The patch is not wrong as such, but there is not a good enough reason to
apply it.

When in doubt, do nothing :-)

Regards,

	Hans

  reply	other threads:[~2021-04-20 12:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 19:25 [PATCH 0/8] staging: media: atomisp: A series of cleanup Martiros Shakhzadyan
2021-04-19 19:25 ` [PATCH 1/8] staging: media: atomisp: Fix the rest of sh_css.c brace issues Martiros Shakhzadyan
2021-04-19 19:25 ` [PATCH 2/8] staging: media: atomisp: Remove all redundant assertions in sh_css.c Martiros Shakhzadyan
2021-04-19 19:25 ` [PATCH 3/8] staging: media: atomisp: Remove a superfluous else clause " Martiros Shakhzadyan
2021-04-19 19:25 ` [PATCH 4/8] staging: media: atomisp: Replace goto with immediate return in sh_css_pipe_get_grid_info() Martiros Shakhzadyan
2021-04-20 12:57   ` Hans Verkuil [this message]
2021-04-19 19:25 ` [PATCH 5/8] staging: media: atomisp: Refactor ia_css_stream_load() Martiros Shakhzadyan
2021-04-20 13:11   ` Hans Verkuil
2021-04-19 19:26 ` [PATCH 6/8] staging: media: atomisp: Replace if else clause with a ternary Martiros Shakhzadyan
2021-04-19 19:26 ` [PATCH 7/8] staging: media: atomisp: Fix line split style issues Martiros Shakhzadyan
2021-04-20 13:02   ` Hans Verkuil
2021-04-19 19:26 ` [PATCH 8/8] staging: media: atomisp: Fix alignment and line length issues Martiros Shakhzadyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b0dc225-a62d-bbc9-6374-1c64bfc571fc@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=vrzh@vrzh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.