From: gabriele.modena@gmail.com
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, Gabriele Modena <gabriele.modena@gmail.com>
Subject: [PATCH] wimax: attempt to address style issues.
Date: Tue, 2 Mar 2021 10:11:02 +0100 [thread overview]
Message-ID: <20210302091102.1598-1-gabriele.modena@gmail.com> (raw)
From: Gabriele Modena <gabriele.modena@gmail.com>
When running checkpatch.pl on op-msg.c, op-rfkill.c
and stack.c I noticed that they contained a few style issues
at warning level of severity. This patch is both an attempt to
address the warnings, as well as a way for me to familiarise
with the linux kernel contribution process, by following
tasks proposed by a popular online challenge.
Signed-off-by: Gabriele Modena <gabriele.modena@gmail.com>
---
drivers/staging/wimax/op-msg.c | 8 ++++----
drivers/staging/wimax/op-rfkill.c | 7 ++++---
drivers/staging/wimax/stack.c | 12 ++++++------
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/wimax/op-msg.c b/drivers/staging/wimax/op-msg.c
index e20ac7d84e82..11da48bf704f 100644
--- a/drivers/staging/wimax/op-msg.c
+++ b/drivers/staging/wimax/op-msg.c
@@ -142,8 +142,8 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev,
}
result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg);
if (result < 0) {
- dev_err(dev, "no memory to add payload (msg %p size %zu) in "
- "attribute: %d\n", msg, size, result);
+ dev_err(dev, "no memory to add payload (msg %p size %zu) in attribute: %d\n",
+ msg, size, result);
goto error_nla_put;
}
genlmsg_end(skb, genl_msg);
@@ -260,6 +260,7 @@ int wimax_msg_send(struct wimax_dev *wimax_dev, struct sk_buff *skb)
struct device *dev = wimax_dev_to_dev(wimax_dev);
void *msg = skb->data;
size_t size = skb->len;
+
might_sleep();
d_printf(1, dev, "CTX: wimax msg, %zu bytes\n", size);
@@ -340,8 +341,7 @@ int wimax_gnl_doit_msg_from_user(struct sk_buff *skb, struct genl_info *info)
/* Unpack arguments */
result = -EINVAL;
if (info->attrs[WIMAX_GNL_MSG_DATA] == NULL) {
- dev_err(dev, "WIMAX_GNL_MSG_FROM_USER: can't find MSG_DATA "
- "attribute\n");
+ dev_err(dev, "WIMAX_GNL_MSG_FROM_USER: can't find MSG_DATA attribute\n");
goto error_no_data;
}
msg_buf = nla_data(info->attrs[WIMAX_GNL_MSG_DATA]);
diff --git a/drivers/staging/wimax/op-rfkill.c b/drivers/staging/wimax/op-rfkill.c
index 78b294481a59..52612ed09183 100644
--- a/drivers/staging/wimax/op-rfkill.c
+++ b/drivers/staging/wimax/op-rfkill.c
@@ -294,7 +294,8 @@ int wimax_rfkill(struct wimax_dev *wimax_dev, enum wimax_rf_state state)
/* While initializing, < 1.4.3 wimax-tools versions use
* this call to check if the device is a valid WiMAX
* device; so we allow it to proceed always,
- * considering the radios are all off. */
+ * considering the radios are all off.
+ */
if (result == -ENOMEDIUM && state == WIMAX_RF_QUERY)
result = WIMAX_RF_OFF << 1 | WIMAX_RF_OFF;
goto error_not_ready;
@@ -378,6 +379,7 @@ int wimax_rfkill_add(struct wimax_dev *wimax_dev)
void wimax_rfkill_rm(struct wimax_dev *wimax_dev)
{
struct device *dev = wimax_dev_to_dev(wimax_dev);
+
d_fnstart(3, dev, "(wimax_dev %p)\n", wimax_dev);
rfkill_unregister(wimax_dev->rfkill);
rfkill_destroy(wimax_dev->rfkill);
@@ -415,8 +417,7 @@ int wimax_gnl_doit_rfkill(struct sk_buff *skb, struct genl_info *info)
dev = wimax_dev_to_dev(wimax_dev);
result = -EINVAL;
if (info->attrs[WIMAX_GNL_RFKILL_STATE] == NULL) {
- dev_err(dev, "WIMAX_GNL_RFKILL: can't find RFKILL_STATE "
- "attribute\n");
+ dev_err(dev, "WIMAX_GNL_RFKILL: can't find RFKILL_STATE attribute\n");
goto error_no_pid;
}
new_state = nla_get_u32(info->attrs[WIMAX_GNL_RFKILL_STATE]);
diff --git a/drivers/staging/wimax/stack.c b/drivers/staging/wimax/stack.c
index ace24a6dfd2d..e44158334246 100644
--- a/drivers/staging/wimax/stack.c
+++ b/drivers/staging/wimax/stack.c
@@ -51,9 +51,7 @@ static char wimax_debug_params[128];
module_param_string(debug, wimax_debug_params, sizeof(wimax_debug_params),
0644);
MODULE_PARM_DESC(debug,
- "String of space-separated NAME:VALUE pairs, where NAMEs "
- "are the different debug submodules and VALUE are the "
- "initial debug value to set.");
+ "String of space-separated NAME:VALUE pairs, where NAMEs are the different debug submodules and VALUE are the initial debug value to set.");
/*
* Authoritative source for the RE_STATE_CHANGE attribute policy
@@ -62,7 +60,7 @@ MODULE_PARM_DESC(debug,
* close to where the data is generated.
*/
/*
-static const struct nla_policy wimax_gnl_re_status_change[WIMAX_GNL_ATTR_MAX + 1] = {
+ * static const struct nla_policy wimax_gnl_re_status_change[WIMAX_GNL_ATTR_MAX + 1] = {
[WIMAX_GNL_STCH_STATE_OLD] = { .type = NLA_U8 },
[WIMAX_GNL_STCH_STATE_NEW] = { .type = NLA_U8 },
};
@@ -156,6 +154,7 @@ int wimax_gnl_re_state_change_send(
{
int result = 0;
struct device *dev = wimax_dev_to_dev(wimax_dev);
+
d_fnstart(3, dev, "(wimax_dev %p report_skb %p)\n",
wimax_dev, report_skb);
if (report_skb == NULL) {
@@ -275,8 +274,8 @@ void __wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)
/* Execute the actions of entry to the new state */
switch (new_state) {
case __WIMAX_ST_NULL:
- dev_err(dev, "SW BUG: wimax_dev %p entering NULL state "
- "from %u\n", wimax_dev, wimax_dev->state);
+ dev_err(dev, "SW BUG: wimax_dev %p entering NULL state from %u\n",
+ wimax_dev, wimax_dev->state);
WARN_ON(1); /* Nobody can enter this state */
break;
case WIMAX_ST_DOWN:
@@ -362,6 +361,7 @@ EXPORT_SYMBOL_GPL(wimax_state_change);
enum wimax_st wimax_state_get(struct wimax_dev *wimax_dev)
{
enum wimax_st state;
+
mutex_lock(&wimax_dev->mutex);
state = wimax_dev->state;
mutex_unlock(&wimax_dev->mutex);
--
2.11.0
next reply other threads:[~2021-03-02 9:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 9:11 gabriele.modena [this message]
2021-03-02 9:29 ` [PATCH] wimax: attempt to address style issues Greg KH
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=20210302091102.1598-1-gabriele.modena@gmail.com \
--to=gabriele.modena@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
/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).