staging:lustre:lnet:selftest: fix sparse warnings
cover staging:lustre:lnet:selftest: fix sparse warnings
Patch fix simple sparse warnings: make functions static and remove unused code. I'm doing only little testing: module was loaded properly, output of lst without real server is the same as before.
Anton Saraev (2):
staging:lustre:lnet:selftest: fix sparse warnings staging:lustre:lnet:selftest: remove unused function
drivers/staging/lustre/lnet/selftest/conctl.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/conrpc.c | 20 +++++----- drivers/staging/lustre/lnet/selftest/framework.c | 50 ++++++++++++------------ drivers/staging/lustre/lnet/selftest/module.c | 15 +------ drivers/staging/lustre/lnet/selftest/rpc.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/timer.c | 8 ++-- 6 files changed, 75 insertions(+), 86 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 staging:lustre:lnet:selftest: fix sparse warnings
Fix sparse warnings: symbol X was not declared. Should it be static? Some functions used only in files where they are declared. They can be static.
--- drivers/staging/lustre/lnet/selftest/conctl.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/conrpc.c | 20 +++++----- drivers/staging/lustre/lnet/selftest/framework.c | 50 ++++++++++++------------ drivers/staging/lustre/lnet/selftest/module.c | 6 +-- drivers/staging/lustre/lnet/selftest/rpc.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/timer.c | 8 ++-- 6 files changed, 76 insertions(+), 76 deletions(-)
drivers/staging/lustre/lnet/selftest/conctl.c +17 -17
@@ -45,7 +45,7 @@#include "../../include/linux/lnet/lnetst.h" #include "console.h" -int +static int lst_session_new_ioctl (lstio_session_new_args_t *args) {char *name;
@@ -82,7 +82,7 @@ lst_session_new_ioctl(lstio_session_new_args_t *args)return rc; } -int +static int lst_session_end_ioctl (lstio_session_end_args_t *args) {if (args->lstio_ses_key != console_session.ses_key)
@@ -91,7 +91,7 @@ lst_session_end_ioctl(lstio_session_end_args_t *args)return lstcon_session_end (); } -int +static int lst_session_info_ioctl (lstio_session_info_args_t *args) {/* no checking of key */
@@ -113,7 +113,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args) args->lstio_ses_nmlen); } -int +static int lst_debug_ioctl (lstio_debug_args_t *args) {char *name =NULL ;
@@ -194,7 +194,7 @@ out:return rc; } -int +static int lst_group_add_ioctl (lstio_group_add_args_t *args) {char *name;
@@ -228,7 +228,7 @@ lst_group_add_ioctl(lstio_group_add_args_t *args)return rc; } -int +static int lst_group_del_ioctl (lstio_group_del_args_t *args) {int rc;
@@ -262,7 +262,7 @@ lst_group_del_ioctl(lstio_group_del_args_t *args)return rc; } -int +static int lst_group_update_ioctl (lstio_group_update_args_t *args) {int rc;
@@ -320,7 +320,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)return rc; } -int +static int lst_nodes_add_ioctl (lstio_group_nodes_args_t *args) {unsigned feats;
@@ -365,7 +365,7 @@ lst_nodes_add_ioctl(lstio_group_nodes_args_t *args)return rc; } -int +static int lst_group_list_ioctl (lstio_group_list_args_t *args) {if (args->lstio_grp_key != console_session.ses_key)
@@ -382,7 +382,7 @@ lst_group_list_ioctl(lstio_group_list_args_t *args) args->lstio_grp_namep); } -int +static int lst_group_info_ioctl (lstio_group_info_args_t *args) {char *name;
@@ -446,7 +446,7 @@ lst_group_info_ioctl(lstio_group_info_args_t *args)return 0 ; } -int +static int lst_batch_add_ioctl (lstio_batch_add_args_t *args) {int rc;
@@ -480,7 +480,7 @@ lst_batch_add_ioctl(lstio_batch_add_args_t *args)return rc; } -int +static int lst_batch_run_ioctl (lstio_batch_run_args_t *args) {int rc;
@@ -515,7 +515,7 @@ lst_batch_run_ioctl(lstio_batch_run_args_t *args)return rc; } -int +static int lst_batch_stop_ioctl (lstio_batch_stop_args_t *args) {int rc;
@@ -551,7 +551,7 @@ lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)return rc; } -int +static int lst_batch_query_ioctl (lstio_batch_query_args_t *args) {char *name;
@@ -593,7 +593,7 @@ lst_batch_query_ioctl(lstio_batch_query_args_t *args)return rc; } -int +static int lst_batch_list_ioctl (lstio_batch_list_args_t *args) {if (args->lstio_bat_key != console_session.ses_key)
@@ -610,7 +610,7 @@ lst_batch_list_ioctl(lstio_batch_list_args_t *args) args->lstio_bat_namep); } -int +static int lst_batch_info_ioctl (lstio_batch_info_args_t *args) {char *name;
@@ -675,7 +675,7 @@ lst_batch_info_ioctl(lstio_batch_info_args_t *args)return rc; } -int +static int lst_stat_query_ioctl (lstio_stat_args_t *args) {int rc;
drivers/staging/lustre/lnet/selftest/conrpc.c +10 -10
@@ -88,7 +88,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)spin_unlock (&rpc->crpc_lock); } -int +static int lstcon_rpc_init (lstcon_node_t *nd,int service,unsigned feats,int bulk_npg,int bulk_len,int embedded,lstcon_rpc_t *crpc) {
@@ -113,7 +113,7 @@ lstcon_rpc_init(lstcon_node_t *nd, int service, unsigned feats,return 0 ; } -int +static int lstcon_rpc_prep (lstcon_node_t *nd,int service,unsigned feats,int bulk_npg,int bulk_len,lstcon_rpc_t **crpcpp) {
@@ -182,7 +182,7 @@ lstcon_rpc_put(lstcon_rpc_t *crpc)atomic_dec (&console_session.ses_rpc_counter); } -void +static void lstcon_rpc_post (lstcon_rpc_t *crpc) {lstcon_rpc_trans_t *trans = crpc->crp_trans;
@@ -383,7 +383,7 @@ lstcon_rpc_trans_postwait(lstcon_rpc_trans_t *trans, int timeout)return rc; } -int +static int lstcon_rpc_get_reply (lstcon_rpc_t *crpc,srpc_msg_t **msgpp) {lstcon_node_t *nd = crpc->crp_node;
@@ -718,7 +718,7 @@ lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov)return &pid[idx %SFW_ID_PER_PAGE ]; } -int +static int lstcon_dstnodes_prep (lstcon_group_t *grp,int idx,int dist,int span,int nkiov,lnet_kiov_t *kiov) {
@@ -772,7 +772,7 @@ lstcon_dstnodes_prep(lstcon_group_t *grp, int idx,return 0 ; } -int +static int lstcon_pingrpc_prep (lst_test_ping_param_t *param,srpc_test_reqst_t *req) {test_ping_req_t *prq = &req->tsr_u.ping;
@@ -783,7 +783,7 @@ lstcon_pingrpc_prep(lst_test_ping_param_t *param, srpc_test_reqst_t *req)return 0 ; } -int +static int lstcon_bulkrpc_v0_prep (lst_test_bulk_param_t *param,srpc_test_reqst_t *req) {test_bulk_req_t *brq = &req->tsr_u.bulk_v0;
@@ -795,7 +795,7 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)return 0 ; } -int +static int lstcon_bulkrpc_v1_prep (lst_test_bulk_param_t *param,srpc_test_reqst_t *req) {test_bulk_req_v1_t *brq = &req->tsr_u.bulk_v1;
@@ -915,7 +915,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,return rc; } -int +static int lstcon_sesnew_stat_reply (lstcon_rpc_trans_t *trans,lstcon_node_t *nd,srpc_msg_t *reply) {
@@ -1162,7 +1162,7 @@ lstcon_rpc_trans_ndlist(struct list_head *ndlist,return rc; } -void +static void lstcon_rpc_pinger (void *arg) {stt_timer_t *ptimer = (stt_timer_t *)arg;
drivers/staging/lustre/lnet/selftest/framework.c +25 -25
200 lines not on this page · raw message
drivers/staging/lustre/lnet/selftest/module.c +3 -3
@@ -55,7 +55,7 @@ static int lst_init_step = LST_INIT_NONE;struct cfs_wi_sched *lst_sched_serial;struct cfs_wi_sched **lst_sched_test; -void +static void lnet_selftest_fini (void ) {int i;
@@ -90,7 +90,7 @@ lnet_selftest_fini(void)return ; } -void +static void lnet_selftest_structure_assertion (void ) {CLASSERT (sizeof (srpc_msg_t) ==160 );
@@ -101,7 +101,7 @@ lnet_selftest_structure_assertion(void)CLASSERT (sizeof (srpc_stat_reqst_t) ==28 ); } -int +static int lnet_selftest_init (void ) {int nscheds;
drivers/staging/lustre/lnet/selftest/rpc.c +17 -17
@@ -87,7 +87,7 @@ void srpc_set_counters (const srpc_counters_t *cnt)spin_unlock (&srpc_data.rpc_glock); } -int +static int srpc_add_bulk_page (srpc_bulk_t *bk,struct page *pg,int i,int nob) { nob =min (nob, (int )PAGE_CACHE_SIZE );
@@ -170,7 +170,7 @@ srpc_next_id (void)return id; } -void +static void srpc_init_server_rpc (struct srpc_server_rpc *rpc,struct srpc_service_cd *scd,struct srpc_buffer *buffer)
@@ -351,7 +351,7 @@ srpc_remove_service (srpc_service_t *sv)return 0 ; } -int +static int srpc_post_passive_rdma (int portal,int local,__u64 matchbits,void *buf,int len,int options,lnet_process_id_t peer,lnet_handle_md_t *mdh,srpc_event_t *ev)
@@ -391,7 +391,7 @@ srpc_post_passive_rdma(int portal, int local, __u64 matchbits, void *buf,return 0 ; } -int +static int srpc_post_active_rdma (int portal,__u64 matchbits,void *buf,int len,int options,lnet_process_id_t peer,lnet_nid_t self,lnet_handle_md_t *mdh,srpc_event_t *ev)
@@ -443,7 +443,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,return 0 ; } -int +static int srpc_post_active_rqtbuf (lnet_process_id_t peer,int service,void *buf,int len,lnet_handle_md_t *mdh,srpc_event_t *ev) {
@@ -452,7 +452,7 @@ srpc_post_active_rqtbuf(lnet_process_id_t peer, int service, void *buf, LNET_NID_ANY, mdh, ev); } -int +static int srpc_post_passive_rqtbuf (int service,int local,void *buf,int len,lnet_handle_md_t *mdh,srpc_event_t *ev) {
@@ -466,7 +466,7 @@ srpc_post_passive_rqtbuf(int service, int local, void *buf, int len, LNET_MD_OP_PUT, any, mdh, ev); } -int +static int srpc_service_post_buffer (struct srpc_service_cd *scd,struct srpc_buffer *buf) {struct srpc_service *sv = scd->scd_svc;
@@ -697,7 +697,7 @@ srpc_finish_service(struct srpc_service *sv) }/* called with sv->sv_lock held */ -void +static void srpc_service_recycle_buffer (struct srpc_service_cd *scd,srpc_buffer_t *buf) {if (!scd->scd_svc->sv_shuttingdown && scd->scd_buf_adjust >=0 ) {
@@ -787,7 +787,7 @@ srpc_shutdown_service(srpc_service_t *sv) } } -int +static int srpc_send_request (srpc_client_rpc_t *rpc) {srpc_event_t *ev = &rpc->crpc_reqstev;
@@ -807,7 +807,7 @@ srpc_send_request (srpc_client_rpc_t *rpc)return rc; } -int +static int srpc_prepare_reply (srpc_client_rpc_t *rpc) {srpc_event_t *ev = &rpc->crpc_replyev;
@@ -831,7 +831,7 @@ srpc_prepare_reply (srpc_client_rpc_t *rpc)return rc; } -int +static int srpc_prepare_bulk (srpc_client_rpc_t *rpc) {srpc_bulk_t *bk = &rpc->crpc_bulk;
@@ -863,7 +863,7 @@ srpc_prepare_bulk (srpc_client_rpc_t *rpc)return rc; } -int +static int srpc_do_bulk (srpc_server_rpc_t *rpc) {srpc_event_t *ev = &rpc->srpc_ev;
@@ -891,7 +891,7 @@ srpc_do_bulk (srpc_server_rpc_t *rpc) }/* only called from srpc_handle_rpc */ -void +static void srpc_server_rpc_done (srpc_server_rpc_t *rpc,int status) {struct srpc_service_cd *scd = rpc->srpc_scd;
@@ -1066,7 +1066,7 @@ srpc_handle_rpc(swi_workitem_t *wi)return 0 ; } -void +static void srpc_client_rpc_expired (void *data) {srpc_client_rpc_t *rpc = data;
@@ -1108,7 +1108,7 @@ srpc_add_client_rpc_timer (srpc_client_rpc_t *rpc)* * Upon exit the RPC expiry timer is not queued and the handler is not * running on any CPU. */ -void +static void srpc_del_client_rpc_timer (srpc_client_rpc_t *rpc) {/* timer not planted or already exploded */
@@ -1129,7 +1129,7 @@ srpc_del_client_rpc_timer (srpc_client_rpc_t *rpc) } } -void +static void srpc_client_rpc_done (srpc_client_rpc_t *rpc,int status) {swi_workitem_t *wi = &rpc->crpc_wi;
@@ -1393,7 +1393,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc) }/* when in kernel always called with LNET_LOCK() held, and in thread context */ -void +static void srpc_lnet_ev_handler (lnet_event_t *ev) {struct srpc_service_cd *scd;
drivers/staging/lustre/lnet/selftest/timer.c +4 -4
@@ -121,7 +121,7 @@ stt_del_timer(stt_timer_t *timer) }/* called with stt_data.stt_lock held */ -int +static int stt_expire_list (struct list_head *slot,unsigned long now) {int expired =0 ;
@@ -145,7 +145,7 @@ stt_expire_list(struct list_head *slot, unsigned long now)return expired; } -int +static int stt_check_timers (unsigned long *last) {int expired =0 ;
@@ -168,7 +168,7 @@ stt_check_timers(unsigned long *last) } -int +static int stt_timer_main (void *arg) {cfs_block_allsigs ();
@@ -187,7 +187,7 @@ stt_timer_main(void *arg)return 0 ; } -int +static int stt_start_timer_thread (void ) {struct task_struct *task;
Signature · 1 line
1.9.1
PATCH 2/2 staging:lustre:lnet:selftest: remove unused function
Function lnet_selftest_structure_assertion is never used and can be removed.
--- drivers/staging/lustre/lnet/selftest/module.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/staging/lustre/lnet/selftest/module.c +0 -11
@@ -90,17 +90,6 @@ lnet_selftest_fini(void)return ; } -static void -lnet_selftest_structure_assertion (void ) -{ -CLASSERT (sizeof (srpc_msg_t) ==160 ); -CLASSERT (sizeof (srpc_test_reqst_t) ==70 ); - CLASSERT(offsetof(srpc_msg_t, msg_body.tes_reqst.tsr_concur) == 72); - CLASSERT(offsetof(srpc_msg_t, msg_body.tes_reqst.tsr_ndest) == 78); -CLASSERT (sizeof (srpc_stat_reply_t) ==136 ); -CLASSERT (sizeof (srpc_stat_reqst_t) ==28 ); -} -static int lnet_selftest_init (void ) {
Signature · 1 line
1.9.1
Greg KH
maintainerRe: [PATCH v2 02/02] staging:lustre:lnet:selftest: remove unused function
Quoted 20 lines · Anton Saraev
Function
lnet_selftest_structure_assertionis never used and can be removed.Signed-off-by Anton Saraev <[email protected]>--- drivers/staging/lustre/lnet/selftest/module.c | 11 ----------- 1 file changed, 11 deletions(-)drivers/staging/lustre/lnet/selftest/module.c +0
-4@@ -90,17 +90,6 @@ lnet_selftest_fini(void)return ; } -static void -lnet_selftest_structure_assertion (void ) -{ -CLASSERT (sizeof (srpc_msg_t) ==160 );
drivers/staging/lustre/lnet/selftest/module.c lnet_selftest_fini(void) · line 95
Quoted 10 lines
drivers/staging/lustre/lnet/selftest/module.c +0
-7-CLASSERT (sizeof (srpc_test_reqst_t) ==70 ); - CLASSERT(offsetof(srpc_msg_t, msg_body.tes_reqst.tsr_concur) == 72); - CLASSERT(offsetof(srpc_msg_t, msg_body.tes_reqst.tsr_ndest) == 78); -CLASSERT (sizeof (srpc_stat_reply_t) ==136 ); -CLASSERT (sizeof (srpc_stat_reqst_t) ==28 ); -} -static int lnet_selftest_init (void ) {
This doesn't apply to my tree at all :(
Greg KH
maintainerQuoted 5 lines · Anton Saraev
Fix sparse warnings: symbol X was not declared. Should it be static? Some functions used only in files where they are declared. They can be static.
Signed-off-by Anton Saraev <[email protected]>
Quoted 8 lines
--- drivers/staging/lustre/lnet/selftest/conctl.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/conrpc.c | 20 +++++----- drivers/staging/lustre/lnet/selftest/framework.c | 50 ++++++++++++------------ drivers/staging/lustre/lnet/selftest/module.c | 6 +-- drivers/staging/lustre/lnet/selftest/rpc.c | 34 ++++++++-------- drivers/staging/lustre/lnet/selftest/timer.c | 8 ++-- 6 files changed, 76 insertions(+), 76 deletions(-)
This patch adds a build warning to the build, so I can't apply it. Please fix it up and resend.
thanks,
greg k-h