Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222143

[PATCH 1/2] mm:zpool: constify struct zpool type

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] mm:zpool: constify struct zpool type
Date Thu, 10 Sep 2015 14:00:02 +0200
Message-ID <q78Ge-vY-15@gated-at.bofh.it> (permalink)
References <q78wy-kz-13@gated-at.bofh.it>
X-Original-To Andrew Morton <akpm@linux-foundation.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=muKdupqIf3trD9bOp1+NCNgF74PFkSsesOnIBo4xW54=; b=iKeC43Uj8YZaCMW26ILHRxVDD+adgoL1fJdLMSoV6wKyqGoUoon57VWc0twwGw9x1C 15MPmQGOHsa27ELXBTsNSyRzPcUn5ONRPDpu008ji/eUlRNoBHibX2FD9uf2VgkV+tk2 BbRjD+M+vUkGj/Rhlq9TJU0/gKXtPUJHucdt92Y0EvzvvnF+Zk/uWhMcPCshnXVLEZf8 P1NiujLel8KOES72jYWnkYq1hYpFbbi1W+OhLdBpVnP0vhoIXxBqO6R6tIb3M8xD+hn8 IWQNUFT4VLZHe0iB71sztEVjnwORYcF6hOeDq3LDYVh+SanP2zFIq1aspfFT8kfz/Jyh 167w==
X-Received by 10.68.57.143 with SMTP id i15mr83078520pbq.104.1441885796267; Thu, 10 Sep 2015 04:49:56 -0700 (PDT)
X-Mailer git-send-email 2.5.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 96
Organization linux.* mail to news gateway
X-Original-Cc Seth Jennings <sjennings@variantweb.net>, Dan Streetman <ddstreet@ieee.org>, Minchan Kim <minchan@kernel.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>, Sergey SENOZHATSKY <sergey.senozhatsky@gmail.com>
X-Original-Date Thu, 10 Sep 2015 20:48:37 +0900
X-Original-Message-ID <1441885718-32580-2-git-send-email-sergey.senozhatsky@gmail.com>
X-Original-References <1441885718-32580-1-git-send-email-sergey.senozhatsky@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1222143

Show key headers only | View raw


From: Sergey SENOZHATSKY <sergey.senozhatsky@gmail.com>

Constify `struct zpool' ->type.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 include/linux/zpool.h |  8 ++++----
 mm/zpool.c            | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/zpool.h b/include/linux/zpool.h
index 42f8ec9..2c136f4 100644
--- a/include/linux/zpool.h
+++ b/include/linux/zpool.h
@@ -36,12 +36,12 @@ enum zpool_mapmode {
 	ZPOOL_MM_DEFAULT = ZPOOL_MM_RW
 };
 
-bool zpool_has_pool(char *type);
+bool zpool_has_pool(const char *type);
 
-struct zpool *zpool_create_pool(char *type, char *name,
+struct zpool *zpool_create_pool(const char *type, char *name,
 			gfp_t gfp, const struct zpool_ops *ops);
 
-char *zpool_get_type(struct zpool *pool);
+const char *zpool_get_type(struct zpool *pool);
 
 void zpool_destroy_pool(struct zpool *pool);
 
@@ -78,7 +78,7 @@ u64 zpool_get_total_size(struct zpool *pool);
  * with zpool.
  */
 struct zpool_driver {
-	char *type;
+	const char *type;
 	struct module *owner;
 	atomic_t refcount;
 	struct list_head list;
diff --git a/mm/zpool.c b/mm/zpool.c
index 8f670d3..2889d0d 100644
--- a/mm/zpool.c
+++ b/mm/zpool.c
@@ -18,7 +18,7 @@
 #include <linux/zpool.h>
 
 struct zpool {
-	char *type;
+	const char *type;
 
 	struct zpool_driver *driver;
 	void *pool;
@@ -73,7 +73,7 @@ int zpool_unregister_driver(struct zpool_driver *driver)
 }
 EXPORT_SYMBOL(zpool_unregister_driver);
 
-static struct zpool_driver *zpool_get_driver(char *type)
+static struct zpool_driver *zpool_get_driver(const char *type)
 {
 	struct zpool_driver *driver;
 
@@ -115,7 +115,7 @@ static void zpool_put_driver(struct zpool_driver *driver)
  *
  * Returns: true if @type pool is available, false if not
  */
-bool zpool_has_pool(char *type)
+bool zpool_has_pool(const char *type)
 {
 	struct zpool_driver *driver = zpool_get_driver(type);
 
@@ -147,7 +147,7 @@ EXPORT_SYMBOL(zpool_has_pool);
  *
  * Returns: New zpool on success, NULL on failure.
  */
-struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp,
+struct zpool *zpool_create_pool(const char *type, char *name, gfp_t gfp,
 		const struct zpool_ops *ops)
 {
 	struct zpool_driver *driver;
@@ -228,7 +228,7 @@ void zpool_destroy_pool(struct zpool *zpool)
  *
  * Returns: The type of zpool.
  */
-char *zpool_get_type(struct zpool *zpool)
+const char *zpool_get_type(struct zpool *zpool)
 {
 	return zpool->type;
 }
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] mm:constify zpool/zs_pool char members Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-10 13:50 +0200
  [PATCH 2/2] mm:zsmalloc: constify struct zs_pool name Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-10 14:00 +0200
  [PATCH 1/2] mm:zpool: constify struct zpool type Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-10 14:00 +0200
    Re: [PATCH 1/2] mm:zpool: constify struct zpool type Andrew Morton <akpm@linux-foundation.org> - 2015-09-12 00:30 +0200
      Re: [PATCH 1/2] mm:zpool: constify struct zpool type Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-12 02:40 +0200
  Re: [PATCH 0/2] mm:constify zpool/zs_pool char members Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-11 14:20 +0200

csiph-web