mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Thierry Escande <thierry.escande@collabora.com>,
	Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/8] [media] s5p-jpeg: Don't use temporary structure in s5p_jpeg_buf_queue
Date: Thu, 29 Jun 2017 22:12:20 +0200	[thread overview]
Message-ID: <414dfbec-8ef9-6ac5-153b-084c9a765410@gmail.com> (raw)
In-Reply-To: <1498579734-1594-5-git-send-email-thierry.escande@collabora.com>

Hi Thierry,

On 06/27/2017 06:08 PM, Thierry Escande wrote:
> If s5p_jpeg_parse_hdr() fails to parse the JPEG header, the passed
> s5p_jpeg_q_data structure is not modify so there is no need to use a

s/modify/modified/

> temporary structure and the field-by-field copy can be avoided.
> 
> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
> ---
>  drivers/media/platform/s5p-jpeg/jpeg-core.c | 23 ++++-------------------
>  1 file changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index df3e5ee..1769744 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -2500,9 +2500,9 @@ static void s5p_jpeg_buf_queue(struct vb2_buffer *vb)
>  
>  	if (ctx->mode == S5P_JPEG_DECODE &&
>  	    vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
> -		struct s5p_jpeg_q_data tmp, *q_data;
> +		struct s5p_jpeg_q_data *q_data;
>  
> -		ctx->hdr_parsed = s5p_jpeg_parse_hdr(&tmp,
> +		ctx->hdr_parsed = s5p_jpeg_parse_hdr(&ctx->out_q,
>  		     (unsigned long)vb2_plane_vaddr(vb, 0),
>  		     min((unsigned long)ctx->out_q.size,
>  			 vb2_get_plane_payload(vb, 0)), ctx);
> @@ -2511,24 +2511,9 @@ static void s5p_jpeg_buf_queue(struct vb2_buffer *vb)
>  			return;
>  		}
>  
> -		q_data = &ctx->out_q;
> -		q_data->w = tmp.w;
> -		q_data->h = tmp.h;
> -		q_data->sos = tmp.sos;
> -		memcpy(q_data->dht.marker, tmp.dht.marker,
> -		       sizeof(tmp.dht.marker));
> -		memcpy(q_data->dht.len, tmp.dht.len, sizeof(tmp.dht.len));
> -		q_data->dht.n = tmp.dht.n;
> -		memcpy(q_data->dqt.marker, tmp.dqt.marker,
> -		       sizeof(tmp.dqt.marker));
> -		memcpy(q_data->dqt.len, tmp.dqt.len, sizeof(tmp.dqt.len));
> -		q_data->dqt.n = tmp.dqt.n;
> -		q_data->sof = tmp.sof;
> -		q_data->sof_len = tmp.sof_len;
> -
>  		q_data = &ctx->cap_q;
> -		q_data->w = tmp.w;
> -		q_data->h = tmp.h;
> +		q_data->w = ctx->out_q.w;
> +		q_data->h = ctx->out_q.h;
>  
>  		/*
>  		 * This call to jpeg_bound_align_image() takes care of width and
> 

-- 
Best regards,
Jacek Anaszewski

  parent reply	other threads:[~2017-06-29 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170627160906epcas4p369a67fdb1b8f6898a1f1b4ddb7927995@epcas4p3.samsung.com>
2017-06-27 16:08 ` [PATCH v3 0/8] [media] s5p-jpeg: Various fixes and improvements Thierry Escande
2017-06-27 16:08   ` [PATCH v3 1/8] [media] s5p-jpeg: Call jpeg_bound_align_image after qbuf Thierry Escande
2017-06-29 12:03     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 2/8] [media] s5p-jpeg: Correct WARN_ON statement for checking subsampling Thierry Escande
2017-06-29 12:03     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 3/8] [media] s5p-jpeg: Handle parsing error in s5p_jpeg_parse_hdr() Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 4/8] [media] s5p-jpeg: Don't use temporary structure in s5p_jpeg_buf_queue Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-29 20:12     ` Jacek Anaszewski [this message]
2017-06-27 16:08   ` [PATCH v3 5/8] [media] s5p-jpeg: Split s5p_jpeg_parse_hdr() Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 6/8] [media] s5p-jpeg: Decode 4:1:1 chroma subsampling format Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 7/8] [media] s5p-jpeg: Add support for resolution change event Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 8/8] [media] s5p-jpeg: Add stream error handling for Exynos5420 Thierry Escande
2017-06-29 12:05     ` Andrzej Pietrasiewicz
2017-06-29 12:02   ` [PATCH v3 0/8] [media] s5p-jpeg: Various fixes and improvements Andrzej Pietrasiewicz
2017-06-29 20:13   ` Jacek Anaszewski

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=414dfbec-8ef9-6ac5-153b-084c9a765410@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=andrzej.p@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=thierry.escande@collabora.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®