Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1789535pxb; Sat, 23 Jan 2021 05:49:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJZU80CQZu2wT8kk3wda5V3mx7QG1QTa+j9YPQAEQgvFA7l8DT0YN8WMoq1ajWH6eb8KTe X-Received: by 2002:a17:906:9616:: with SMTP id s22mr255092ejx.270.1611409792294; Sat, 23 Jan 2021 05:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611409792; cv=none; d=google.com; s=arc-20160816; b=Kdn04p7rIHbCDCGmf8Ds97SqJyXddXBGmp91jtGN6vNoPz9KntR4kLXxU/UyImRVW5 hFIWaG7sFUFPpRpVnGNJPxq8iXZHjniwcSu5FnpGJrJOySWLHr4q9XaFbUS2VaxdE4gE 7q4kw2R3p6xeo4YYYSZCO3Cp1CuTxgSxE59Mn0YBzeKxHyh+UxDkOR4huDwTHKNW70qY tl6778a3ZEiTHI8KlIqh92rBivpl4kfSsNl4Ywm0vB9/Sya6eSeoQjniP9qqGLF8vqad c0pUj+z0UCk56eiXW5pHsIyPBLt0+ShM0mEgSkwXz/0CdkoKF0P+maOcI7PbC467Oqoy yD2g== 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=ubvotxx/r0R9WEvdJfiASwO46D8TpqScFE0Ma8hXwBM=; b=s1iH8AnkAJoXQDt9R09laO1ZFSe/H3JvrpOUDPU3Yhr9I/xzijtNjr/k8U5n4tVkJC lRBURPtzkPJxQ8tdDD9wLlO2FPkX/f7t85awc6LXgpDh9pXduaAzb8pb6IUcBUbQggPT 3o6xqrimyHaJuv+Kte2lC12mnqZb4p+I4j2XIWXS3xHNYxSk2a68IhAl63UD7/aVafBH wfvz5jvhSTnjF+FWvKJ/fHIeojqueO4YclcBAYK7zPwVZhHdVJbS6cT6/j+J8B9z9a2o I3fm7bnHn72JfrhN4TIDszyOHuQ9ctD1kDjYUuPi3KXYHiKP74bjx+/JBRcilErhyx7M rGdQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si4787629ede.90.2021.01.23.05.49.15; Sat, 23 Jan 2021 05:49:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725771AbhAWNok (ORCPT + 99 others); Sat, 23 Jan 2021 08:44:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:59442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725274AbhAWNoj (ORCPT ); Sat, 23 Jan 2021 08:44:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C232C22AAD; Sat, 23 Jan 2021 13:43:55 +0000 (UTC) Date: Sat, 23 Jan 2021 13:43:52 +0000 From: Catalin Marinas To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Will Deacon , Mark Rutland , David Brazdil , Alexandru Elisei , Ard Biesheuvel , Jing Zhang , Ajay Patil , Prasad Sodagudi , Srinivas Ramana , James Morse , Julien Thierry , Suzuki K Poulose , kernel-team@android.com Subject: Re: [PATCH v4 12/21] arm64: cpufeature: Add an early command-line cpufeature override facility Message-ID: References: <20210118094533.2874082-1-maz@kernel.org> <20210118094533.2874082-13-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210118094533.2874082-13-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 09:45:24AM +0000, Marc Zyngier wrote: > +struct reg_desc { > + const char * const name; > + u64 * const val; > + u64 * const mask; > + struct { > + const char * const name; > + u8 shift; > + } fields[]; > +}; Sorry, I didn't see this earlier. Do we need to add all these consts here? So you want the pointers to be const but why is 'shift' special and not a const then? Is it modified later? Would this not work: struct reg_desc { const char *name; u64 *val; u64 *mask; struct { const char *name; u8 shift; } fields[]; }; > +static const struct reg_desc * const regs[] __initdata = { as we already declare the whole struct reg_desc pointers here as const. I may have confused myself... -- Catalin