Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2152751lqb; Mon, 27 May 2024 09:24:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXTeaDimBCxRmA72nHvhSSJV+1NrJwIeobJGx2zOSMtJOMDh3DvL9RaoHywrK3zOtbfixWIOKrFbXyF1nTSe1hlhsza0fQEhEbsu3DMg== X-Google-Smtp-Source: AGHT+IH+sN4CuNxUJOGRK4czACKA4dznj73yMj90BcPX2n1zxP43ueN+RUriikrkfs4C5uc4RdqH X-Received: by 2002:a19:ad4a:0:b0:529:4864:9c17 with SMTP id 2adb3069b0e04-52967463e64mr7787103e87.57.1716827089473; Mon, 27 May 2024 09:24:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716827089; cv=pass; d=google.com; s=arc-20160816; b=livC1KHWCfgUiTPrt8HPbrnAmGSlvSLcTpYoatPNz61kXkrUiADQRLXlFqGjKH/ywv 3RUCWn1nk5nnf2o6I//UNi/o6qG32ja3//9Xenq6/nRdUtCDfQ4cgtvnjb2J5MDLLLCh nu1oinlb3t8ib1vzqlz0tGxhlcfwne+HZeDZ6XECLnRQTUc1wBaYZDCttQi2RXvw5Be/ 9CiWUYFR3NBKNIFUaNn+V/g9UND6+f64r8rR2FYFL7Rg1rjC1IA+ocUScNJmZD3VJcrA OHN7OCFNs/N879QJmJbA3H88oskz0TtO6FBP6homZVhqeHgbzsEeBina6FBmMSnPcPh0 qAdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3h+hZPubtWgPDD7KPmRBpR6yZ07j+EdVtQNqtGhhR2w=; fh=3YQ9Wn9iIS51y8NrdlOvPTQ4lFTakVN5LX1zxHYgQ/4=; b=ZGzKHlenHVy7dFyji7C2xq+x+wDLuaadWeohQ0ADxJWn3n+xIvogIOKMrQBgIpNlgC v5M0Qb3XGMdBPfuj585PKvpRodfsWcly/QdQAWRaewVuBsDseIGspPLP2/BDl8z2WXkf +n33aOnx63RkzhFrrH8ui2rCbbNzTme3ssRGu0kqmmOz266u73qZ/hIGHzS2dR+h12FA MswueIhyFm26yDTV8h/b7MAKbNdOUNDuh91zo+g2q0AgGTlkWz5HtPjl8rsg7lLS8yTK RMjTMglrv/lAfOiugw+++EcpGtp4TzrYrAJLu2ya005/D/6DTtnh7RdlmKZL2+QszJ2P lZ4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KLsUYtmL; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5785246058bsi4009855a12.329.2024.05.27.09.24.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KLsUYtmL; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 35A851F21EAE for ; Mon, 27 May 2024 16:24:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92DFB16D4E4; Mon, 27 May 2024 16:15:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KLsUYtmL" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85F2516C869; Mon, 27 May 2024 16:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826524; cv=none; b=F1DxhGdPVx/w3ki31T/tZ02jQEzVm5aL7yCvKzCPOvsL4LK5C68INt05uYC0ldCihqiC3GD1AKUnjNY56O/UfLP1ySfZmKAn5wk408Ad1tyjpXjaAwOURhaKgDRWruvmIB41qshPFI1wr9kprdBrEya7SnU9EuMjSRr5XzFS+y0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826524; c=relaxed/simple; bh=NfXTvwTcNt6TT2yA4BeBzCWYH0x+WXyl8rDrM6Pn0ZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mfR0N6Nw4Zu7blqflTSf10XgRC9+jD9BLhXZMr77M2ugqiovmL27w6xvw4FXj0WWIaGNRyhIGLifPhJ3ghGrwni5dwzJKE0xHqX/TJ/e413l05CquT5e6gQ7IfLhv6sv03a87FxwrKVQuZHIev7lLmzEamOAD+EgaLSCz774y5E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KLsUYtmL; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id B21FBFF817; Mon, 27 May 2024 16:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1716826521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3h+hZPubtWgPDD7KPmRBpR6yZ07j+EdVtQNqtGhhR2w=; b=KLsUYtmLqQAKRcBHuSjg5r26CPzkClTo8OEYGfcU0kBluW6n8ZXHUvCneD3BtKdU7GiE6w 19JB8grUr+P4p/NeZ2Jufvd/T9nuiIbFicmYJR6C1gCzf5+ibofv/IJLAOHeN6jho2H0de 5oXisZKUr1TIJqnR8kpC9NljzGSlp8IKXMiM4VbuKorXEFjm+tt/wTXvwG+8jZD+OE/Tu/ i81d66beg6ItjcpRSDnjG76BKTe8xwDy/gCulyQVLoz4QKOQZe4urKbJexgosAO26fwtfm pkzo0ficRtreEvNhHn3b11GEfkV7WRaCpAGxTjg8R/MhRKzDvn/s1WNwiRRJ/g== From: Herve Codina To: Simon Horman , Sai Krishna Gajula , Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: [PATCH v2 13/19] of: dynamic: Constify parameter in of_changeset_add_prop_string_array() Date: Mon, 27 May 2024 18:14:40 +0200 Message-ID: <20240527161450.326615-14-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240527161450.326615-1-herve.codina@bootlin.com> References: <20240527161450.326615-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com The str_array parameter has no reason to be an un-const array. Indeed, elements of the 'str_array' array are not changed by the code. Constify the 'str_array' array parameter. With this const qualifier added, the following construction is allowed: static const char * const tab_str[] = { "string1", "string2" }; of_changeset_add_prop_string_array(..., tab_str, ARRAY_SIZE(tab_str)); Signed-off-by: Herve Codina --- drivers/of/dynamic.c | 2 +- include/linux/of.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index dda6092e6d3a..70011a98c500 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -984,7 +984,7 @@ EXPORT_SYMBOL_GPL(of_changeset_add_prop_string); int of_changeset_add_prop_string_array(struct of_changeset *ocs, struct device_node *np, const char *prop_name, - const char **str_array, size_t sz) + const char * const *str_array, size_t sz) { struct property prop; int i, ret; diff --git a/include/linux/of.h b/include/linux/of.h index a0bedd038a05..ee9a385a13db 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -1639,7 +1639,7 @@ int of_changeset_add_prop_string(struct of_changeset *ocs, int of_changeset_add_prop_string_array(struct of_changeset *ocs, struct device_node *np, const char *prop_name, - const char **str_array, size_t sz); + const char * const *str_array, size_t sz); int of_changeset_add_prop_u32_array(struct of_changeset *ocs, struct device_node *np, const char *prop_name, -- 2.45.0