From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754505AbbIJLuG (ORCPT ); Thu, 10 Sep 2015 07:50:06 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36195 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754387AbbIJLt4 (ORCPT ); Thu, 10 Sep 2015 07:49:56 -0400 From: Sergey Senozhatsky To: Andrew Morton Cc: Seth Jennings , Dan Streetman , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey SENOZHATSKY Subject: [PATCH 1/2] mm:zpool: constify struct zpool type Date: Thu, 10 Sep 2015 20:48:37 +0900 Message-Id: <1441885718-32580-2-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1441885718-32580-1-git-send-email-sergey.senozhatsky@gmail.com> References: <1441885718-32580-1-git-send-email-sergey.senozhatsky@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey SENOZHATSKY Constify `struct zpool' ->type. Signed-off-by: Sergey Senozhatsky --- 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 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