From patchwork Thu Jul 29 10:40:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0BE6C4320E for ; Thu, 29 Jul 2021 10:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D990460C41 for ; Thu, 29 Jul 2021 10:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236457AbhG2Kkr (ORCPT ); Thu, 29 Jul 2021 06:40:47 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:34432 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236048AbhG2Kkk (ORCPT ); Thu, 29 Jul 2021 06:40:40 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 4C3B13F115 for ; Thu, 29 Jul 2021 10:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555235; bh=2+MASfDeMXItUy0KRRU6qIh2N4zib4Lrz4DxPbXJr60=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=A8W42v4KoNY2p8NkFhp0mtMxil1RQC4pu9cte5lTrt1XD0539BEgQB7PK6aN6ZYP6 uKH8w+ZyweDyj5M0Wz1AUqw8IX+K1BzCHq/7c4ze53HhMYT9RsFxw9PhD5FpXzdMbI FEQUyRRrCvYY2fBUtUsebDMlFPly9E7A/WFVUZSrgmrm/It0TKIg95gRzdkdgAy2+e ThACAkGKQCGNhA1TuHUlZvOmM30cYPz/Tj97HxxLkuK2q79DuGYTg74wdFS+Lz+etD S9yfErz6RP/RmowefzlgXKlnIgtpVqjW9Z3AVnkzUAYQ+VNLOHqFzwq2Noyapq9aX5 IsuZ4qUNPbY4g== Received: by mail-ej1-f72.google.com with SMTP id qf6-20020a1709077f06b029057e66b6665aso1840854ejc.18 for ; Thu, 29 Jul 2021 03:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2+MASfDeMXItUy0KRRU6qIh2N4zib4Lrz4DxPbXJr60=; b=AlEE5Bt3jqdlvylJ/s8xIhAidppvIb7RnQjJpZ8bbeHVp5u0S0WAMygK1SWbFlSO8Y UjU7gEw6Wj0GBlq1OHEbWt8jBpB24NwdsQWpXTscMjPZC36e1BalaYsgMLBeSHgiOUrx DpHhfIIKP+JQRMpslNl566rkXeT7TizW9fWL/prqw9zqC+CtrdYa+jVs5bz8O5229pHn Kkm81tU+f21BrtWbWQKlABs5YCdSjksl76laqZ0Iy010WXCxNM5Y+kIeiZhlCgfBgc+S N/qqlJ9z40NpMceFv3VpUd0ZhKQqQT8WmJixto67VjtD2QxZXBAabMp3K1iaO1xqprjk l4Ug== X-Gm-Message-State: AOAM532/VtNZf4dVG9qJHlry14hgEMrBjruM8GMSC6be9Ax97sM7Czx2 EX++WgWetNwUWJNT3oDNAxWuSzxSKFu/kt9Y4sLubJjp6dQ19Et/Lx6tDVn4TTeRG1MqJFLGp3b 6HBkgNpREN/4ektHCgJ5w+q7Q2MWK3QCjBg== X-Received: by 2002:a05:6402:b83:: with SMTP id cf3mr5240269edb.12.1627555235092; Thu, 29 Jul 2021 03:40:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwJDOdp8Ic5sbEoP+ybcJEGMi8R0A1BITHI63lRz6KY4s1GLDvMBVi9ewCQtp/6p2bmUkfPA== X-Received: by 2002:a05:6402:b83:: with SMTP id cf3mr5240255edb.12.1627555234989; Thu, 29 Jul 2021 03:40:34 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id c14sm824475ejb.78.2021.07.29.03.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:40:34 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 01/12] nfc: constify passed nfc_dev Date: Thu, 29 Jul 2021 12:40:11 +0200 Message-Id: <20210729104022.47761-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The struct nfc_dev is not modified by nfc_get_drvdata() and nfc_device_name() so it can be made a const. Signed-off-by: Krzysztof Kozlowski --- include/net/nfc/nfc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index c9ff341d57e4..5dee575fbe86 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h @@ -245,7 +245,7 @@ static inline void nfc_set_drvdata(struct nfc_dev *dev, void *data) * * @dev: The nfc device */ -static inline void *nfc_get_drvdata(struct nfc_dev *dev) +static inline void *nfc_get_drvdata(const struct nfc_dev *dev) { return dev_get_drvdata(&dev->dev); } @@ -255,7 +255,7 @@ static inline void *nfc_get_drvdata(struct nfc_dev *dev) * * @dev: The nfc device whose name to return */ -static inline const char *nfc_device_name(struct nfc_dev *dev) +static inline const char *nfc_device_name(const struct nfc_dev *dev) { return dev_name(&dev->dev); } From patchwork Thu Jul 29 10:40:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2273C00144 for ; Thu, 29 Jul 2021 10:40:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AED6560C41 for ; Thu, 29 Jul 2021 10:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236802AbhG2Kkx (ORCPT ); Thu, 29 Jul 2021 06:40:53 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:34506 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236320AbhG2Kkp (ORCPT ); Thu, 29 Jul 2021 06:40:45 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id A33173F051 for ; Thu, 29 Jul 2021 10:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555241; bh=So1uUDkE721+BEqMeRM8NOIaRYftuFanUkfPQdOA99A=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u0jjrKClB9lAfxEnC3BPeK/21mXBBAY/dUsu55HIiip9FeWVwDD9hLpvpNrV2p8WY A+V4z+55VhIP8Rt1QLZwB+0YwbPjOBPsJCpgKdD5+RdCFezYei+C3nCGpQGco5aVBJ FDVCZX0W2yHfcRiICYN5ZFgWOekdrDht67W8FVjkjwLfDywc2qMDtzAE7kf4hGOsXH i581WHEd4bU9kRn+r7AFexTBXfHioAWLzJ8CNDyFL8wDnxK/Mg6q9jx31LEf1Ug8zQ tMEN4X01kURbUR5kKZ4xI9+hRIKxPIQHyOCOyxH556XUZhU8LxJbnpR7GmMwaW5DIa EIjImHCHsVlqw== Received: by mail-ej1-f70.google.com with SMTP id lu19-20020a170906fad3b029058768348f55so1847690ejb.12 for ; Thu, 29 Jul 2021 03:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=So1uUDkE721+BEqMeRM8NOIaRYftuFanUkfPQdOA99A=; b=Na99Gebqi/G0kQyIwmPLHrE2sNbXbt+EjABwS7IvZN+tqblYZcmkTnmc+OdkSeH/Bm EIX39RT9voc3Do39IDLF4SMrNSftc7NwsrDKBuPhCTbmZpROilYAw/UkoMrkHc96/6JW X/np99gv1zFmA7AE/NYnpV7qveYNL48wx2YfRhHxA62Pns6JHGRcdsNXWrss6FoTzJHE q8+hdHleU9ZM4BvvWTFVL55GYXwqfiFnBoKhG0mixGHLHwdgp8X7viqPyy2C1jNfUTrr rqNiZMrUpB5qq3K06bZlVyST9ocUVACH1Gz1M8IqHyMsLLOtJTUSz8HBPDvo47ndyk40 1oTQ== X-Gm-Message-State: AOAM531gRu/DbDkg+3n/NKj5fgi+IkKvSZ3HqNredA75ibJgk/lQW2oM B+xShEICbPkIwVOf/wAGGLeG8jHMzs8MkzfTV2DmGIyRe8l/+6aCuycDInhSOUdHAyB+WGPYHYK PgJzB8Ooa7B4imTNTWKAsKw3/J4o1NhuDbg== X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr4576418edb.271.1627555240172; Thu, 29 Jul 2021 03:40:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwg8gQFeBPTWOxeoK6KYjuQRUdToXFwmH6p9ZgcYdRRS/mw4BXtIUndBzQfGalBkLacI2jz9A== X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr4576407edb.271.1627555240070; Thu, 29 Jul 2021 03:40:40 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id c14sm824475ejb.78.2021.07.29.03.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:40:39 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 05/12] nfc: virtual_ncidev: constify pointer to nfc_dev Date: Thu, 29 Jul 2021 12:40:15 +0200 Message-Id: <20210729104022.47761-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org virtual_ncidev_ioctl() does not modify struct nfc_dev, so local variable can be a pointer to const. Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/virtual_ncidev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c index b914ab2c2109..2ee0ec4bb739 100644 --- a/drivers/nfc/virtual_ncidev.c +++ b/drivers/nfc/virtual_ncidev.c @@ -170,7 +170,7 @@ static int virtual_ncidev_close(struct inode *inode, struct file *file) static long virtual_ncidev_ioctl(struct file *flip, unsigned int cmd, unsigned long arg) { - struct nfc_dev *nfc_dev = ndev->nfc_dev; + const struct nfc_dev *nfc_dev = ndev->nfc_dev; void __user *p = (void __user *)arg; if (cmd != IOCTL_GET_NCIDEV_IDX) From patchwork Thu Jul 29 10:40:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A566C4320A for ; Thu, 29 Jul 2021 10:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 233D160E94 for ; Thu, 29 Jul 2021 10:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237018AbhG2KlW (ORCPT ); Thu, 29 Jul 2021 06:41:22 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:47798 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236284AbhG2Kkp (ORCPT ); Thu, 29 Jul 2021 06:40:45 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 724863F10E for ; Thu, 29 Jul 2021 10:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555241; bh=Cti8DGqbNI8YPSuGsMvGoiLdXe5FLuXImkkJsU3HkS0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f5A+RajiHfLk8wB2DyLPhBFhc9RkwBvXKx/WWTqFq5DD0TpG5TO/5JATW0U6TrlAs VuJAHlSB/36DAUBtsLmGmCSvilO5mvu/KYBwZRwj5Bw9fCeI5Zlm41niNssE0insmk 9u7akXzfUgCvB7qNSz/sN6BVXpkddyNK13irLfKaA57Moch5+Z9ZflH5b75RM9z3K1 1dFn+t6+ZHVhJ/wVTACcziT/pNXgV2VoJZhOR4KyodfZf/Kiy/snG0SHfpZccc7fsA /i6opkVnifNa8GH/0YjGBlZbndhSczJ0BzxLhvOG4CWGIkFz5aROslMJkFQ3uRGUJR mWH43JvF656xA== Received: by mail-ed1-f71.google.com with SMTP id l10-20020aa7caca0000b02903b874f26036so2713080edt.20 for ; Thu, 29 Jul 2021 03:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cti8DGqbNI8YPSuGsMvGoiLdXe5FLuXImkkJsU3HkS0=; b=F+M5QkFy1IyurQGUqBMzD20GvHkR94V9CJMW0t2Ae7jq8EtCJWnVoLsvFEENpcIxnT wiVm5oLIyHCwQBvOrr5TCuYN7pf09Dp3vWvPFwaToR7mPumGtGkepLM1D4zPkOleljH2 dDLjkmCcmiEAZTqgXqdXJY+xZswAYU3sA8YkOT7QuabWUX8vOz7bHZcxOOwQAGle1qUT R6aFh0SVfLgvAOqJivQbK9CMjMph1OTHPY2hsN7eW5MVnQIRJf5FxO3ccD1stpYN4oVs MUkit01aGmi/3SfrFSwKKYoYJqPpVHdOd/290z12cYkczPC5NJUBZUg4JgXY4Tu+zVnf KDqg== X-Gm-Message-State: AOAM53320w6VCxKH41oLBjlxPUtwpZs8Uakw1fxXomSqDnzrOCwNrcvM Dj9sMoGocr+44nNllvo/18+I5Y9B1jL2ngZ3OlHex43IaxiBTBsqrzd86DdmCCT750KRKJwbLAa 6+1QXNORqsf7UPHQpfpTYj5aVUfx+baNbGQ== X-Received: by 2002:aa7:d342:: with SMTP id m2mr5302486edr.40.1627555241263; Thu, 29 Jul 2021 03:40:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjxgKl6WmnwX+WqFoKb6oCeo3LEsCBOoKuWEW0W2jjhEWMO4WBVPwCw/S6BOn4eM0m2lGmgg== X-Received: by 2002:aa7:d342:: with SMTP id m2mr5302475edr.40.1627555241166; Thu, 29 Jul 2021 03:40:41 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id c14sm824475ejb.78.2021.07.29.03.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:40:40 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 06/12] nfc: nfcsim: constify drvdata (struct nfcsim) Date: Thu, 29 Jul 2021 12:40:16 +0200 Message-Id: <20210729104022.47761-7-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org nfcsim_abort_cmd() does not modify struct nfcsim, so local variable can be a pointer to const. Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/nfcsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c index 143dc49b815b..15754671eb4d 100644 --- a/drivers/nfc/nfcsim.c +++ b/drivers/nfc/nfcsim.c @@ -240,7 +240,7 @@ static int nfcsim_send(struct nfc_digital_dev *ddev, struct sk_buff *skb, static void nfcsim_abort_cmd(struct nfc_digital_dev *ddev) { - struct nfcsim *dev = nfc_digital_get_drvdata(ddev); + const struct nfcsim *dev = nfc_digital_get_drvdata(ddev); nfcsim_link_recv_cancel(dev->link_in); } From patchwork Thu Jul 29 10:40:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0ECDC4338F for ; Thu, 29 Jul 2021 10:41:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A469460C41 for ; Thu, 29 Jul 2021 10:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237139AbhG2KlC (ORCPT ); Thu, 29 Jul 2021 06:41:02 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:34564 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236559AbhG2Kks (ORCPT ); Thu, 29 Jul 2021 06:40:48 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 3C2D63F22A for ; Thu, 29 Jul 2021 10:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555245; bh=Sx96q8yhgGgqfl73oRuy2iNKHvqsaGaKbhbfDQ9JbsY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D7FGa5TdVvn2PInqdMXQ5H23yiOBrCuY9YO0aailRj00NKMkq/BZsiaSh0KX0tpws E7dMWTYE7Stn+ZBijsbUkcCTO9CqH7QUg+OjFOam8XfsbyBjq8BckfuRgJ2hrw63nB n8GJpCvGWHJ93Um6fcpgotu5XgjjDNjdkoKFDMq2kabU8hcpFzd2dCwPv1HXC7Qk40 7+ceddb1tBphIl/5sQ4W5jz/ez2W4KE9NoLbKWTKyCUWazQFc25NZVHJMppGI7kJKl U/0vW49+8UNRaxRWZ5rFp7DHdL7aM9GtzFyNmR/02QWQQhb1BgG07aPxdCQIAF3IpV jfzJN1Qcucxmw== Received: by mail-ej1-f70.google.com with SMTP id q19-20020a1709064cd3b02904c5f93c0124so1823864ejt.14 for ; Thu, 29 Jul 2021 03:40:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sx96q8yhgGgqfl73oRuy2iNKHvqsaGaKbhbfDQ9JbsY=; b=BN6UmyRXTmqOlsqjmJcCxBlMyvl5V7DmwBszOjgj3Vd5qsZjLcoBdL+NDP9M+tu8S9 5izGuWowCHrxySOg6SI25wMEYNJvCrJGA9nMquvqbHuVHGvfHQH/tYJCizG/KYY6boTr 2GFyXLslMgJAdutVp03qb6ElvDaAmtZNiOWuUkj8CWifVlWjRRIkvW03pXyro6CmNX6e ozaj9HYI187bTAtNn9q34ROq5efSIvkYpf4+WEmzEdn0ONKihK92/pGh5p77LPfQ5FOb +cLHggRGicdTpdxwuQJ7rZx224mfLLLFGrHxgq4vJU3LJcz6ulWjHg0KKX1tXsT6Gpvv m1+A== X-Gm-Message-State: AOAM530VzPj2hnv3e/UWe6efo4USVRKGnFj3Qigl+Hn8iQSYUaIsVs6N tm4fMgMhswrf6RlkyKSb4GfnisOKZePMgvy60aQ7nptlwLQ1F1RYuRCrjsjocJqPdB3HzCiA9zV EpxXvNaF1u2SKR7t7rU3cKucWRPJrsUXN3g== X-Received: by 2002:aa7:d899:: with SMTP id u25mr5235994edq.151.1627555244991; Thu, 29 Jul 2021 03:40:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMKAksyF3AW0hIGXPExSWFsWMbbCfBv5+3b/l89XwAlprPzNEk1BKJXCgyG6dSfPdtfqSgng== X-Received: by 2002:aa7:d899:: with SMTP id u25mr5235980edq.151.1627555244811; Thu, 29 Jul 2021 03:40:44 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id c14sm824475ejb.78.2021.07.29.03.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:40:44 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 09/12] nfc: fdp: constify several pointers Date: Thu, 29 Jul 2021 12:40:19 +0200 Message-Id: <20210729104022.47761-10-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. This allows also making file-scope nci_core_get_config_otp_ram_version array const. Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/fdp/fdp.c | 18 +++++++++--------- drivers/nfc/fdp/fdp.h | 2 +- drivers/nfc/fdp/i2c.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index 3f5fba922c4d..c6b3334f24c9 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -52,7 +52,7 @@ struct fdp_nci_info { u32 limited_otp_version; u8 key_index; - u8 *fw_vsc_cfg; + const u8 *fw_vsc_cfg; u8 clock_type; u32 clock_freq; @@ -65,7 +65,7 @@ struct fdp_nci_info { wait_queue_head_t setup_wq; }; -static u8 nci_core_get_config_otp_ram_version[5] = { +static const u8 nci_core_get_config_otp_ram_version[5] = { 0x04, NCI_PARAM_ID_FW_RAM_VERSION, NCI_PARAM_ID_FW_OTP_VERSION, @@ -111,7 +111,7 @@ static inline int fdp_nci_patch_cmd(struct nci_dev *ndev, u8 type) } static inline int fdp_nci_set_production_data(struct nci_dev *ndev, u8 len, - char *data) + const char *data) { return nci_prop_cmd(ndev, NCI_OP_PROP_SET_PDATA_OID, len, data); } @@ -236,7 +236,7 @@ static int fdp_nci_send_patch(struct nci_dev *ndev, u8 conn_id, u8 type) static int fdp_nci_open(struct nci_dev *ndev) { - struct fdp_nci_info *info = nci_get_drvdata(ndev); + const struct fdp_nci_info *info = nci_get_drvdata(ndev); return info->phy_ops->enable(info->phy); } @@ -260,7 +260,7 @@ static int fdp_nci_request_firmware(struct nci_dev *ndev) { struct fdp_nci_info *info = nci_get_drvdata(ndev); struct device *dev = &info->phy->i2c_dev->dev; - u8 *data; + const u8 *data; int r; r = request_firmware(&info->ram_patch, FDP_RAM_PATCH_NAME, dev); @@ -269,7 +269,7 @@ static int fdp_nci_request_firmware(struct nci_dev *ndev) return r; } - data = (u8 *) info->ram_patch->data; + data = info->ram_patch->data; info->ram_patch_version = data[FDP_FW_HEADER_SIZE] | (data[FDP_FW_HEADER_SIZE + 1] << 8) | @@ -610,9 +610,9 @@ static int fdp_nci_core_get_config_rsp_packet(struct nci_dev *ndev, { struct fdp_nci_info *info = nci_get_drvdata(ndev); struct device *dev = &info->phy->i2c_dev->dev; - struct nci_core_get_config_rsp *rsp = (void *) skb->data; + const struct nci_core_get_config_rsp *rsp = (void *) skb->data; unsigned int i; - u8 *p; + const u8 *p; if (rsp->status == NCI_STATUS_OK) { @@ -691,7 +691,7 @@ static const struct nci_ops nci_ops = { int fdp_nci_probe(struct fdp_i2c_phy *phy, const struct nfc_phy_ops *phy_ops, struct nci_dev **ndevp, int tx_headroom, int tx_tailroom, u8 clock_type, u32 clock_freq, - u8 *fw_vsc_cfg) + const u8 *fw_vsc_cfg) { struct device *dev = &phy->i2c_dev->dev; struct fdp_nci_info *info; diff --git a/drivers/nfc/fdp/fdp.h b/drivers/nfc/fdp/fdp.h index dc048d4b977e..2e9161a4d7bf 100644 --- a/drivers/nfc/fdp/fdp.h +++ b/drivers/nfc/fdp/fdp.h @@ -23,7 +23,7 @@ struct fdp_i2c_phy { int fdp_nci_probe(struct fdp_i2c_phy *phy, const struct nfc_phy_ops *phy_ops, struct nci_dev **ndev, int tx_headroom, int tx_tailroom, - u8 clock_type, u32 clock_freq, u8 *fw_vsc_cfg); + u8 clock_type, u32 clock_freq, const u8 *fw_vsc_cfg); void fdp_nci_remove(struct nci_dev *ndev); #endif /* __LOCAL_FDP_H_ */ diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index 98e1876c9468..051c43a2a52f 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -36,7 +36,7 @@ print_hex_dump(KERN_DEBUG, prefix": ", DUMP_PREFIX_OFFSET, \ 16, 1, (skb)->data, (skb)->len, 0) -static void fdp_nci_i2c_reset(struct fdp_i2c_phy *phy) +static void fdp_nci_i2c_reset(const struct fdp_i2c_phy *phy) { /* Reset RST/WakeUP for at least 100 micro-second */ gpiod_set_value_cansleep(phy->power_gpio, FDP_POWER_OFF); @@ -47,7 +47,7 @@ static void fdp_nci_i2c_reset(struct fdp_i2c_phy *phy) static int fdp_nci_i2c_enable(void *phy_id) { - struct fdp_i2c_phy *phy = phy_id; + const struct fdp_i2c_phy *phy = phy_id; fdp_nci_i2c_reset(phy); @@ -56,7 +56,7 @@ static int fdp_nci_i2c_enable(void *phy_id) static void fdp_nci_i2c_disable(void *phy_id) { - struct fdp_i2c_phy *phy = phy_id; + const struct fdp_i2c_phy *phy = phy_id; fdp_nci_i2c_reset(phy); } From patchwork Thu Jul 29 10:40:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC9F2C4338F for ; Thu, 29 Jul 2021 10:41:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A54756069E for ; Thu, 29 Jul 2021 10:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236993AbhG2KlA (ORCPT ); Thu, 29 Jul 2021 06:41:00 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:47826 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235880AbhG2Kkt (ORCPT ); Thu, 29 Jul 2021 06:40:49 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 6CFB43F23A for ; Thu, 29 Jul 2021 10:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555246; bh=BZIMPFV8uXC9L/K0xzDgkM9m6seQbMO32c9dNbfWa80=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BTaP1d8ydrV0hgqkvf/+UhufeiCSWdGIGAW4o196Prd6ZEqDC2WF3iYjM848wn9Dj VPKZ8ix+0RfiaO26QLgqT7Z/1agpsiRaeCzPIDc0jHdLJiHnmltOES+3nX113AcY88 +9XVJP0/1JjYJRM/nSMyX2LE7f615J6AwEZ5nXupdTkR5itCw5mz66kXyZpHPcGBLf 7rS9vDW9u8VlblQ0tv8KO25uGVKV/GU21bs4JxY77fjIaBCJ+MIo8nWAzep7v78vAn zsvgWkvLVPIgGMNqKzHht81g6NPRQxwWcEhaWWYlvOLySc15W0153dZ6YFCDSDaOt+ mclQZNrRELrLA== Received: by mail-ed1-f70.google.com with SMTP id p2-20020a50c9420000b02903a12bbba1ebso2729727edh.6 for ; Thu, 29 Jul 2021 03:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BZIMPFV8uXC9L/K0xzDgkM9m6seQbMO32c9dNbfWa80=; b=LfMJhctMPZP07KPs5q1R6GJZ1e4K4RL6FIahb7ZRJgzrTFQ2Zy9R1IHqjguheOOuk3 txnvcF1fD54xLnWKk2vsQKUGb7hJcyGUfC9+h3wn09NRLQ6Ho81M1ff5+y7q+cKZBEJi f/bbcYWcpRTIXav3Mj4FacMtW3Mtq2BMbNg1vGTlT2U2c9OtbnR6L1V0XStF0DrTZYO8 UNRl7mn0cYNLTYpgxHWJ+mnu0XzvP0ekrTa3DdFwHb67lpKYf67SVQVeW4hWcHKeZQJn 9ZN8oLPUCpeiUkBX0m1nMYlz4Pw+aNWTP+Q5+vg7xbCz5D+8AayciSydXrImylRE++xs Tjzg== X-Gm-Message-State: AOAM53294Oe2Acy/QmnWcvkDOKg9Hmk1l68y16HmYs8/zUDYPNimCnNV 0eBAGnaCx57wJ2u5MmE5RXyly1j2thvNEGiHhwN82zsz+GTI2XxtAZlbBeLPyF8KVkO1GZI0yx9 wEs5mgpYJEEb+5h0/r35Vmrw7BaoRPgX1iQ== X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr3881339ejb.428.1627555246144; Thu, 29 Jul 2021 03:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygcbnz2mL1I+EM9Bv/vZsYeICNIGIdcaZXywSSZmph4zECffAhqDCrnUSC3LB/1TyQegjgiQ== X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr3881326ejb.428.1627555246020; Thu, 29 Jul 2021 03:40:46 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id c14sm824475ejb.78.2021.07.29.03.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:40:45 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 10/12] nfc: microread: constify several pointers Date: Thu, 29 Jul 2021 12:40:20 +0200 Message-Id: <20210729104022.47761-11-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/microread/i2c.c | 2 +- drivers/nfc/microread/microread.c | 4 ++-- drivers/nfc/microread/microread.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c index f91760c78455..86f593c73ed6 100644 --- a/drivers/nfc/microread/i2c.c +++ b/drivers/nfc/microread/i2c.c @@ -73,7 +73,7 @@ static void microread_i2c_remove_len_crc(struct sk_buff *skb) skb_trim(skb, MICROREAD_I2C_FRAME_TAILROOM); } -static int check_crc(struct sk_buff *skb) +static int check_crc(const struct sk_buff *skb) { int i; u8 crc = 0; diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c index 8e847524937c..9d83ccebd434 100644 --- a/drivers/nfc/microread/microread.c +++ b/drivers/nfc/microread/microread.c @@ -358,7 +358,7 @@ static int microread_complete_target_discovered(struct nfc_hci_dev *hdev, static void microread_im_transceive_cb(void *context, struct sk_buff *skb, int err) { - struct microread_info *info = context; + const struct microread_info *info = context; switch (info->async_cb_type) { case MICROREAD_CB_TYPE_READER_ALL: @@ -642,7 +642,7 @@ static const struct nfc_hci_ops microread_hci_ops = { }; int microread_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, - char *llc_name, int phy_headroom, int phy_tailroom, + const char *llc_name, int phy_headroom, int phy_tailroom, int phy_payload, struct nfc_hci_dev **hdev) { struct microread_info *info; diff --git a/drivers/nfc/microread/microread.h b/drivers/nfc/microread/microread.h index 76152d7aa53c..2ee7ccfa22dd 100644 --- a/drivers/nfc/microread/microread.h +++ b/drivers/nfc/microread/microread.h @@ -11,7 +11,7 @@ #define DRIVER_DESC "NFC driver for microread" int microread_probe(void *phy_id, const struct nfc_phy_ops *phy_ops, - char *llc_name, int phy_headroom, int phy_tailroom, + const char *llc_name, int phy_headroom, int phy_tailroom, int phy_payload, struct nfc_hci_dev **hdev); void microread_remove(struct nfc_hci_dev *hdev); From patchwork Thu Jul 29 10:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 489151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E73CDC432BE for ; Thu, 29 Jul 2021 10:42:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE78360C41 for ; Thu, 29 Jul 2021 10:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235679AbhG2Kmx (ORCPT ); Thu, 29 Jul 2021 06:42:53 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:48058 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbhG2Kmw (ORCPT ); Thu, 29 Jul 2021 06:42:52 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 9047B3F0B8 for ; Thu, 29 Jul 2021 10:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627555368; bh=1aqWonZ1UVeYrgP40WWguDTIwwMWBTXMW2a73Xqk2/I=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fTaOL6yTA1N+j0b4PUpgzWYos85Rpw0HlW0/TgjfeqewNixyjGNfObfDbsVVve1bV yydbMj9K5Ccic8BYEPXdTA4fkQWUWx7oJkgK/ZE65F4lEb/LuC3WVjJmC1AffOmwA1 sGu1k8b6HYE9IzZyrbjGgGc+UubqOQ2+eXU6evx/KPw39ESOd7+97h8+GRCB06Mrl7 +igO0k3WafwE2vQOrr3evhhnc/jFz2vKZ4rOP/1zt5kbkapY8/rZSQ3V7pAeoLDpbz Wz7HRQtEPwtjuNJStAMXPRCC/E2OFNve8/u1A5YWbdQJm8IQeyp/KlLsZmT8d9XkZS vHHNwVaZWX8vA== Received: by mail-ej1-f71.google.com with SMTP id ci25-20020a1709072679b029058e79f6c38aso1520019ejc.13 for ; Thu, 29 Jul 2021 03:42:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1aqWonZ1UVeYrgP40WWguDTIwwMWBTXMW2a73Xqk2/I=; b=fO++ENs7EkvaEq9EJ+/dj8g9IfP1/tiEpVUJCVNHUmuZciYTDlgbYnxd2JkiFW7ito L4GsAKFqP2NoHjmehQcJwAqRgMoeLQxPQoj5UYomeZcPVacFJUpzuZ+ClzqFkW632kCD fgW/CfAfil+bYdgfEKvPyuDid3d0Wx3KIQKTHVUkD+GAeiMZP4ciirO0DVJv52iuWg+0 YzzAO9zZm1YeVeGF6v3SsDE4H7JHVn7UkQ9TE4xxTa9P0W9SLXHSFNIhjD2LAsCRgLVO zCOaWv8utxR9zrAeLl1Xs5kXqwNjHvKxciOBMyx+UJxr4OVfF/90LNWuGR+OO/MLhxkk 2gAQ== X-Gm-Message-State: AOAM532nU+pP1oSY9g/e9oGBAN2qZADgk8FUdGOS5K38g9vuTACmwMdL o1fsZsmL9vasmEFV5zEVfvF6xvbOEvxS2BR1VB+4fKieoOuTnfqnqdOyJyJzUhMXzxPbr8wxJRH Cb+sGX2dFqzo8xSNb4bDbmnvSgO77qwFvXg== X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr4104325ejc.196.1627555368318; Thu, 29 Jul 2021 03:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7aV8dzqZZfnsgycbu2nLiwhd9HngRE7rGbZygUqpYd4zH2xG3lNFXnZlVjoxsJ3E/BKLvUA== X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr4104308ejc.196.1627555368118; Thu, 29 Jul 2021 03:42:48 -0700 (PDT) Received: from localhost.localdomain ([86.32.47.9]) by smtp.gmail.com with ESMTPSA id e7sm1048472edk.3.2021.07.29.03.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 03:42:47 -0700 (PDT) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Mark Greer , Bongsu Jeon , "David S. Miller" , Jakub Kicinski , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH 12/12] nfc: mrvl: constify static nfcmrvl_if_ops Date: Thu, 29 Jul 2021 12:42:41 +0200 Message-Id: <20210729104241.48086-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> References: <20210729104022.47761-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org File-scope struct nfcmrvl_if_ops is not modified so can be made const. Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/nfcmrvl/i2c.c | 2 +- drivers/nfc/nfcmrvl/main.c | 2 +- drivers/nfc/nfcmrvl/nfcmrvl.h | 4 ++-- drivers/nfc/nfcmrvl/spi.c | 2 +- drivers/nfc/nfcmrvl/uart.c | 2 +- drivers/nfc/nfcmrvl/usb.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c index 6e659e77c8a2..c38b228006fd 100644 --- a/drivers/nfc/nfcmrvl/i2c.c +++ b/drivers/nfc/nfcmrvl/i2c.c @@ -146,7 +146,7 @@ static void nfcmrvl_i2c_nci_update_config(struct nfcmrvl_private *priv, { } -static struct nfcmrvl_if_ops i2c_ops = { +static const struct nfcmrvl_if_ops i2c_ops = { .nci_open = nfcmrvl_i2c_nci_open, .nci_close = nfcmrvl_i2c_nci_close, .nci_send = nfcmrvl_i2c_nci_send, diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index d8e48bdaf652..2fcf545012b1 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c @@ -91,7 +91,7 @@ static const struct nci_ops nfcmrvl_nci_ops = { struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy, void *drv_data, - struct nfcmrvl_if_ops *ops, + const struct nfcmrvl_if_ops *ops, struct device *dev, const struct nfcmrvl_platform_data *pdata) { diff --git a/drivers/nfc/nfcmrvl/nfcmrvl.h b/drivers/nfc/nfcmrvl/nfcmrvl.h index 84fafa95965e..165bd0a95190 100644 --- a/drivers/nfc/nfcmrvl/nfcmrvl.h +++ b/drivers/nfc/nfcmrvl/nfcmrvl.h @@ -77,7 +77,7 @@ struct nfcmrvl_private { /* PHY type */ enum nfcmrvl_phy phy; /* Low level driver ops */ - struct nfcmrvl_if_ops *if_ops; + const struct nfcmrvl_if_ops *if_ops; }; struct nfcmrvl_if_ops { @@ -92,7 +92,7 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv); int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, struct sk_buff *skb); struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy, void *drv_data, - struct nfcmrvl_if_ops *ops, + const struct nfcmrvl_if_ops *ops, struct device *dev, const struct nfcmrvl_platform_data *pdata); diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c index 7b015bb33fc9..d64abd0c4df3 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -99,7 +99,7 @@ static void nfcmrvl_spi_nci_update_config(struct nfcmrvl_private *priv, drv_data->nci_spi->xfer_speed_hz = config->clk; } -static struct nfcmrvl_if_ops spi_ops = { +static const struct nfcmrvl_if_ops spi_ops = { .nci_open = nfcmrvl_spi_nci_open, .nci_close = nfcmrvl_spi_nci_close, .nci_send = nfcmrvl_spi_nci_send, diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c index 63ac434675c8..9c92cbdc42f0 100644 --- a/drivers/nfc/nfcmrvl/uart.c +++ b/drivers/nfc/nfcmrvl/uart.c @@ -49,7 +49,7 @@ static void nfcmrvl_uart_nci_update_config(struct nfcmrvl_private *priv, config->flow_control); } -static struct nfcmrvl_if_ops uart_ops = { +static const struct nfcmrvl_if_ops uart_ops = { .nci_open = nfcmrvl_uart_nci_open, .nci_close = nfcmrvl_uart_nci_close, .nci_send = nfcmrvl_uart_nci_send, diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c index 9d649b45300b..a99aedff795d 100644 --- a/drivers/nfc/nfcmrvl/usb.c +++ b/drivers/nfc/nfcmrvl/usb.c @@ -264,7 +264,7 @@ static int nfcmrvl_usb_nci_send(struct nfcmrvl_private *priv, return err; } -static struct nfcmrvl_if_ops usb_ops = { +static const struct nfcmrvl_if_ops usb_ops = { .nci_open = nfcmrvl_usb_nci_open, .nci_close = nfcmrvl_usb_nci_close, .nci_send = nfcmrvl_usb_nci_send,