From: Darren Salt <linux@youmustbejoking.demon.co.uk>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 3/6] Constification.
Date: Fri, 22 Jan 2010 23:35:27 +0000 [thread overview]
Message-ID: <1264203330-20785-3-git-send-email-linux@youmustbejoking.demon.co.uk> (raw)
In-Reply-To: <1264203330-20785-2-git-send-email-linux@youmustbejoking.demon.co.uk>
---
rfkill.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/rfkill.c b/rfkill.c
index 3cb2605..8c0aea6 100644
--- a/rfkill.c
+++ b/rfkill.c
@@ -195,9 +195,9 @@ static void rfkill_block(bool all, __u32 idx, __u8 block, __u8 type)
struct rfkill_type_str {
enum rfkill_type type;
- char *name;
+ const char *name;
};
-static struct rfkill_type_str rfkill_type_strings[] = {
+static const struct rfkill_type_str rfkill_type_strings[] = {
{ .type = RFKILL_TYPE_ALL, .name = "all" },
{ .type = RFKILL_TYPE_WLAN, .name = "wifi" },
{ .type = RFKILL_TYPE_WLAN, .name = "wlan" }, /* alias */
@@ -211,9 +211,9 @@ static struct rfkill_type_str rfkill_type_strings[] = {
{ .name = NULL }
};
-static enum rfkill_type rfkill_str_to_type(char *s)
+static enum rfkill_type rfkill_str_to_type(const char *s)
{
- struct rfkill_type_str *p;
+ const struct rfkill_type_str *p;
for (p = rfkill_type_strings; p->name != NULL; p++) {
if ((strlen(s) == strlen(p->name)) && (!strcmp(s,p->name)))
@@ -244,7 +244,7 @@ static void version(void)
printf("rfkill %s\n", rfkill_version);
}
-static void do_block_unblock(__u8 block, char *param)
+static void do_block_unblock(__u8 block, const char *param)
{
enum rfkill_type t;
__u32 idx;
--
1.6.5
next prev parent reply other threads:[~2010-01-22 23:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-22 23:35 [PATCH 1/6] Add "wlan" and "ultrawideband" as aliases for "wifi" and "uwb" Darren Salt
2010-01-22 23:35 ` [PATCH 2/6] Rearrange the help text for block & unblock Darren Salt
2010-01-22 23:35 ` Darren Salt [this message]
2010-01-22 23:35 ` [PATCH 4/6] Return error codes instead of exiting Darren Salt
2010-01-22 23:35 ` [PATCH 5/6] Refactor rfkill index/type lookup: move it below rfkill_block Darren Salt
2010-01-22 23:35 ` [PATCH 6/6] Add filtering to "rfkill list" Darren Salt
2010-01-23 12:52 ` [PATCH 1/6] Add "wlan" and "ultrawideband" as aliases for "wifi" and "uwb" Johannes Berg
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=1264203330-20785-3-git-send-email-linux@youmustbejoking.demon.co.uk \
--to=linux@youmustbejoking.demon.co.uk \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@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