From patchwork Sat Feb 17 10:03:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 202598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp241554dyc; Sat, 17 Feb 2024 02:04:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+z+TnX+P3bDIUraRcR6rSiiNVMwleewYH6IYcy9H6neXe2nmVlEzd+gTU9Yf9m0JDmzbK1ciYa+vQj1dM54b1sI460g== X-Google-Smtp-Source: AGHT+IHbe7JjSXWtJTCKP92jnXlHFh+BTRe3NdVGQWCXKiiztXROjt/yBcZuNYp3MOgRux7LrRIc X-Received: by 2002:a05:6a00:9399:b0:6dd:c3fd:45fb with SMTP id ka25-20020a056a00939900b006ddc3fd45fbmr8602761pfb.24.1708164252275; Sat, 17 Feb 2024 02:04:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708164252; cv=pass; d=google.com; s=arc-20160816; b=h3/62ZUG2coORONyjB/Q/L5n9KYGRamFOa6YTyMZttVF2abKsHnO9QBFgD5L8W/bZ3 4mshOALIdZnoHVlLh1lUAwSUOSOqBbDeBEwKYUu3GxIm1igU90hSvf5SqsXzJ1z3L//C 9403iMGjRr1JZCgXkYPAD/XbByTNdfnq5vof9c95XMJ8Y13Dquj+0CpIgw/CmaF7C0b5 PmF2NJDN9lifQRIQMi39EZzB8sPmYjIytqAIUbVN4bYHgYFXBqm8qNN2gb/DCpREEIbS paztsLoCt2Jd6YL185WCRyGboj+Y430eqiiXhYuAGnRL05oQy2zGgsyNx1yM8t5pQcRn ty7w== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=9YKX8C3qTGETErqkeCa13vk3aSbkZKOlK79FCs1RlfM=; fh=MBxa0l3UhnpxPllMsy5SG0Vi90cqPh+q41soUbfFptg=; b=FIpxVj6yVmMedlNB8alOnP6kBDKV9yao8bjAb8erUOMJBtWvdgj8QHJdwgJGn7ZyrC jp9+0VFfg1dqpODv2N89E1MWurqkmEOUmQyN2AcmImy3EtfOQaSKSx7NdN9tC91nRnNa KTulqdq0lUUV3CNavQSGXaiiGrfMn3fFmV8w0fvo9J0nN5by9YN48QkZtyoDHT6pz8+h STO9EtScgMbGtF+N4D+94OLSWh7wDr10U1WWBKIga1UfeNCBJmkN/i2whK99dcK+HMK5 cVRETmUebg9I17gT/bhSVTlHPvsYw7oNL7bbmSAV93QAuVjQ9ATpEjzBE6vLRW5QHqOK UFHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rUTVc7hK; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69787-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a30-20020a62d41e000000b006dbb1f82e81si1335251pfh.170.2024.02.17.02.04.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:04:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rUTVc7hK; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69787-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69787-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E2F43B216DB for ; Sat, 17 Feb 2024 10:04:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D1DE1D548; Sat, 17 Feb 2024 10:03:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rUTVc7hK" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 097551DFFD for ; Sat, 17 Feb 2024 10:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164195; cv=none; b=oT8wqcUGJPra355cdDd81WcHnnCeReP0xPekHFf3PvFu78Bs84sqcXWeW4F3dhuVh1w7lBf7w7uBfTKSHTA9hOmvlRs+RavRmCFFIlyFAK8NDBzYacX1XNtIn/9B18OgOp7RCJrms5VXLl8IpIUk4tUHH0xOU1kAaDgW1YeSEmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164195; c=relaxed/simple; bh=A+8Z4F2C+Jafe+RXMmROAWtPHvoM9Qp4Vx4sW0hunfg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=tFY/UD89+xfgm2Vkqi6P3J43dPD9zLwkK4Dsz4NR8eU42m0uhqS2Q/DN31CErK/anH+iWPnqYHlJ7I3b1i3DKo4NqTEAi9FeeLY7S3VXSEdUArxHnL6PcgtHJcttfsGkieopRwLJLvgsGvHj9UlL/jigVIPCsF9CPpROho7k/WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rUTVc7hK; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a3d0d26182dso308727466b.1 for ; Sat, 17 Feb 2024 02:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708164188; x=1708768988; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9YKX8C3qTGETErqkeCa13vk3aSbkZKOlK79FCs1RlfM=; b=rUTVc7hKJTdknUxy8QRv5PMaU1rwGqMJQjWX1GhFqg3v1Pt6yFd4PsD12WPZby20wF BYV9+FqGYD3keqKdva41RfCg9cSiRuuoa1NUJwA/Cxta2kY8Ygt0ufrqATpC9eAl+nTQ 5wMLAfPA7vKqOjFYc3mjtUp8t00NgVdS+qJI4mXxnO/6S5GNhAk+OpR0sZXGOtTblbzD rAlOVwIrmT4artZVY+C+LcyLmNV4bCaju9Ne8SYTTeuzlmg/JF+0mwq9J4rU99tcHs2V pZzWQFIrCS1YOBhEZ2qmLPruVyDeFrtI9rcgv5zRMld0ND8MbA7zRDDe+QbIiDUaAhGV dAsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708164188; x=1708768988; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9YKX8C3qTGETErqkeCa13vk3aSbkZKOlK79FCs1RlfM=; b=r7gk9gV26DV9l4U0isuYYPOCuJsZ9y0L7kj2ndDYW/+6qRRU+Q0Rj/KplQeOXA+0qI sLthnApZiQvLvtTRUxZCGW3CWl/RoLwBI/qQHZvyye4h1TpsUQg/OAcfjVn6Zt0zneuH bEFk6vX/mawKuKAynhcLcabVqoQBSpZ+FLW7XC7kzebeAGlxGINbMK6yvtcXigKHfDtV qKyToid4KWJfl+VTqFEHv+tXbEDgC1kXboB27TqKOE9a/pufukBP70H/6Iydwhl4w31Y MLmpgvyRsRp1B2oUwbHGtGfV0q1qFONC8BFr17Lv01bMOBDtCJe0V7I8T3jn2SgrupFe X19Q== X-Forwarded-Encrypted: i=1; AJvYcCV7Qjt4cJAdS9P/37yqQdlqzas6AuhXy1Hfe8VKXRb/GgLxW0ipeFt0cJTo0vzj07M2Sjv86/qbxcy2Oc52XT0bwNJ36MtG3CMbLtqP X-Gm-Message-State: AOJu0YxseORV8Cx6c2p3qfOaj0Nove/b5q07VERS1KK1vwOzdOzyXhmq TvskWe8YpNC3886hFw4nPtAdXI3H9RHbwTVXeUZ+daq85w7+oEHBatYgcN3vrYk= X-Received: by 2002:a17:906:3d2:b0:a3c:e8f6:a399 with SMTP id c18-20020a17090603d200b00a3ce8f6a399mr4796446eja.29.1708164188372; Sat, 17 Feb 2024 02:03:08 -0800 (PST) Received: from krzk-bin.. ([78.10.207.130]) by smtp.gmail.com with ESMTPSA id fj6-20020a1709069c8600b00a3cfe376116sm844862ejc.57.2024.02.17.02.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:03:07 -0800 (PST) From: Krzysztof Kozlowski To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RESEND PATCH net-next] net: wan: framer: constify of_phandle_args in xlate Date: Sat, 17 Feb 2024 11:03:06 +0100 Message-Id: <20240217100306.86740-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791139996668883999 X-GMAIL-MSGID: 1791140038903928159 The xlate callbacks are supposed to translate of_phandle_args to proper provider without modifying the of_phandle_args. Make the argument pointer to const for code safety and readability. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Simon Horman --- drivers/net/wan/framer/framer-core.c | 9 +++++---- include/linux/framer/framer-provider.h | 14 +++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/wan/framer/framer-core.c b/drivers/net/wan/framer/framer-core.c index c04dc88bda6c..33b358b99f70 100644 --- a/drivers/net/wan/framer/framer-core.c +++ b/drivers/net/wan/framer/framer-core.c @@ -384,7 +384,7 @@ static struct framer_provider *framer_provider_of_lookup(const struct device_nod return ERR_PTR(-EPROBE_DEFER); } -static struct framer *framer_of_get_from_provider(struct of_phandle_args *args) +static struct framer *framer_of_get_from_provider(const struct of_phandle_args *args) { struct framer_provider *framer_provider; struct framer *framer; @@ -735,7 +735,8 @@ EXPORT_SYMBOL_GPL(devm_framer_create); * should provide a custom of_xlate function that reads the *args* and returns * the appropriate framer. */ -struct framer *framer_provider_simple_of_xlate(struct device *dev, struct of_phandle_args *args) +struct framer *framer_provider_simple_of_xlate(struct device *dev, + const struct of_phandle_args *args) { struct class_dev_iter iter; struct framer *framer; @@ -768,7 +769,7 @@ EXPORT_SYMBOL_GPL(framer_provider_simple_of_xlate); struct framer_provider * __framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)) + const struct of_phandle_args *args)) { struct framer_provider *framer_provider; @@ -830,7 +831,7 @@ static void devm_framer_provider_of_unregister(struct device *dev, void *res) struct framer_provider * __devm_framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)) + const struct of_phandle_args *args)) { struct framer_provider **ptr, *framer_provider; diff --git a/include/linux/framer/framer-provider.h b/include/linux/framer/framer-provider.h index 782cd5fc83d5..f6fd2dd92591 100644 --- a/include/linux/framer/framer-provider.h +++ b/include/linux/framer/framer-provider.h @@ -93,7 +93,7 @@ struct framer_provider { struct module *owner; struct list_head list; struct framer * (*of_xlate)(struct device *dev, - struct of_phandle_args *args); + const struct of_phandle_args *args); }; static inline void framer_set_drvdata(struct framer *framer, void *data) @@ -118,19 +118,19 @@ struct framer *devm_framer_create(struct device *dev, struct device_node *node, const struct framer_ops *ops); struct framer *framer_provider_simple_of_xlate(struct device *dev, - struct of_phandle_args *args); + const struct of_phandle_args *args); struct framer_provider * __framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)); + const struct of_phandle_args *args)); void framer_provider_of_unregister(struct framer_provider *framer_provider); struct framer_provider * __devm_framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)); + const struct of_phandle_args *args)); void framer_notify_status_change(struct framer *framer); @@ -154,7 +154,7 @@ static inline struct framer *devm_framer_create(struct device *dev, struct devic } static inline struct framer *framer_provider_simple_of_xlate(struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { return ERR_PTR(-ENOSYS); } @@ -162,7 +162,7 @@ static inline struct framer *framer_provider_simple_of_xlate(struct device *dev, static inline struct framer_provider * __framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)) + const struct of_phandle_args *args)) { return ERR_PTR(-ENOSYS); } @@ -174,7 +174,7 @@ void framer_provider_of_unregister(struct framer_provider *framer_provider) static inline struct framer_provider * __devm_framer_provider_of_register(struct device *dev, struct module *owner, struct framer *(*of_xlate)(struct device *dev, - struct of_phandle_args *args)) + const struct of_phandle_args *args)) { return ERR_PTR(-ENOSYS); }