Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1195097pxb; Fri, 20 Nov 2020 03:44:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIrQo/HYnfwxOWCWSDGg1+4kpklffUnn/R5n5iw2F3fOROTdJms6kCRc/tAfJQEzGk/59S X-Received: by 2002:a17:906:13d0:: with SMTP id g16mr31740739ejc.327.1605872664487; Fri, 20 Nov 2020 03:44:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605872664; cv=none; d=google.com; s=arc-20160816; b=AkKK3oaQUZnZL6JSspKchjisZz3CwjsuKLwyRQi5tJgMGLajCINsva8Hk9Ubk2CDCV dEXCmsud9xE0+FRqomOuwzG9ve3OMbZn9fHYwaFiNOEpQeCCQ6GxpLNe9s3wYasO48vN azxLu5iJqDABhL/3opaqj6zKrTm0F28MdPL3yGGxB6MaOm14iLRCFVqa2mqoyKABS7N1 0PfvgbANB/JJTJQy1FLSYA2zb2zfhNbAEYNgiAvHYlSCNm3nPJZ+93vUGY5EvmhvNSxd MIlg5/ubgX65rkQ04hnQCb6MuKesohQon3KTensJXS31lm2VOS/XcWwYZ2DTutz/khg4 3oMQ== 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 :from:references:cc:to:subject:reply-to:dkim-signature; bh=9rS6EaplwSCVV2xm/QbxWdOSwsk40XeFrD9Sw3uq5fE=; b=kBbtNmKJtZwjcUIKtQCsipgIU+tCmkZUg2ExEr9YkHLEm3WEzAmkUNTiIrFyvkpyyb 5GB0FVbEPaeNBFMWx9IR0fYUbogcFeyzczmtA/P+E7jIbfqJEQiEhxCevyXIPZ3mzoM6 +LBbTFWfU3dAPpQsJjXu+CZkxgfpw+dlx5QpC41eLrzt3VLgXu1YnSpzbHVvu43XB0sP 3+P5jIELv40hEG3ZAt+DRYZImnFzxW/Xu06ZbuifSE67LCyIFjsgA/UCwJ3m41AivEKd /aFC6ioZZOBlLOVqfpVhZseE4o4p+rd8mQs873Pfm2CxMLdy6l1ZOLE/OSmKSaY9gndT qHBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gyHBTcLF; 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 ok23si1477086ejb.243.2020.11.20.03.44.01; Fri, 20 Nov 2020 03:44:24 -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=gyHBTcLF; 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 S1727882AbgKTLjZ (ORCPT + 99 others); Fri, 20 Nov 2020 06:39:25 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:40218 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbgKTLjY (ORCPT ); Fri, 20 Nov 2020 06:39:24 -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 318F62A3; Fri, 20 Nov 2020 12:39:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1605872362; bh=ygioABaHvNHy8Eqt9VTHePCCXvpzema1AioblNO6ADk=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=gyHBTcLFcjudRljZGYIFCItEpzezrRy6w07RbLu1rGuvZrKq0O6FtWvbjUusamMRz yf1mccKl0mD9MOZeJvhmAI4luKOF/YjORucdI+05mLmRaM3RemedFUiescMYHuTgA5 H94G7zqWGaZBvCliWWSXoNhjN5tdWuBccC57WkZY= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH] media: i2c: rdacm20: Constify static structs To: Rikard Falkeborn , Mauro Carvalho Chehab Cc: Jacopo Mondi , Laurent Pinchart , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201119222248.148845-1-rikard.falkeborn@gmail.com> From: Kieran Bingham Organization: Ideas on Board Message-ID: <2f26726f-036d-8651-0de6-f8e58e8a6b9d@ideasonboard.com> Date: Fri, 20 Nov 2020 11:39:19 +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: <20201119222248.148845-1-rikard.falkeborn@gmail.com> 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 Rikard, Thank you for the fix. On 19/11/2020 22:22, Rikard Falkeborn wrote: > The only usage of rdacm20_video_ops is to assign it to the video field > in the v4l2_subdev_ops struct which is a pointer to const, and the only > usage of rdacm20_subdev_ops is to pass its address to > v4l2_i2c_subdev_init() which accepts a pointer to const. Make them const > to allow the compiler to put them in read-only memory. > > Signed-off-by: Rikard Falkeborn Reviewed-by: Kieran Bingham > --- > drivers/media/i2c/rdacm20.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c > index 1ed928c4ca70..ac00a6743623 100644 > --- a/drivers/media/i2c/rdacm20.c > +++ b/drivers/media/i2c/rdacm20.c > @@ -435,7 +435,7 @@ static int rdacm20_get_fmt(struct v4l2_subdev *sd, > return 0; > } > > -static struct v4l2_subdev_video_ops rdacm20_video_ops = { > +static const struct v4l2_subdev_video_ops rdacm20_video_ops = { > .s_stream = rdacm20_s_stream, > }; > > @@ -445,7 +445,7 @@ static const struct v4l2_subdev_pad_ops rdacm20_subdev_pad_ops = { > .set_fmt = rdacm20_get_fmt, > }; > > -static struct v4l2_subdev_ops rdacm20_subdev_ops = { > +static const struct v4l2_subdev_ops rdacm20_subdev_ops = { > .video = &rdacm20_video_ops, > .pad = &rdacm20_subdev_pad_ops, > }; >