From patchwork Fri Jan 22 23:35:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Salt X-Patchwork-Id: 74811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0MNZlYm018769 for ; Fri, 22 Jan 2010 23:35:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755867Ab0AVXfp (ORCPT ); Fri, 22 Jan 2010 18:35:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755117Ab0AVXfk (ORCPT ); Fri, 22 Jan 2010 18:35:40 -0500 Received: from lon1-post-3.mail.demon.net ([195.173.77.150]:53918 "EHLO lon1-post-3.mail.demon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754621Ab0AVXfg (ORCPT ); Fri, 22 Jan 2010 18:35:36 -0500 Received: from youmustbejoking.demon.co.uk ([80.176.152.238] helo=pentagram.youmustbejoking.demon.co.uk) by lon1-post-3.mail.demon.net with esmtp (Exim 4.69) id 1NYT2N-0001JR-dX; Fri, 22 Jan 2010 23:35:35 +0000 Received: from [192.168.0.5] (helo=localhost.localdomain) by pentagram.youmustbejoking.demon.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1NYT2M-0006FB-Px; Fri, 22 Jan 2010 23:35:34 +0000 From: Darren Salt To: Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: [PATCH 3/6] Constification. Date: Fri, 22 Jan 2010 23:35:27 +0000 Message-Id: <1264203330-20785-3-git-send-email-linux@youmustbejoking.demon.co.uk> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1264203330-20785-2-git-send-email-linux@youmustbejoking.demon.co.uk> References: <1264203330-20785-1-git-send-email-linux@youmustbejoking.demon.co.uk> <1264203330-20785-2-git-send-email-linux@youmustbejoking.demon.co.uk> X-SA-Exim-Connect-IP: 192.168.0.5 X-SA-Exim-Mail-From: linux@youmustbejoking.demon.co.uk X-SA-Exim-Scanned: No (on pentagram.youmustbejoking.demon.co.uk); SAEximRunCond expanded to false Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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;