From: Rohit Chavan <roheetchavan@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Rohit Chavan <roheetchavan@gmail.com>
Subject: [PATCH] lib80211: Use ERR_CAST() to return
Date: Fri, 6 Sep 2024 17:14:55 +0530 [thread overview]
Message-ID: <20240906114455.730559-1-roheetchavan@gmail.com> (raw)
Using ERR_CAST() is more reasonable and safer, When it is necessary
to convert the type of an error pointer and return it.
Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
---
net/wireless/lib80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
index d66a913027e0..87c0e09aa676 100644
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -227,7 +227,7 @@ EXPORT_SYMBOL(lib80211_get_crypto_ops);
static void *lib80211_crypt_null_init(int keyidx)
{
- return (void *)1;
+ return ERR_CAST(1);
}
static void lib80211_crypt_null_deinit(void *priv)
--
2.34.1
next reply other threads:[~2024-09-06 11:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 11:44 Rohit Chavan [this message]
2024-09-06 11:54 ` [PATCH] lib80211: Use ERR_CAST() to return Johannes Berg
2024-09-06 19:08 ` Simon Horman
2024-09-07 7:47 ` kernel test robot
2024-09-07 7:47 ` kernel test robot
2024-09-07 20:08 ` Al Viro
2024-09-07 21:49 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906114455.730559-1-roheetchavan@gmail.com \
--to=roheetchavan@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).