staging/zache KBUILD_MODNAME, checkpatch fixes
cover staging/zache KBUILD_MODNAME, checkpatch fixes
1) As per Joe's suggestion:
"Perhaps it'd be better to use KBUILD_MODNAME all the time instead of adding the prefix. Also, to me mixing "ramster: " and "zcache: " for the prefixes is odd. Just using zcache all the time would be simpler, so remove namestr too."
2) Some checkpatch fixes
Robert Berger (4):
fix: ERROR: spaces prohibited around that ':' (ctx:VxW) KBUILD_MODNAME and checkpatch fixes KBUILD_MODNAME and checkpatch fixes KBUILD_MODNAME instead of "ramster: "
drivers/staging/zcache/ramster/ramster.c | 34 ++++---- drivers/staging/zcache/ramster/tcp.c | 36 ++++---- drivers/staging/zcache/zbud.c | 4 +- drivers/staging/zcache/zcache-main.c | 137 ++++++++++++++---------------- 4 files changed, 103 insertions(+), 108 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/4 staging/zache checkpatch ERROR: spaces prohibited around that
zbud.c:106: ERROR: spaces prohibited around that ':' (ctx:VxW) zbud.c:107: ERROR: spaces prohibited around that ':' (ctx:VxW)
--- drivers/staging/zcache/zbud.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/zcache/zbud.c +2 -2
@@ -103,8 +103,8 @@ struct zbudpage {struct {unsigned long space_for_flags;struct { -unsigned zbud0_size:PAGE_SHIFT ; -unsigned zbud1_size:PAGE_SHIFT ; +unsigned zbud0_size:PAGE_SHIFT ; +unsigned zbud1_size:PAGE_SHIFT ;unsigned unevictable:2 ; };struct list_head budlist;
Signature · 1 line
1.7.9.5
PATCH 2/4 staging/zache BUILD_MODNAME and checkpatch fixes
In reply to Robert BergerAs per Joe's suggestion:
"Perhaps it'd be better to use KBUILD_MODNAME all the time instead of adding the prefix. Also, to me mixing "ramster: " and "zcache: " for the prefixes is odd. Just using zcache all the time would be simpler, so remove namestr too."
checkpatch fixes:
zcache-main.c:1987: WARNING: quoted string split across lines zcache-main.c:2002: WARNING: quoted string split across lines
--- drivers/staging/zcache/zcache-main.c | 137 ++++++++++++++++------------------ 1 file changed, 65 insertions(+), 72 deletions(-)
drivers/staging/zcache/zcache-main.c +65 -72
@@ -12,6 +12,8 @@* be "reclaimed" efficiently. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/cpu.h> #include <linux/highmem.h>
@@ -67,7 +69,6 @@ static int disable_cleancache __read_mostly;static int disable_frontswap__read_mostly ;static int disable_frontswap_ignore_nonactive__read_mostly ;static int disable_cleancache_ignore_nonactive__read_mostly ; -static char *namestr__read_mostly ="zcache" ;#define ZCACHE_GFP_MASK \ (__GFP_FS | __GFP_NORETRY | __GFP_NOWARN | __GFP_NOMEMALLOC)
@@ -262,64 +263,64 @@ static int zcache_debugfs_init(void)/* developers can call this in case of ooms, e.g. to find memory leaks */ void zcache_dump (void ) { -pr_info ("zcache: obj_count=%lu\n" , zcache_obj_count); -pr_info ("zcache: obj_count_max=%lu\n" , zcache_obj_count_max); -pr_info ("zcache: objnode_count=%lu\n" , zcache_objnode_count); -pr_info ("zcache: objnode_count_max=%lu\n" , zcache_objnode_count_max); -pr_info ("zcache: flush_total=%lu\n" , zcache_flush_total); -pr_info ("zcache: flush_found=%lu\n" , zcache_flush_found); -pr_info ("zcache: flobj_total=%lu\n" , zcache_flobj_total); -pr_info ("zcache: flobj_found=%lu\n" , zcache_flobj_found); -pr_info ("zcache: failed_eph_puts=%lu\n" , zcache_failed_eph_puts); -pr_info ("zcache: failed_pers_puts=%lu\n" , zcache_failed_pers_puts); -pr_info ("zcache: failed_get_free_pages=%lu\n" , +pr_info ("obj_count=%lu\n" , zcache_obj_count); +pr_info ("obj_count_max=%lu\n" , zcache_obj_count_max); +pr_info ("objnode_count=%lu\n" , zcache_objnode_count); +pr_info ("objnode_count_max=%lu\n" , zcache_objnode_count_max); +pr_info ("flush_total=%lu\n" , zcache_flush_total); +pr_info ("flush_found=%lu\n" , zcache_flush_found); +pr_info ("flobj_total=%lu\n" , zcache_flobj_total); +pr_info ("flobj_found=%lu\n" , zcache_flobj_found); +pr_info ("failed_eph_puts=%lu\n" , zcache_failed_eph_puts); +pr_info ("failed_pers_puts=%lu\n" , zcache_failed_pers_puts); +pr_info ("failed_get_free_pages=%lu\n" , zcache_failed_getfreepages); -pr_info ("zcache: failed_alloc=%lu\n" , zcache_failed_alloc); -pr_info ("zcache: put_to_flush=%lu\n" , zcache_put_to_flush); -pr_info ("zcache: compress_poor=%lu\n" , zcache_compress_poor); -pr_info ("zcache: mean_compress_poor=%lu\n" , +pr_info ("failed_alloc=%lu\n" , zcache_failed_alloc); +pr_info ("put_to_flush=%lu\n" , zcache_put_to_flush); +pr_info ("compress_poor=%lu\n" , zcache_compress_poor); +pr_info ("mean_compress_poor=%lu\n" , zcache_mean_compress_poor); -pr_info ("zcache: eph_ate_tail=%lu\n" , zcache_eph_ate_tail); -pr_info ("zcache: eph_ate_tail_failed=%lu\n" , +pr_info ("eph_ate_tail=%lu\n" , zcache_eph_ate_tail); +pr_info ("eph_ate_tail_failed=%lu\n" , zcache_eph_ate_tail_failed); -pr_info ("zcache: pers_ate_eph=%lu\n" , zcache_pers_ate_eph); -pr_info ("zcache: pers_ate_eph_failed=%lu\n" , +pr_info ("pers_ate_eph=%lu\n" , zcache_pers_ate_eph); +pr_info ("pers_ate_eph_failed=%lu\n" , zcache_pers_ate_eph_failed); -pr_info ("zcache: evicted_eph_zpages=%lu\n" , zcache_evicted_eph_zpages); -pr_info ("zcache: evicted_eph_pageframes=%lu\n" , +pr_info ("evicted_eph_zpages=%lu\n" , zcache_evicted_eph_zpages); +pr_info ("evicted_eph_pageframes=%lu\n" , zcache_evicted_eph_pageframes); -pr_info ("zcache: eph_pageframes=%lu\n" , zcache_eph_pageframes); -pr_info ("zcache: eph_pageframes_max=%lu\n" , zcache_eph_pageframes_max); -pr_info ("zcache: pers_pageframes=%lu\n" , zcache_pers_pageframes); -pr_info ("zcache: pers_pageframes_max=%lu\n" , +pr_info ("eph_pageframes=%lu\n" , zcache_eph_pageframes); +pr_info ("eph_pageframes_max=%lu\n" , zcache_eph_pageframes_max); +pr_info ("pers_pageframes=%lu\n" , zcache_pers_pageframes); +pr_info ("pers_pageframes_max=%lu\n" , zcache_pers_pageframes_max); -pr_info ("zcache: eph_zpages=%lu\n" , zcache_eph_zpages); -pr_info ("zcache: eph_zpages_max=%lu\n" , zcache_eph_zpages_max); -pr_info ("zcache: pers_zpages=%lu\n" , zcache_pers_zpages); -pr_info ("zcache: pers_zpages_max=%lu\n" , zcache_pers_zpages_max); -pr_info ("zcache: last_active_file_pageframes=%lu\n" , +pr_info ("eph_zpages=%lu\n" , zcache_eph_zpages); +pr_info ("eph_zpages_max=%lu\n" , zcache_eph_zpages_max); +pr_info ("pers_zpages=%lu\n" , zcache_pers_zpages); +pr_info ("pers_zpages_max=%lu\n" , zcache_pers_zpages_max); +pr_info ("last_active_file_pageframes=%lu\n" , zcache_last_active_file_pageframes); -pr_info ("zcache: last_inactive_file_pageframes=%lu\n" , +pr_info ("last_inactive_file_pageframes=%lu\n" , zcache_last_inactive_file_pageframes); -pr_info ("zcache: last_active_anon_pageframes=%lu\n" , +pr_info ("last_active_anon_pageframes=%lu\n" , zcache_last_active_anon_pageframes); -pr_info ("zcache: last_inactive_anon_pageframes=%lu\n" , +pr_info ("last_inactive_anon_pageframes=%lu\n" , zcache_last_inactive_anon_pageframes); -pr_info ("zcache: eph_nonactive_puts_ignored=%lu\n" , +pr_info ("eph_nonactive_puts_ignored=%lu\n" , zcache_eph_nonactive_puts_ignored); -pr_info ("zcache: pers_nonactive_puts_ignored=%lu\n" , +pr_info ("pers_nonactive_puts_ignored=%lu\n" , zcache_pers_nonactive_puts_ignored); -pr_info ("zcache: eph_zbytes=%llu\n" , +pr_info ("eph_zbytes=%llu\n" , (unsigned long long )zcache_eph_zbytes); -pr_info ("zcache: eph_zbytes_max=%llu\n" , +pr_info ("eph_zbytes_max=%llu\n" , (unsigned long long )zcache_eph_zbytes_max); -pr_info ("zcache: pers_zbytes=%llu\n" , +pr_info ("pers_zbytes=%llu\n" , (unsigned long long )zcache_pers_zbytes); -pr_info ("zcache: pers_zbytes_max=%llu\n" , +pr_info ("pers_zbytes_max=%llu\n" , (unsigned long long )zcache_pers_zbytes_max); -pr_info ("zcache: outstanding_writeback_pages=%lu\n" , +pr_info ("outstanding_writeback_pages=%lu\n" , zcache_outstanding_writeback_pages); -pr_info ("zcache: writtenback_pages=%lu\n" , zcache_writtenback_pages); +pr_info ("writtenback_pages=%lu\n" , zcache_writtenback_pages); }#endif
@@ -923,8 +924,7 @@ static int zcache_cpu_notifier(struct notifier_block *nb,case CPU_UP_PREPARE : ret =zcache_comp_cpu_up (cpu);if (ret !=NOTIFY_OK ) { -pr_err ("%s: can't allocate compressor xform\n" , - namestr); +pr_err ("can't allocate compressor xform\n" );return ret; } per_cpu(zcache_dstmem, cpu) = (void *)__get_free_pages(
@@ -1401,8 +1401,7 @@ int zcache_get_page(int cli_id, int pool_id, struct tmem_oid *oidp,zcache_put_pool (pool); }WARN_ONCE ((!is_ephemeral (pool) && (ret !=0 )), -"zcache_get fails on persistent pool, " -"bad things are very likely to happen soon\n" ); +"zcache_get fails on persistent pool, bad things are very likely to happen soon\n" );#ifdef RAMSTER_TESTING if (ret !=0 && ret !=-1 && !(ret == -EINVAL &&is_ephemeral (pool)))pr_err ("TESTING zcache_get tmem_get returns ret=%d\n" , ret);
@@ -1484,10 +1483,9 @@ static int zcache_client_destroy_pool(int cli_id, int pool_id)local_bh_enable ();kfree (pool);if (cli_id ==LOCAL_CLIENT ) -pr_info ("%s: destroyed local pool id=%d\n" , namestr, pool_id); +pr_info ("destroyed local pool id=%d\n" , pool_id);else -pr_info ("%s: destroyed pool id=%d, client=%d\n" , - namestr, pool_id, cli_id); +pr_info ("destroyed pool id=%d, client=%d\n" , pool_id, cli_id); out:return ret; }
@@ -1513,7 +1511,7 @@ int zcache_new_pool(uint16_t cli_id, uint32_t flags)if (cli->tmem_pools[poolid] ==NULL )break ;if (poolid >=MAX_POOLS_PER_CLIENT ) { -pr_info ("%s: pool creation failed: max exceeded\n" , namestr); +pr_info ("pool creation failed: max exceeded\n" );kfree (pool); poolid =-1 ; goto out;
@@ -1524,11 +1522,11 @@ int zcache_new_pool(uint16_t cli_id, uint32_t flags)tmem_new_pool (pool, flags); cli->tmem_pools[poolid] = pool;if (cli_id ==LOCAL_CLIENT ) -pr_info ("%s: created %s local tmem pool, id=%d\n" , namestr, +pr_info ("created %s local tmem pool, id=%d\n" , flags &TMEM_POOL_PERSIST ?"persistent" :"ephemeral" , poolid);else -pr_info ("%s: created %s tmem pool, id=%d, client=%d\n" , namestr, +pr_info ("created %s tmem pool, id=%d, client=%d\n" , flags &TMEM_POOL_PERSIST ?"persistent" :"ephemeral" , poolid, cli_id); out:
@@ -1588,8 +1586,8 @@ int zcache_autocreate_pool(unsigned int cli_id, unsigned int pool_id, bool eph) pool->pool_id = pool_id;tmem_new_pool (pool, flags); cli->tmem_pools[pool_id] = pool; -pr_info ("%s: AUTOcreated %s tmem poolid=%d, for remote client=%d\n" , - namestr, flags &TMEM_POOL_PERSIST ?"persistent" :"ephemeral" , +pr_info ("AUTOcreated %s tmem poolid=%d, for remote client=%d\n" , + flags &TMEM_POOL_PERSIST ?"persistent" :"ephemeral" , pool_id, cli_id); ret =0 ; out:
@@ -1914,8 +1912,7 @@ static int __init zcache_comp_init(void)if (*zcache_comp_name !='\0' ) { ret =crypto_has_comp (zcache_comp_name,0 ,0 );if (!ret) -pr_info ("zcache: %s not supported\n" , - zcache_comp_name); +pr_info ("%s not supported\n" , zcache_comp_name); }if (!ret)strcpy (zcache_comp_name,"lzo" );
@@ -1924,7 +1921,7 @@ static int __init zcache_comp_init(void) ret =1 ; goto out; } -pr_info ("zcache: using %s compressor\n" , zcache_comp_name); +pr_info ("using %s compressor\n" , zcache_comp_name);/* alloc percpu transforms */ ret =0 ;
@@ -1940,7 +1937,6 @@ static int __init zcache_init(void)int ret =0 ;if (ramster_enabled) { - namestr ="ramster" ;ramster_register_pamops (&zcache_pamops); }#ifdef CONFIG_DEBUG_FS
@@ -1953,13 +1949,12 @@ static int __init zcache_init(void)tmem_register_pamops (&zcache_pamops); ret =register_cpu_notifier (&zcache_cpu_notifier_block);if (ret) { -pr_err ("%s: can't register cpu notifier\n" , namestr); +pr_err ("can't register cpu notifier\n" ); goto out; } ret =zcache_comp_init ();if (ret) { -pr_err ("%s: compressor initialization failed\n" , - namestr); +pr_err ("compressor initialization failed\n" ); goto out; }for_each_online_cpu (cpu) {
@@ -1974,7 +1969,7 @@ static int __init zcache_init(void) sizeof(struct tmem_obj), 0, 0, NULL); ret =zcache_new_client (LOCAL_CLIENT );if (ret) { -pr_err ("%s: can't create client\n" , namestr); +pr_err ("can't create client\n" ); goto out; }zbud_init ();
@@ -1983,14 +1978,13 @@ static int __init zcache_init(void)register_shrinker (&zcache_shrinker); old_ops =zcache_cleancache_register_ops (); -pr_info ("%s: cleancache enabled using kernel transcendent " -"memory and compression buddies\n" , namestr); +pr_info ("cleancache enabled using kernel transcendent memory and compression buddies\n" );#ifdef ZCACHE_DEBUG -pr_info ("%s: cleancache: ignorenonactive = %d\n" , - namestr, !disable_cleancache_ignore_nonactive); +pr_info ("cleancache: ignorenonactive = %d\n" , + !disable_cleancache_ignore_nonactive);#endif if (old_ops.init_fs !=NULL ) -pr_warn ("%s: cleancache_ops overridden\n" , namestr); +pr_warn ("cleancache_ops overridden\n" ); }if (zcache_enabled && !disable_frontswap) {struct frontswap_ops old_ops;
@@ -1998,15 +1992,14 @@ static int __init zcache_init(void) old_ops =zcache_frontswap_register_ops ();if (frontswap_has_exclusive_gets)frontswap_tmem_exclusive_gets (true); -pr_info ("%s: frontswap enabled using kernel transcendent " -"memory and compression buddies\n" , namestr); +pr_info ("frontswap enabled using kernel transcendent memory and compression buddies\n" );#ifdef ZCACHE_DEBUG -pr_info ("%s: frontswap: excl gets = %d active only = %d\n" , - namestr, frontswap_has_exclusive_gets, +pr_info ("frontswap: excl gets = %d active only = %d\n" , + frontswap_has_exclusive_gets, !disable_frontswap_ignore_nonactive);#endif if (old_ops.init !=NULL ) -pr_warn ("%s: frontswap_ops overridden\n" , namestr); +pr_warn ("frontswap_ops overridden\n" ); }if (ramster_enabled) ramster_init(!disable_cleancache, !disable_frontswap,
Signature · 1 line
1.7.9.5
PATCH 4/4 staging/zcache KBUILD_MODNAME instead of "ramster: "
In reply to Robert Berger--- drivers/staging/zcache/ramster/tcp.c | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-)
drivers/staging/zcache/ramster/tcp.c +19 -17
@@ -53,6 +53,8 @@* and only accepts the connection if the higher numbered node is heartbeating. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/slab.h>
@@ -541,7 +543,7 @@ static void r2net_set_nn_state(struct r2net_node *nn, }if (was_valid && !valid) { -pr_notice ("ramster: No longer connected to " SC_NODEF_FMT "\n" , +pr_notice ("No longer connected to " SC_NODEF_FMT "\n" , old_sc->sc_node->nd_name, old_sc->sc_node->nd_num, &old_sc->sc_node->nd_ipv4_address,ntohs (old_sc->sc_node->nd_ipv4_port));
@@ -550,7 +552,7 @@ static void r2net_set_nn_state(struct r2net_node *nn,if (!was_valid && valid) {cancel_delayed_work (&nn->nn_connect_expired); - pr_notice("ramster: %s " SC_NODEF_FMT "\n", + pr_notice("%s " SC_NODEF_FMT "\n", r2nm_this_node() > sc->sc_node->nd_num ? "Connected to" : "Accepted connection from", sc->sc_node->nd_name, sc->sc_node->nd_num,
@@ -643,7 +645,7 @@ static void r2net_state_change(struct sock *sk)r2net_sc_queue_work (sc, &sc->sc_connect_work);break ;default : - pr_info("ramster: Connection to " + pr_info("Connection to " SC_NODEF_FMT " shutdown, state %d\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,
@@ -1395,7 +1397,7 @@ static int r2net_check_handshake(struct r2net_sock_container *sc)struct r2net_node *nn =r2net_nn_from_num (sc->sc_node->nd_num);if (hand->protocol_version !=cpu_to_be64 (R2NET_PROTOCOL_VERSION )) { - pr_notice("ramster: " SC_NODEF_FMT " Advertised net " + pr_notice(" " SC_NODEF_FMT " Advertised net " "protocol version %llu but %llu is required. " "Disconnecting.\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,
@@ -1415,7 +1417,7 @@ static int r2net_check_handshake(struct r2net_sock_container *sc)*/ if (be32_to_cpu (hand->r2net_idle_timeout_ms) !=r2net_idle_timeout ()) { - pr_notice("ramster: " SC_NODEF_FMT " uses a network " + pr_notice(" " SC_NODEF_FMT " uses a network " "idle timeout of %u ms, but we use %u ms locally. " "Disconnecting.\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,
@@ -1428,7 +1430,7 @@ static int r2net_check_handshake(struct r2net_sock_container *sc)if (be32_to_cpu (hand->r2net_keepalive_delay_ms) !=r2net_keepalive_delay ()) { - pr_notice("ramster: " SC_NODEF_FMT " uses a keepalive " + pr_notice(" " SC_NODEF_FMT " uses a keepalive " "delay of %u ms, but we use %u ms locally. " "Disconnecting.\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,
@@ -1441,7 +1443,7 @@ static int r2net_check_handshake(struct r2net_sock_container *sc)if (be32_to_cpu (hand->r2hb_heartbeat_timeout_ms) !=R2HB_MAX_WRITE_TIMEOUT_MS ) { - pr_notice("ramster: " SC_NODEF_FMT " uses a heartbeat " + pr_notice(" " SC_NODEF_FMT " uses a heartbeat " "timeout of %u ms, but we use %u ms locally. " "Disconnecting.\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,
@@ -1669,7 +1671,7 @@ static void r2net_idle_timer(unsigned long data)unsigned long msecs =r2net_idle_timeout ();#endif - pr_notice("ramster: Connection to " SC_NODEF_FMT " has been " + pr_notice("Connection to " SC_NODEF_FMT " has been " "idle for %lu.%lu secs, shutting it down.\n", sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address, ntohs(sc->sc_node->nd_ipv4_port),
@@ -1805,7 +1807,7 @@ static void r2net_start_connect(struct work_struct *work) out:if (ret) { -pr_notice ("ramster: Connect attempt to " SC_NODEF_FMT +pr_notice ("Connect attempt to " SC_NODEF_FMT " failed with errno %d\n" , sc->sc_node->nd_name, sc->sc_node->nd_num, &sc->sc_node->nd_ipv4_address,ntohs (sc->sc_node->nd_ipv4_port), ret);
@@ -1831,7 +1833,7 @@ static void r2net_connect_expired(struct work_struct *work)spin_lock (&nn->nn_lock);if (!nn->nn_sc_valid) { - pr_notice("ramster: No connection established with " + pr_notice("No connection established with " "node %u after %u.%u seconds, giving up.\n", r2net_num_from_nn(nn), r2net_idle_timeout() / 1000,
@@ -1967,7 +1969,7 @@ static int r2net_accept_one(struct socket *sock) node =r2nm_get_node_by_ip (sin.sin_addr.s_addr);if (node ==NULL ) { -pr_notice ("ramster: Attempt to connect from unknown " +pr_notice ("Attempt to connect from unknown " "node at %pI4:%d\n" , &sin.sin_addr.s_addr,ntohs (sin.sin_port)); ret = -EINVAL ;
@@ -1976,7 +1978,7 @@ static int r2net_accept_one(struct socket *sock)if (r2nm_this_node () >= node->nd_num) { local_node =r2nm_get_node_by_num (r2nm_this_node ()); - pr_notice("ramster: Unexpected connect attempt seen " + pr_notice("Unexpected connect attempt seen " "at node '%s' (%u, %pI4:%d) from node '%s' (%u, " "%pI4:%d)\n", local_node->nd_name, local_node->nd_num, &(local_node->nd_ipv4_address),
@@ -2006,7 +2008,7 @@ static int r2net_accept_one(struct socket *sock) ret =0 ;spin_unlock (&nn->nn_lock);if (ret) { -pr_notice ("ramster: Attempt to connect from node '%s' " +pr_notice ("Attempt to connect from node '%s' " "at %pI4:%d but it already has an open connection\n" , node->nd_name, &sin.sin_addr.s_addr,ntohs (sin.sin_port));
@@ -2089,7 +2091,7 @@ static int r2net_open_listening_sock(__be32 addr, __be16 port) ret =sock_create (PF_INET ,SOCK_STREAM ,IPPROTO_TCP , &sock);if (ret <0 ) { -pr_err ("ramster: Error %d while creating socket\n" , ret); +pr_err ("Error %d while creating socket\n" , ret); goto out; }
@@ -2106,14 +2108,14 @@ static int r2net_open_listening_sock(__be32 addr, __be16 port) sock->sk->sk_reuse =/* SK_CAN_REUSE FIXME FOR 3.4 */ 1 ; ret = sock->ops->bind (sock, (struct sockaddr *)&sin,sizeof (sin));if (ret <0 ) { -pr_err ("ramster: Error %d while binding socket at %pI4:%u\n" , +pr_err ("Error %d while binding socket at %pI4:%u\n" , ret, &addr,ntohs (port)); goto out; } ret = sock->ops->listen (sock,64 );if (ret <0 ) -pr_err ("ramster: Error %d while listening on %pI4:%u\n" , +pr_err ("Error %d while listening on %pI4:%u\n" , ret, &addr,ntohs (port)); out:
@@ -2193,7 +2195,7 @@ void r2net_hb_node_up_manual(int node_num) {struct r2nm_node dummy;if (r2nm_single_cluster ==NULL ) -pr_err ("ramster: cluster not alive, node_up_manual ignored\n" ); +pr_err ("cluster not alive, node_up_manual ignored\n" );else {r2hb_manual_set_node_heartbeating (node_num);r2net_hb_node_up_cb (&dummy, node_num,NULL );
Signature · 1 line
1.7.9.5
PATCH 3/4 staging/zache KBUILD_MODNAME and checkpatch fixes
In reply to Robert BergerKBUILD_MODNAME instead of "ramster: "
checkpatch fixes:
ramster.c:474: WARNING: line over 80 characters ramster.c:749: WARNING: quoted string split across lines ramster.c:756: WARNING: quoted string split across lines
--- drivers/staging/zcache/ramster/ramster.c | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/staging/zcache/ramster/ramster.c +17 -17
@@ -26,6 +26,8 @@* be added over time. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/cpu.h> #include <linux/highmem.h>
@@ -471,7 +473,8 @@ void ramster_count_foreign_pages(bool eph, int count)if (c > ramster_foreign_eph_pages_max) ramster_foreign_eph_pages_max = c; }else { - c =atomic_dec_return (&ramster_foreign_eph_pages_atomic); + c =atomic_dec_return ( + &ramster_foreign_eph_pages_atomic);WARN_ON_ONCE (c <0 ); } ramster_foreign_eph_pages = c;
@@ -702,16 +705,15 @@ static ssize_t ramster_manual_node_up_store(struct kobject *kobj, err =kstrtoul (buf,10 , &node_num);if (err) { -pr_err ("ramster: bad strtoul?\n" ); +pr_err ("bad strtoul?\n" );return -EINVAL ; }if (node_num >=MANUAL_NODES ) { -pr_err ("ramster: bad node_num=%lu?\n" , node_num); +pr_err ("bad node_num=%lu?\n" , node_num);return -EINVAL ; }if (ramster_nodes_manual_up[node_num]) { -pr_err ("ramster: node %d already up, ignoring\n" , - (int )node_num); +pr_err ("node %d already up, ignoring\n" , (int )node_num); }else { ramster_nodes_manual_up[node_num] = true;r2net_hb_node_up_manual ((int )node_num);
@@ -742,25 +744,23 @@ static ssize_t ramster_remote_target_nodenum_store(struct kobject *kobj, err =kstrtoul (buf,10 , &node_num);if (err) { -pr_err ("ramster: bad strtoul?\n" ); +pr_err ("bad strtoul?\n" );return -EINVAL ; }else if (node_num ==-1UL ) { -pr_err ("ramster: disabling all remotification, " -"data may still reside on remote nodes however\n" ); +pr_err ("disabling all remotification, data may still reside on remote nodes however\n" );return -EINVAL ; }else if (node_num >=MANUAL_NODES ) { -pr_err ("ramster: bad node_num=%lu?\n" , node_num); +pr_err ("bad node_num=%lu?\n" , node_num);return -EINVAL ; }else if (!ramster_nodes_manual_up[node_num]) { -pr_err ("ramster: node %d not up, ignoring setting " -"of remotification target\n" , (int )node_num); +pr_err ("node %d not up, ignoring setting of remotification target\n" , + (int )node_num); }else if (r2net_remote_target_node_set ((int )node_num) >=0 ) { -pr_info ("ramster: node %d set as remotification target\n" , - (int )node_num); +pr_info ("node %d set as remotification target\n" , + (int )node_num); ramster_remote_target_nodenum = (int )node_num; }else { -pr_err ("ramster: bad num to node node_num=%d?\n" , - (int )node_num); +pr_err ("bad num to node node_num=%d?\n" , (int )node_num);return -EINVAL ; }return count;
@@ -970,14 +970,14 @@ void __init ramster_init(bool cleancache, bool frontswap,ramster_debugfs_init (); ret =sysfs_create_group (mm_kobj, &ramster_attr_group);if (ret) -pr_err ("ramster: can't create sysfs for ramster\n" ); +pr_err ("can't create sysfs for ramster\n" ); (void )r2net_register_handlers ();INIT_LIST_HEAD (&ramster_rem_op_list); ramster_flnode_cache =kmem_cache_create ("ramster_flnode" ,sizeof (struct flushlist_node ),0 ,0 ,NULL ); frontswap_selfshrinking = use_frontswap_selfshrink;if (frontswap_selfshrinking) { -pr_info ("ramster: Initializing frontswap selfshrink driver.\n" ); +pr_info ("Initializing frontswap selfshrink driver.\n" );schedule_delayed_work (&selfshrink_worker, selfshrink_interval *HZ ); }
Signature · 1 line
1.7.9.5
Greg KH
maintainerRe: [PATCH 2/4] staging/zache BUILD_MODNAME and checkpatch fixes
In reply to Robert BergerQuoted 6 lines · Robert Berger
As per Joe's suggestion:
"Perhaps it'd be better to useKBUILD_MODNAMEall the time instead of adding the prefix. Also, to me mixing "ramster: " and "zcache: " for the prefixes is odd. Just using zcache all the time would be simpler, so remove namestr too."
Quoted 8 lines
checkpatch fixes:
zcache-main.c:1987: WARNING: quoted string split across lines zcache-main.c:2002: WARNING: quoted string split across linesSigned-off-by Robert Berger <[email protected]>--- drivers/staging/zcache/zcache-main.c | 137 ++++++++++++++++------------------ 1 file changed, 65 insertions(+), 72 deletions(-)
This patch fails to apply, care to refresh it, and your 2 other patches in this series, against the linux-next tree, and resend it so that I can apply it?
thanks,
greg k-h