Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3040299pxb; Tue, 12 Jan 2021 05:03:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhz+Pj6aTDdBU+MwGE3BB/SplTlZxNyZ0pAl13mf+uizUSh6YHPVLwkJ2tcAOUdjPkoiSz X-Received: by 2002:aa7:d297:: with SMTP id w23mr3362770edq.374.1610456584849; Tue, 12 Jan 2021 05:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610456584; cv=none; d=google.com; s=arc-20160816; b=HcNCOZDyBQ/VjWshONDSgRP0AhL1yD2RCJggV+Y68rhrPcwTWALcxykT9/E4DvUWlj LkQYLBGYuzbJndP7hgij4tGyjTZaOswGUg518MPGLvXD1Gmza5IkQb8xn307JQ4oIJ8f z6A3jYAxTvoEmx1HqYX0dTIiiZNyxu6nRL3XczcVzq7b1eGr3YKKc6NtKxmAkjmGJ9kH akjukKFK9FK8WPzLJW5FHPx490CVO3pPO9A9jZBmX5f+qnnfqk1T1QVn/Qp0ZVYc+9c/ ItIrxN/N6uw8TLln0+69Ffem0mvbfLH0cLAjsafvXbwO3NsiSEoxwRTsNPptwDu8m7os k3Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :reply-to:from:references:cc:to:subject:dkim-signature; bh=GohrAVYPt5nxtE/lSAGNq+FHH3KGly9iO/6HoupZqOo=; b=UiLxid+GE/owvzaejrh0lnWz3IOWZVWdHnefRZlwZLmyeUJhlQK50m1jsJJBE2AX+y SFrOo5amIUkEyjW++EoYIJEFJT5ydiat5Y/UXnMUxXxOsTS2E5fFHEOD6Hr0l7EORt+0 Eb7WGSk2UJ5qGAARdxRlBPzFu3nWR385FDJAAUsh9f14SNdNqm4As/KreNIs7Xpsq+FL LhEy8orqVBhT+zzdrsyxVDO5+wE2nGTRY6aUI5Ex4LwprtUn/kCLDgatT/gIHnwot1Q5 6lEzjBTmlLi/dcPFjwubA8WmyFAs0kp/zRAI1jeqB/4LipUJoaGLL0Nz7vZdNWGMzUd4 347w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ZQvCFO44; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s21si1252511edc.368.2021.01.12.05.02.40; Tue, 12 Jan 2021 05:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ZQvCFO44; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731427AbhALLIa (ORCPT + 99 others); Tue, 12 Jan 2021 06:08:30 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:43730 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731064AbhALLI2 (ORCPT ); Tue, 12 Jan 2021 06:08:28 -0500 Received: from [192.168.0.20] (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CED0E3E; Tue, 12 Jan 2021 12:07:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1610449666; bh=ZXHJqHx687OGkTEkTUMaYuXfRgVAqjIzIvGWhKthUeg=; h=Subject:To:Cc:References:From:Reply-To:Date:In-Reply-To:From; b=ZQvCFO44RQGciA0k3/5jTy0j7BbKXrUsOO1XYa7KPoGOHZl9ACbbaxwr2JUNAZC70 KTRCI0VFMZ8brFcPi7QZqHpGHlwPjZW2OCJXbss4zLW8AD4g8M/OBeyGZdNYEe3OOD SMLSBS1LaHO+SbGctzZ6fowoer1xwUQH4HlsFWyY= Subject: Re: [PATCH 5/9] media: jpu: Do not zero reserved fields To: Ricardo Ribalda , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mikhail Ulyanov References: <20210111145445.28854-1-ribalda@chromium.org> <20210111145445.28854-6-ribalda@chromium.org> From: Kieran Bingham Reply-To: kieran.bingham+renesas@ideasonboard.com Organization: Ideas on Board Message-ID: Date: Tue, 12 Jan 2021 11:07:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210111145445.28854-6-ribalda@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ricardo, On 11/01/2021 14:54, Ricardo Ribalda wrote: > Core code already clears reserved fields of struct > v4l2_pix_format_mplane, check: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero > v4l2_plane_pix_format reserved fields"). > > Cc: Mikhail Ulyanov > Signed-off-by: Ricardo Ribalda > --- > drivers/media/platform/rcar_jpu.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c > index 9b99ff368698..2bddc957cb87 100644 > --- a/drivers/media/platform/rcar_jpu.c > +++ b/drivers/media/platform/rcar_jpu.c There's a memset(cap->reserved...) in jpu_querycap() Is that also applicable and covered by the core? Looking at v4l_querycap() it doesn't seem to be so: Reviewed-by: Kieran Bingham > @@ -793,7 +793,6 @@ static int __jpu_try_fmt(struct jpu_ctx *ctx, struct jpu_fmt **fmtinfo, > pix->colorspace = fmt->colorspace; > pix->field = V4L2_FIELD_NONE; > pix->num_planes = fmt->num_planes; > - memset(pix->reserved, 0, sizeof(pix->reserved)); > > jpu_bound_align_image(&pix->width, JPU_WIDTH_MIN, JPU_WIDTH_MAX, > fmt->h_align, &pix->height, JPU_HEIGHT_MIN, > @@ -808,8 +807,6 @@ static int __jpu_try_fmt(struct jpu_ctx *ctx, struct jpu_fmt **fmtinfo, > pix->plane_fmt[0].sizeimage = JPU_JPEG_HDR_SIZE + > (JPU_JPEG_MAX_BYTES_PER_PIXEL * w * h); > pix->plane_fmt[0].bytesperline = 0; > - memset(pix->plane_fmt[0].reserved, 0, > - sizeof(pix->plane_fmt[0].reserved)); > } else { > unsigned int i, bpl = 0; > > @@ -822,8 +819,6 @@ static int __jpu_try_fmt(struct jpu_ctx *ctx, struct jpu_fmt **fmtinfo, > for (i = 0; i < pix->num_planes; ++i) { > pix->plane_fmt[i].bytesperline = bpl; > pix->plane_fmt[i].sizeimage = bpl * h * fmt->bpp[i] / 8; > - memset(pix->plane_fmt[i].reserved, 0, > - sizeof(pix->plane_fmt[i].reserved)); > } > } > >