Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1125646pxb; Fri, 20 Nov 2020 01:36:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNMDTQMVgcziu6NvBLCN20NJB0HmHcJi2EUceJqFCIxjyJGhKwLMr3Yu6eerjJ6JFCzJAP X-Received: by 2002:a17:906:26c2:: with SMTP id u2mr30816987ejc.529.1605864976503; Fri, 20 Nov 2020 01:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605864976; cv=none; d=google.com; s=arc-20160816; b=rqubteeLvhYG0bXBJ7Cdm184gpiMKhDMJqseHaP2u3XExx7K6lFPML3bSflDmzMkIi 8bw2nJiIDs3s4oap6U832u/TOZzvmThIpMN3WDTFJaccj2NPOqBnyfBpdLAvHEMg5D0Z BPOVosytWsWuFLl+CuMWSnjkU0mLQSTXa1YcW00EuYNRu/6KBDRlzLx9IF6bidBmO6/W n2rbHCD3t3tSPwqB6RvaGatVqwPQLSL1T6gAEcBUWavsJQ0rOSZtSzlRIUhntEmxnVHX RAD+dKtK7wGkuc+sZSQRq63p+pXgYCvGuMe8HRVLLyl0m9icbIx/7G8SWU8VDm7EAPK/ Qfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=iZbdC8fkiAuImesDniQEANiSnoPnPq0k+Mr0z/pEjxQ=; b=FYqoRu5HHvBpDjre/umkSRArLD/NcrQ8tIp7s2yHbUv1OVmXMjB32V97Wsq82eepkY DmmfO69RNxWVdo4JJFeUVlPnr+ouMB1EvxBvq03vdVgJXD6EZkB+m2Z0NAs91GXpbQhK whw6aqh2aDddg8g8bt9mIsejUafpQZ9bPjIfJNz8LsoyGeMhrNVSSd2D+7VTQajHYLXr UKHhLTIRk9kc5SYt/ktJYEauuJiVz4vYMJUYBhHtDWt/euT700+yuKzzj8JmT7KoGaM3 yWOzJGsseCDII2k/rIcbI1zX1GNBUtd9JE7maN8jaSdm5oYGkrelD/opRvPWQJ1cELDj VzHw== ARC-Authentication-Results: i=1; mx.google.com; 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 cd11si1393087ejb.245.2020.11.20.01.35.53; Fri, 20 Nov 2020 01:36:16 -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; 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 S1727698AbgKTJbV (ORCPT + 99 others); Fri, 20 Nov 2020 04:31:21 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:60653 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727566AbgKTJbR (ORCPT ); Fri, 20 Nov 2020 04:31:17 -0500 Received: from uno.localdomain (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id A72F620003C; Fri, 20 Nov 2020 09:31:12 +0000 (UTC) Date: Fri, 20 Nov 2020 10:31:16 +0100 From: Jacopo Mondi To: Rikard Falkeborn Cc: Mauro Carvalho Chehab , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Niklas =?utf-8?Q?S=C3=B6derlund?= , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: i2c: rdacm20: Constify static structs Message-ID: <20201120093116.x43pqej4lsz5ynmz@uno.localdomain> References: <20201119222248.148845-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201119222248.148845-1-rikard.falkeborn@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rikard, On Thu, Nov 19, 2020 at 11:22:48PM +0100, 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 Thanks Acked-by: Jacopo Mondi > --- > 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, > }; > -- > 2.29.2 >