[PATCH v2 01/02] 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. Signed-off-by: Anton Saraev --- 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| 4 +- drivers/staging/lustre/lnet/selftest/rpc.c | 34 drivers/staging/lustre/lnet/selftest/timer.c | 8 ++-- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index ae7b0fc..5bc6153 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -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; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index a3a60d6..b0d 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -88,7 +88,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc) spin_unlock(>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
[PATCH v2 00/02] staging:lustre:lnet:selftest: fix sparse warnings
As I can understand warning in previous series is about unused function (I don't see other differences in output of make with C=1, W=1 and W=2). I remove "static" for lnet_selftest_structure_assertion from first patch. Maybe I should merge patches in one but I think that addition of static declaration and deletion of function should be in two different patches. So the second patch depends on the first... 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 02/02] staging:lustre:lnet:selftest: remove unused function
Function lnet_selftest_structure_assertion is never used and can be removed. Signed-off-by: Anton Saraev --- drivers/staging/lustre/lnet/selftest/module.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index b2dd891..92520c2 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -90,17 +90,6 @@ lnet_selftest_fini(void) return; } -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) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 00/02] staging:lustre:lnet:selftest: fix sparse warnings
As I can understand warning in previous series is about unused function (I don't see other differences in output of make with C=1, W=1 and W=2). I remove static for lnet_selftest_structure_assertion from first patch. Maybe I should merge patches in one but I think that addition of static declaration and deletion of function should be in two different patches. So the second patch depends on the first... 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 02/02] staging:lustre:lnet:selftest: remove unused function
Function lnet_selftest_structure_assertion is never used and can be removed. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/lustre/lnet/selftest/module.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index b2dd891..92520c2 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -90,17 +90,6 @@ lnet_selftest_fini(void) return; } -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) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 01/02] 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. Signed-off-by: Anton Saraev antonysar...@gmail.com --- 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| 4 +- drivers/staging/lustre/lnet/selftest/rpc.c | 34 drivers/staging/lustre/lnet/selftest/timer.c | 8 ++-- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index ae7b0fc..5bc6153 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -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; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index a3a60d6..b0d 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -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
[PATCH 01/02] 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. Signed-off-by: Anton Saraev --- 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(-) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index ae7b0fc..5bc6153 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -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; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index a3a60d6..b0d 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -88,7 +88,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc) spin_unlock(>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
[PATCH 02/02] staging:lustre:lnet:selftest: remove unused function
Function lnet_selftest_structure_assertion is never used and can be removed. Signed-off-by: Anton Saraev --- drivers/staging/lustre/lnet/selftest/module.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 718663f..92520c2 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -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) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 00/02] 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 01/02] 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. Signed-off-by: Anton Saraev antonysar...@gmail.com --- 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(-) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index ae7b0fc..5bc6153 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -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; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index a3a60d6..b0d 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -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
[PATCH 02/02] staging:lustre:lnet:selftest: remove unused function
Function lnet_selftest_structure_assertion is never used and can be removed. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/lustre/lnet/selftest/module.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 718663f..92520c2 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -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) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 00/02] 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/3] staging/skein: more cleanup
On Thu, May 22, 2014 at 01:04:41PM -0400, Jason Cooper wrote: > I do not, I'm unsure if Anton has anything pending capable of > upstreaming. I have two simple patches. But I don't know is it necessary to send this patches. First is export of functions in *api.c files. But it is trivial part of api cleanup. Second is fixing of remaining uppercase X in skein_block.c. But this variables lie on SKEIN_DEBUG compile path and maybe will be completely removed (or we need add some output in the appropriate functions). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/3] staging/skein: more cleanup
On Thu, May 22, 2014 at 01:04:41PM -0400, Jason Cooper wrote: I do not, I'm unsure if Anton has anything pending capable of upstreaming. I have two simple patches. But I don't know is it necessary to send this patches. First is export of functions in *api.c files. But it is trivial part of api cleanup. Second is fixing of remaining uppercase X in skein_block.c. But this variables lie on SKEIN_DEBUG compile path and maybe will be completely removed (or we need add some output in the appropriate functions). -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/3] staging/skein: more cleanup
On Tue, May 20, 2014 at 10:24:11AM -0600, Jake Edge wrote: > On Tue, 20 May 2014 10:47:57 -0400 Jason Cooper wrote: > > but some kind of tests are needed to ensure nothing breaks before > digging into that ... I have some test: slightly modified version of tests from https://github.com/wernerd/Skein3Fish. It works as debugfs entry and require some modification needed for module support ("public" function must be extern). As I can understand Jason has his own tests. That would be logical to share them but I don't know where. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/3] staging/skein: more cleanup
On Tue, May 20, 2014 at 10:24:11AM -0600, Jake Edge wrote: On Tue, 20 May 2014 10:47:57 -0400 Jason Cooper wrote: but some kind of tests are needed to ensure nothing breaks before digging into that ... I have some test: slightly modified version of tests from https://github.com/wernerd/Skein3Fish. It works as debugfs entry and require some modification needed for module support (public function must be extern). As I can understand Jason has his own tests. That would be logical to share them but I don't know where. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 03/06] staging: crypto: skein: rename skein1024_ctx to skein_1024_ctx
Code have skein_512_ctx and skein_256_ctx but skein1024_ctx. It would be logical to convert these names to a single form. Signed-off-by: Anton Saraev --- drivers/staging/skein/include/skein.h | 14 +++--- drivers/staging/skein/include/skeinApi.h| 2 +- drivers/staging/skein/include/skein_block.h | 2 +- drivers/staging/skein/skein.c | 12 ++-- drivers/staging/skein/skeinBlockNo3F.c | 2 +- drivers/staging/skein/skein_block.c | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index deaa9c8..09e96d6 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -81,7 +81,7 @@ struct skein_512_ctx { /* 512-bit Skein hash context structure */ u8 b[SKEIN_512_BLOCK_BYTES];/* partial block buf (8-byte aligned) */ }; -struct skein1024_ctx { /* 1024-bit Skein hash context structure */ +struct skein_1024_ctx { /* 1024-bit Skein hash context structure */ struct skein_ctx_hdr h; /* common header context variables */ u64 X[SKEIN1024_STATE_WORDS]; /* chaining variables */ u8 b[SKEIN1024_BLOCK_BYTES];/* partial block buf (8-byte aligned) */ @@ -90,18 +90,18 @@ struct skein1024_ctx { /* 1024-bit Skein hash context structure */ /* Skein APIs for (incremental) "straight hashing" */ int skein_256_init(struct skein_256_ctx *ctx, size_t hash_bit_len); int skein_512_init(struct skein_512_ctx *ctx, size_t hash_bit_len); -int skein_1024_init(struct skein1024_ctx *ctx, size_t hash_bit_len); +int skein_1024_init(struct skein_1024_ctx *ctx, size_t hash_bit_len); int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); -int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg, +int skein_1024_update(struct skein_1024_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_final(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val); /* ** Skein APIs for "extended" initialization: MAC keys, tree hashing. @@ -121,7 +121,7 @@ int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); int skein_512_init_ext(struct skein_512_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); -int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len, +int skein_1024_init_ext(struct skein_1024_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); /* @@ -131,7 +131,7 @@ int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len, */ int skein_256_final_pad(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_final_pad(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 *hash_val); #ifndef SKEIN_TREE_HASH #define SKEIN_TREE_HASH (1) @@ -139,7 +139,7 @@ int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val); #if SKEIN_TREE_HASH int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_output(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #endif /* diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skeinApi.h index 11ecab8..850d5c9 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skeinApi.h @@ -105,7 +105,7 @@ struct skein_ctx { struct skein_ctx_hdr h; struct skein_256_ctx s256; struct skein_512_ctx s512; - struct skein1024_ctx s1024; + struct skein_1024_ctx s1024; } m; }; diff --git a/drivers/staging/skein/include/skein_block.h b/drivers/staging/skein/include/skein_block.h index ec787a3..a8dd083 100644 --- a/drivers/staging/skein/include/skein_block.h +++ b/drivers/staging/skein/include/skein_block.h @@ -16,7 +16,7 @@ void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, size_t blk_cnt, size_t byte_cnt_add); void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr, size_t blk_cnt, size_t byte_cnt_add); -void skein_1024_process_block(struct skein1024_ctx *ctx, const u8 *blk_ptr, +void skein_1024_
[PATCH v2 06/06] staging: crypto: skein: rename files
camelCase is not accepted in the Linux Kernel. To prepare skein driver for mainline inclusion, we rename all files to non-camelCase equivalents. Signed-off-by: Anton Saraev --- drivers/staging/skein/Makefile | 10 +- drivers/staging/skein/TODO | 1 - drivers/staging/skein/include/{skeinApi.h => skein_api.h} | 4 ++-- .../staging/skein/include/{threefishApi.h => threefish_api.h} | 2 +- drivers/staging/skein/{skeinApi.c => skein_api.c} | 2 +- .../staging/skein/{skeinBlockNo3F.c => skein_block_no_3f.c}| 2 +- .../skein/{threefish1024Block.c => threefish_1024_block.c} | 2 +- .../skein/{threefish256Block.c => threefish_256_block.c} | 2 +- .../skein/{threefish512Block.c => threefish_512_block.c} | 2 +- drivers/staging/skein/{threefishApi.c => threefish_api.c} | 3 +-- 10 files changed, 14 insertions(+), 16 deletions(-) rename drivers/staging/skein/include/{skeinApi.h => skein_api.h} (99%) rename drivers/staging/skein/include/{threefishApi.h => threefish_api.h} (99%) rename drivers/staging/skein/{skeinApi.c => skein_api.c} (99%) rename drivers/staging/skein/{skeinBlockNo3F.c => skein_block_no_3f.c} (99%) rename drivers/staging/skein/{threefish1024Block.c => threefish_1024_block.c} (99%) rename drivers/staging/skein/{threefish256Block.c => threefish_256_block.c} (99%) rename drivers/staging/skein/{threefish512Block.c => threefish_512_block.c} (99%) rename drivers/staging/skein/{threefishApi.c => threefish_api.c} (98%) diff --git a/drivers/staging/skein/Makefile b/drivers/staging/skein/Makefile index 2bb386e..29f51bf 100644 --- a/drivers/staging/skein/Makefile +++ b/drivers/staging/skein/Makefile @@ -4,10 +4,10 @@ subdir-ccflags-y := -I$(src)/include/ obj-$(CONFIG_CRYPTO_SKEIN) += skein.o \ - skeinApi.o \ + skein_api.o \ skein_block.o -obj-$(CONFIG_CRYPTO_THREEFISH) += threefish1024Block.o \ - threefish256Block.o \ - threefish512Block.o \ - threefishApi.o +obj-$(CONFIG_CRYPTO_THREEFISH) += threefish_1024_block.o \ + threefish_256_block.o \ + threefish_512_block.o \ + threefish_api.o diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO index 88a6e81..cd3508d 100644 --- a/drivers/staging/skein/TODO +++ b/drivers/staging/skein/TODO @@ -1,6 +1,5 @@ skein/threefish TODO - - rename files - move macros into appropriate header files - add / pass test vectors - module support diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skein_api.h similarity index 99% rename from drivers/staging/skein/include/skeinApi.h rename to drivers/staging/skein/include/skein_api.h index b4e879d..87f769a 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skein_api.h @@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE. #define SKEINAPI_H /** - * @file skeinApi.h + * @file skein_api.h * @brief A Skein API and its functions. * @{ * @@ -44,7 +44,7 @@ OTHER DEALINGS IN THE SOFTWARE. * * @code * - * #include + * #include * * ... * struct skein_ctx ctx; // a Skein hash or MAC context diff --git a/drivers/staging/skein/include/threefishApi.h b/drivers/staging/skein/include/threefish_api.h similarity index 99% rename from drivers/staging/skein/include/threefishApi.h rename to drivers/staging/skein/include/threefish_api.h index 96cc0e8..fe28981 100644 --- a/drivers/staging/skein/include/threefishApi.h +++ b/drivers/staging/skein/include/threefish_api.h @@ -3,7 +3,7 @@ #define THREEFISHAPI_H /** - * @file threefishApi.h + * @file threefish_api.h * @brief A Threefish cipher API and its functions. * @{ * diff --git a/drivers/staging/skein/skeinApi.c b/drivers/staging/skein/skein_api.c similarity index 99% rename from drivers/staging/skein/skeinApi.c rename to drivers/staging/skein/skein_api.c index 16d596b..7fb0160 100644 --- a/drivers/staging/skein/skeinApi.c +++ b/drivers/staging/skein/skein_api.c @@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE. */ #include -#include +#include int skein_ctx_prepare(struct skein_ctx *ctx, enum skein_size size) { diff --git a/drivers/staging/skein/skeinBlockNo3F.c b/drivers/staging/skein/skein_block_no_3f.c similarity index 99% rename from drivers/staging/skein/skeinBlockNo3F.c rename to drivers/staging/skein/skein_block_no_3f.c index 4ee7f9f..23a3ac5 100644 --- a/drivers/staging/skein/skeinBlockNo3F.c +++ b/drivers/staging/skein/skein_block_no_3f.c @@ -1,7 +1,7 @@ #include #include -#include +#include /* Skein_256 **
[PATCH v2 01/06] staging: crypto: skein: rename camelcase functions
camelCase is not accepted in the Linux Kernel. To prepare skein driver for mainline inclusion, we rename all functions to non-camelCase equivalents. Signed-off-by: Anton Saraev --- drivers/staging/skein/TODO | 1 - drivers/staging/skein/include/skein.h| 66 drivers/staging/skein/include/skeinApi.h | 38 - drivers/staging/skein/include/skein_block.h | 12 +-- drivers/staging/skein/include/threefishApi.h | 44 ++- drivers/staging/skein/skein.c| 114 +-- drivers/staging/skein/skeinApi.c | 72 - drivers/staging/skein/skeinBlockNo3F.c | 24 +++--- drivers/staging/skein/skein_block.c | 40 +- drivers/staging/skein/threefish1024Block.c | 6 +- drivers/staging/skein/threefish256Block.c| 6 +- drivers/staging/skein/threefish512Block.c| 6 +- drivers/staging/skein/threefishApi.c | 38 - 13 files changed, 239 insertions(+), 228 deletions(-) diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO index f5c167a..bc42fb8 100644 --- a/drivers/staging/skein/TODO +++ b/drivers/staging/skein/TODO @@ -1,7 +1,6 @@ skein/threefish TODO - rename camelcase vars - - rename camelcase functions - rename files - move macros into appropriate header files - add / pass test vectors diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index 0a2abce..15ff60f 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -86,59 +86,59 @@ struct skein1024_ctx { /* 1024-bit Skein hash context structure */ u8 b[SKEIN1024_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */ }; -/* Skein APIs for (incremental) "straight hashing" */ -int Skein_256_Init(struct skein_256_ctx *ctx, size_t hashBitLen); -int Skein_512_Init(struct skein_512_ctx *ctx, size_t hashBitLen); -int Skein1024_Init(struct skein1024_ctx *ctx, size_t hashBitLen); - -int Skein_256_Update(struct skein_256_ctx *ctx, const u8 *msg, - size_t msgByteCnt); -int Skein_512_Update(struct skein_512_ctx *ctx, const u8 *msg, - size_t msgByteCnt); -int Skein1024_Update(struct skein1024_ctx *ctx, const u8 *msg, - size_t msgByteCnt); - -int Skein_256_Final(struct skein_256_ctx *ctx, u8 *hashVal); -int Skein_512_Final(struct skein_512_ctx *ctx, u8 *hashVal); -int Skein1024_Final(struct skein1024_ctx *ctx, u8 *hashVal); +/* Skein APIs for (incremental) "straight hashing" */ +int skein_256_init(struct skein_256_ctx *ctx, size_t hashBitLen); +int skein_512_init(struct skein_512_ctx *ctx, size_t hashBitLen); +int skein_1024_init(struct skein1024_ctx *ctx, size_t hashBitLen); + +int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, +size_t msgByteCnt); +int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg, +size_t msgByteCnt); +int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg, + size_t msgByteCnt); + +int skein_256_final(struct skein_256_ctx *ctx, u8 *hashVal); +int skein_512_final(struct skein_512_ctx *ctx, u8 *hashVal); +int skein_1024_final(struct skein1024_ctx *ctx, u8 *hashVal); /* ** Skein APIs for "extended" initialization: MAC keys, tree hashing. -** After an InitExt() call, just use Update/Final calls as with Init(). +** After an init_ext() call, just use update/final calls as with init(). ** -** Notes: Same parameters as _Init() calls, plus treeInfo/key/keyBytes. +** Notes: Same parameters as _init() calls, plus treeInfo/key/keyBytes. ** When keyBytes == 0 and treeInfo == SKEIN_SEQUENTIAL, -** the results of InitExt() are identical to calling Init(). -** The function Init() may be called once to "precompute" the IV for +** the results of init_ext() are identical to calling init(). +** The function init() may be called once to "precompute" the IV for ** a given hashBitLen value, then by saving a copy of the context ** the IV computation may be avoided in later calls. -** Similarly, the function InitExt() may be called once per MAC key +** Similarly, the function init_ext() may be called once per MAC key ** to precompute the MAC IV, then a copy of the context saved and ** reused for each new MAC computation. **/ -int Skein_256_InitExt(struct skein_256_ctx *ctx, size_t hashBitLen, - u64 treeInfo, const u8 *key, size_t keyBytes); -int Skein_512_InitExt(struct skein_512_ctx *ctx, size_t hashBitLen, - u64 treeInfo, const u8 *key, size_t keyBytes); -int Skein1024_InitExt(struct skein1024_ctx *ctx, size_t hashBitLen, +int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hashBit
[PATCH v2 00/06] staging: crypto: skein: fixing style issues
Hi! To prepare skein driver for mainline inclusion we fixing most of style issues (wrong names of functions, vars, macros, files) and checkpatch problems in this patch set. For example, existing code is widely use camelCase names. This patch fix it. Anton Saraev (6): staging: crypto: skein: rename camelcase functions staging: crypto: skein: rename camelcase vars staging: crypto: skein: rename skein1024_ctx to skein_1024_ctx staging: crypto: skein: rename enums staging: crypto: skein: rename macros staging: crypto: skein: rename files drivers/staging/skein/Makefile | 10 +- drivers/staging/skein/TODO | 3 - drivers/staging/skein/include/skein.h | 180 +++ .../skein/include/{skeinApi.h => skein_api.h} | 66 +-- drivers/staging/skein/include/skein_block.h| 12 +- drivers/staging/skein/include/skein_iv.h | 6 +- .../include/{threefishApi.h => threefish_api.h}| 84 +-- drivers/staging/skein/skein.c | 577 +++-- drivers/staging/skein/{skeinApi.c => skein_api.c} | 170 +++--- drivers/staging/skein/skein_block.c| 411 +++ .../{skeinBlockNo3F.c => skein_block_no_3f.c} | 62 +-- drivers/staging/skein/threefishApi.c | 79 --- ...threefish1024Block.c => threefish_1024_block.c} | 80 +-- .../{threefish256Block.c => threefish_256_block.c} | 32 +- .../{threefish512Block.c => threefish_512_block.c} | 48 +- drivers/staging/skein/threefish_api.c | 78 +++ 16 files changed, 959 insertions(+), 939 deletions(-) rename drivers/staging/skein/include/{skeinApi.h => skein_api.h} (79%) rename drivers/staging/skein/include/{threefishApi.h => threefish_api.h} (66%) rename drivers/staging/skein/{skeinApi.c => skein_api.c} (52%) rename drivers/staging/skein/{skeinBlockNo3F.c => skein_block_no_3f.c} (66%) delete mode 100644 drivers/staging/skein/threefishApi.c rename drivers/staging/skein/{threefish1024Block.c => threefish_1024_block.c} (98%) rename drivers/staging/skein/{threefish256Block.c => threefish_256_block.c} (96%) rename drivers/staging/skein/{threefish512Block.c => threefish_512_block.c} (97%) create mode 100644 drivers/staging/skein/threefish_api.c -- 1.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 04/06] staging: crypto: skein: rename enums
Linux Kernel use capitalized names for enum. To prepare skein driver to mainline inclusion, we rename all enums to capitalized names. Signed-off-by: Anton Saraev --- drivers/staging/skein/include/skein.h| 6 +++--- drivers/staging/skein/include/skeinApi.h | 8 drivers/staging/skein/include/threefishApi.h | 18 +- drivers/staging/skein/skeinApi.c | 24 drivers/staging/skein/skeinBlockNo3F.c | 6 +++--- drivers/staging/skein/skein_block.c | 6 +++--- drivers/staging/skein/threefishApi.c | 12 ++-- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index 09e96d6..8ecd720 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -293,7 +293,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); ** Skein block function constants (shared across Ref and Opt code) **/ enum { - /* Skein_256 round rotation constants */ + /* SKEIN_256 round rotation constants */ R_256_0_0 = 14, R_256_0_1 = 16, R_256_1_0 = 52, R_256_1_1 = 57, R_256_2_0 = 23, R_256_2_1 = 40, @@ -303,7 +303,7 @@ enum { R_256_6_0 = 58, R_256_6_1 = 22, R_256_7_0 = 32, R_256_7_1 = 32, - /* Skein_512 round rotation constants */ + /* SKEIN_512 round rotation constants */ R_512_0_0 = 46, R_512_0_1 = 36, R_512_0_2 = 19, R_512_0_3 = 37, R_512_1_0 = 33, R_512_1_1 = 27, R_512_1_2 = 14, R_512_1_3 = 42, R_512_2_0 = 17, R_512_2_1 = 49, R_512_2_2 = 36, R_512_2_3 = 39, @@ -313,7 +313,7 @@ enum { R_512_6_0 = 25, R_512_6_1 = 29, R_512_6_2 = 39, R_512_6_3 = 43, R_512_7_0 = 8, R_512_7_1 = 35, R_512_7_2 = 56, R_512_7_3 = 22, - /* Skein1024 round rotation constants */ + /* SKEIN_1024 round rotation constants */ R1024_0_0 = 24, R1024_0_1 = 13, R1024_0_2 = 8, R1024_0_3 = 47, R1024_0_4 = 8, R1024_0_5 = 17, R1024_0_6 = 22, R1024_0_7 = 37, R1024_1_0 = 38, R1024_1_1 = 19, R1024_1_2 = 10, R1024_1_3 = 55, diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skeinApi.h index 850d5c9..b4e879d 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skeinApi.h @@ -50,7 +50,7 @@ OTHER DEALINGS IN THE SOFTWARE. * struct skein_ctx ctx; // a Skein hash or MAC context * * // prepare context, here for a Skein with a state size of 512 bits. - * skein_ctx_prepare(, Skein512); + * skein_ctx_prepare(, SKEIN_512); * * // Initialize the context to set the requested hash length in bits * // here request a output hash size of 31 bits (Skein supports variable @@ -85,9 +85,9 @@ OTHER DEALINGS IN THE SOFTWARE. * Which Skein size to use */ enum skein_size { - Skein256 = 256, /*!< Skein with 256 bit state */ - Skein512 = 512, /*!< Skein with 512 bit state */ - Skein1024 = 1024/*!< Skein with 1024 bit state */ + SKEIN_256 = 256, /*!< Skein with 256 bit state */ + SKEIN_512 = 512, /*!< Skein with 512 bit state */ + SKEIN_1024 = 1024/*!< Skein with 1024 bit state */ }; /** diff --git a/drivers/staging/skein/include/threefishApi.h b/drivers/staging/skein/include/threefishApi.h index 37f6e63..63030e5 100644 --- a/drivers/staging/skein/include/threefishApi.h +++ b/drivers/staging/skein/include/threefishApi.h @@ -17,14 +17,14 @@ * functions. * @code -// Threefish cipher context data -struct threefish_key key_ctx; + // Threefish cipher context data + struct threefish_key key_ctx; -// Initialize the context -threefish_set_key(_ctx, Threefish512, key, tweak); + // Initialize the context + threefish_set_key(_ctx, THREEFISH_512, key, tweak); -// Encrypt -threefish_encrypt_block_bytes(_ctx, input, cipher); + // Encrypt + threefish_encrypt_block_bytes(_ctx, input, cipher); @endcode */ @@ -37,9 +37,9 @@ * Which Threefish size to use */ enum threefish_size { - Threefish256 = 256, /*!< Skein with 256 bit state */ - Threefish512 = 512, /*!< Skein with 512 bit state */ - Threefish1024 = 1024/*!< Skein with 1024 bit state */ + THREEFISH_256 = 256, /*!< Skein with 256 bit state */ + THREEFISH_512 = 512, /*!< Skein with 512 bit state */ + THREEFISH_1024 = 1024/*!< Skein with 1024 bit state */ }; /** diff --git a/drivers/staging/skein/skeinApi.c b/drivers/staging/skein/skeinApi.c index 3426392..87b3ff2 100644 --- a/drivers/staging/skein/skeinApi.c +++ b/drivers/staging/skein/skeinApi.c @@ -57,15 +57,15 @@ int skein_init(struct skein_ctx *ctx, size_t hash_bit_len) * the save chaining variab
[PATCH v2 00/06] staging: crypto: skein: fixing style issues
Hi! To prepare skein driver for mainline inclusion we fixing most of style issues (wrong names of functions, vars, macros, files) and checkpatch problems in this patch set. For example, existing code is widely use camelCase names. This patch fix it. Anton Saraev (6): staging: crypto: skein: rename camelcase functions staging: crypto: skein: rename camelcase vars staging: crypto: skein: rename skein1024_ctx to skein_1024_ctx staging: crypto: skein: rename enums staging: crypto: skein: rename macros staging: crypto: skein: rename files drivers/staging/skein/Makefile | 10 +- drivers/staging/skein/TODO | 3 - drivers/staging/skein/include/skein.h | 180 +++ .../skein/include/{skeinApi.h = skein_api.h} | 66 +-- drivers/staging/skein/include/skein_block.h| 12 +- drivers/staging/skein/include/skein_iv.h | 6 +- .../include/{threefishApi.h = threefish_api.h}| 84 +-- drivers/staging/skein/skein.c | 577 +++-- drivers/staging/skein/{skeinApi.c = skein_api.c} | 170 +++--- drivers/staging/skein/skein_block.c| 411 +++ .../{skeinBlockNo3F.c = skein_block_no_3f.c} | 62 +-- drivers/staging/skein/threefishApi.c | 79 --- ...threefish1024Block.c = threefish_1024_block.c} | 80 +-- .../{threefish256Block.c = threefish_256_block.c} | 32 +- .../{threefish512Block.c = threefish_512_block.c} | 48 +- drivers/staging/skein/threefish_api.c | 78 +++ 16 files changed, 959 insertions(+), 939 deletions(-) rename drivers/staging/skein/include/{skeinApi.h = skein_api.h} (79%) rename drivers/staging/skein/include/{threefishApi.h = threefish_api.h} (66%) rename drivers/staging/skein/{skeinApi.c = skein_api.c} (52%) rename drivers/staging/skein/{skeinBlockNo3F.c = skein_block_no_3f.c} (66%) delete mode 100644 drivers/staging/skein/threefishApi.c rename drivers/staging/skein/{threefish1024Block.c = threefish_1024_block.c} (98%) rename drivers/staging/skein/{threefish256Block.c = threefish_256_block.c} (96%) rename drivers/staging/skein/{threefish512Block.c = threefish_512_block.c} (97%) create mode 100644 drivers/staging/skein/threefish_api.c -- 1.9.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 04/06] staging: crypto: skein: rename enums
Linux Kernel use capitalized names for enum. To prepare skein driver to mainline inclusion, we rename all enums to capitalized names. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/skein/include/skein.h| 6 +++--- drivers/staging/skein/include/skeinApi.h | 8 drivers/staging/skein/include/threefishApi.h | 18 +- drivers/staging/skein/skeinApi.c | 24 drivers/staging/skein/skeinBlockNo3F.c | 6 +++--- drivers/staging/skein/skein_block.c | 6 +++--- drivers/staging/skein/threefishApi.c | 12 ++-- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index 09e96d6..8ecd720 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -293,7 +293,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); ** Skein block function constants (shared across Ref and Opt code) **/ enum { - /* Skein_256 round rotation constants */ + /* SKEIN_256 round rotation constants */ R_256_0_0 = 14, R_256_0_1 = 16, R_256_1_0 = 52, R_256_1_1 = 57, R_256_2_0 = 23, R_256_2_1 = 40, @@ -303,7 +303,7 @@ enum { R_256_6_0 = 58, R_256_6_1 = 22, R_256_7_0 = 32, R_256_7_1 = 32, - /* Skein_512 round rotation constants */ + /* SKEIN_512 round rotation constants */ R_512_0_0 = 46, R_512_0_1 = 36, R_512_0_2 = 19, R_512_0_3 = 37, R_512_1_0 = 33, R_512_1_1 = 27, R_512_1_2 = 14, R_512_1_3 = 42, R_512_2_0 = 17, R_512_2_1 = 49, R_512_2_2 = 36, R_512_2_3 = 39, @@ -313,7 +313,7 @@ enum { R_512_6_0 = 25, R_512_6_1 = 29, R_512_6_2 = 39, R_512_6_3 = 43, R_512_7_0 = 8, R_512_7_1 = 35, R_512_7_2 = 56, R_512_7_3 = 22, - /* Skein1024 round rotation constants */ + /* SKEIN_1024 round rotation constants */ R1024_0_0 = 24, R1024_0_1 = 13, R1024_0_2 = 8, R1024_0_3 = 47, R1024_0_4 = 8, R1024_0_5 = 17, R1024_0_6 = 22, R1024_0_7 = 37, R1024_1_0 = 38, R1024_1_1 = 19, R1024_1_2 = 10, R1024_1_3 = 55, diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skeinApi.h index 850d5c9..b4e879d 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skeinApi.h @@ -50,7 +50,7 @@ OTHER DEALINGS IN THE SOFTWARE. * struct skein_ctx ctx; // a Skein hash or MAC context * * // prepare context, here for a Skein with a state size of 512 bits. - * skein_ctx_prepare(ctx, Skein512); + * skein_ctx_prepare(ctx, SKEIN_512); * * // Initialize the context to set the requested hash length in bits * // here request a output hash size of 31 bits (Skein supports variable @@ -85,9 +85,9 @@ OTHER DEALINGS IN THE SOFTWARE. * Which Skein size to use */ enum skein_size { - Skein256 = 256, /*! Skein with 256 bit state */ - Skein512 = 512, /*! Skein with 512 bit state */ - Skein1024 = 1024/*! Skein with 1024 bit state */ + SKEIN_256 = 256, /*! Skein with 256 bit state */ + SKEIN_512 = 512, /*! Skein with 512 bit state */ + SKEIN_1024 = 1024/*! Skein with 1024 bit state */ }; /** diff --git a/drivers/staging/skein/include/threefishApi.h b/drivers/staging/skein/include/threefishApi.h index 37f6e63..63030e5 100644 --- a/drivers/staging/skein/include/threefishApi.h +++ b/drivers/staging/skein/include/threefishApi.h @@ -17,14 +17,14 @@ * functions. * @code -// Threefish cipher context data -struct threefish_key key_ctx; + // Threefish cipher context data + struct threefish_key key_ctx; -// Initialize the context -threefish_set_key(key_ctx, Threefish512, key, tweak); + // Initialize the context + threefish_set_key(key_ctx, THREEFISH_512, key, tweak); -// Encrypt -threefish_encrypt_block_bytes(key_ctx, input, cipher); + // Encrypt + threefish_encrypt_block_bytes(key_ctx, input, cipher); @endcode */ @@ -37,9 +37,9 @@ * Which Threefish size to use */ enum threefish_size { - Threefish256 = 256, /*! Skein with 256 bit state */ - Threefish512 = 512, /*! Skein with 512 bit state */ - Threefish1024 = 1024/*! Skein with 1024 bit state */ + THREEFISH_256 = 256, /*! Skein with 256 bit state */ + THREEFISH_512 = 512, /*! Skein with 512 bit state */ + THREEFISH_1024 = 1024/*! Skein with 1024 bit state */ }; /** diff --git a/drivers/staging/skein/skeinApi.c b/drivers/staging/skein/skeinApi.c index 3426392..87b3ff2 100644 --- a/drivers/staging/skein/skeinApi.c +++ b/drivers/staging/skein/skeinApi.c @@ -57,15 +57,15 @@ int skein_init(struct skein_ctx *ctx, size_t hash_bit_len) * the save chaining variables
[PATCH v2 01/06] staging: crypto: skein: rename camelcase functions
camelCase is not accepted in the Linux Kernel. To prepare skein driver for mainline inclusion, we rename all functions to non-camelCase equivalents. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/skein/TODO | 1 - drivers/staging/skein/include/skein.h| 66 drivers/staging/skein/include/skeinApi.h | 38 - drivers/staging/skein/include/skein_block.h | 12 +-- drivers/staging/skein/include/threefishApi.h | 44 ++- drivers/staging/skein/skein.c| 114 +-- drivers/staging/skein/skeinApi.c | 72 - drivers/staging/skein/skeinBlockNo3F.c | 24 +++--- drivers/staging/skein/skein_block.c | 40 +- drivers/staging/skein/threefish1024Block.c | 6 +- drivers/staging/skein/threefish256Block.c| 6 +- drivers/staging/skein/threefish512Block.c| 6 +- drivers/staging/skein/threefishApi.c | 38 - 13 files changed, 239 insertions(+), 228 deletions(-) diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO index f5c167a..bc42fb8 100644 --- a/drivers/staging/skein/TODO +++ b/drivers/staging/skein/TODO @@ -1,7 +1,6 @@ skein/threefish TODO - rename camelcase vars - - rename camelcase functions - rename files - move macros into appropriate header files - add / pass test vectors diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index 0a2abce..15ff60f 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -86,59 +86,59 @@ struct skein1024_ctx { /* 1024-bit Skein hash context structure */ u8 b[SKEIN1024_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */ }; -/* Skein APIs for (incremental) straight hashing */ -int Skein_256_Init(struct skein_256_ctx *ctx, size_t hashBitLen); -int Skein_512_Init(struct skein_512_ctx *ctx, size_t hashBitLen); -int Skein1024_Init(struct skein1024_ctx *ctx, size_t hashBitLen); - -int Skein_256_Update(struct skein_256_ctx *ctx, const u8 *msg, - size_t msgByteCnt); -int Skein_512_Update(struct skein_512_ctx *ctx, const u8 *msg, - size_t msgByteCnt); -int Skein1024_Update(struct skein1024_ctx *ctx, const u8 *msg, - size_t msgByteCnt); - -int Skein_256_Final(struct skein_256_ctx *ctx, u8 *hashVal); -int Skein_512_Final(struct skein_512_ctx *ctx, u8 *hashVal); -int Skein1024_Final(struct skein1024_ctx *ctx, u8 *hashVal); +/* Skein APIs for (incremental) straight hashing */ +int skein_256_init(struct skein_256_ctx *ctx, size_t hashBitLen); +int skein_512_init(struct skein_512_ctx *ctx, size_t hashBitLen); +int skein_1024_init(struct skein1024_ctx *ctx, size_t hashBitLen); + +int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, +size_t msgByteCnt); +int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg, +size_t msgByteCnt); +int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg, + size_t msgByteCnt); + +int skein_256_final(struct skein_256_ctx *ctx, u8 *hashVal); +int skein_512_final(struct skein_512_ctx *ctx, u8 *hashVal); +int skein_1024_final(struct skein1024_ctx *ctx, u8 *hashVal); /* ** Skein APIs for extended initialization: MAC keys, tree hashing. -** After an InitExt() call, just use Update/Final calls as with Init(). +** After an init_ext() call, just use update/final calls as with init(). ** -** Notes: Same parameters as _Init() calls, plus treeInfo/key/keyBytes. +** Notes: Same parameters as _init() calls, plus treeInfo/key/keyBytes. ** When keyBytes == 0 and treeInfo == SKEIN_SEQUENTIAL, -** the results of InitExt() are identical to calling Init(). -** The function Init() may be called once to precompute the IV for +** the results of init_ext() are identical to calling init(). +** The function init() may be called once to precompute the IV for ** a given hashBitLen value, then by saving a copy of the context ** the IV computation may be avoided in later calls. -** Similarly, the function InitExt() may be called once per MAC key +** Similarly, the function init_ext() may be called once per MAC key ** to precompute the MAC IV, then a copy of the context saved and ** reused for each new MAC computation. **/ -int Skein_256_InitExt(struct skein_256_ctx *ctx, size_t hashBitLen, - u64 treeInfo, const u8 *key, size_t keyBytes); -int Skein_512_InitExt(struct skein_512_ctx *ctx, size_t hashBitLen, - u64 treeInfo, const u8 *key, size_t keyBytes); -int Skein1024_InitExt(struct skein1024_ctx *ctx, size_t hashBitLen, +int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hashBitLen, + u64 treeInfo
[PATCH v2 06/06] staging: crypto: skein: rename files
camelCase is not accepted in the Linux Kernel. To prepare skein driver for mainline inclusion, we rename all files to non-camelCase equivalents. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/skein/Makefile | 10 +- drivers/staging/skein/TODO | 1 - drivers/staging/skein/include/{skeinApi.h = skein_api.h} | 4 ++-- .../staging/skein/include/{threefishApi.h = threefish_api.h} | 2 +- drivers/staging/skein/{skeinApi.c = skein_api.c} | 2 +- .../staging/skein/{skeinBlockNo3F.c = skein_block_no_3f.c}| 2 +- .../skein/{threefish1024Block.c = threefish_1024_block.c} | 2 +- .../skein/{threefish256Block.c = threefish_256_block.c} | 2 +- .../skein/{threefish512Block.c = threefish_512_block.c} | 2 +- drivers/staging/skein/{threefishApi.c = threefish_api.c} | 3 +-- 10 files changed, 14 insertions(+), 16 deletions(-) rename drivers/staging/skein/include/{skeinApi.h = skein_api.h} (99%) rename drivers/staging/skein/include/{threefishApi.h = threefish_api.h} (99%) rename drivers/staging/skein/{skeinApi.c = skein_api.c} (99%) rename drivers/staging/skein/{skeinBlockNo3F.c = skein_block_no_3f.c} (99%) rename drivers/staging/skein/{threefish1024Block.c = threefish_1024_block.c} (99%) rename drivers/staging/skein/{threefish256Block.c = threefish_256_block.c} (99%) rename drivers/staging/skein/{threefish512Block.c = threefish_512_block.c} (99%) rename drivers/staging/skein/{threefishApi.c = threefish_api.c} (98%) diff --git a/drivers/staging/skein/Makefile b/drivers/staging/skein/Makefile index 2bb386e..29f51bf 100644 --- a/drivers/staging/skein/Makefile +++ b/drivers/staging/skein/Makefile @@ -4,10 +4,10 @@ subdir-ccflags-y := -I$(src)/include/ obj-$(CONFIG_CRYPTO_SKEIN) += skein.o \ - skeinApi.o \ + skein_api.o \ skein_block.o -obj-$(CONFIG_CRYPTO_THREEFISH) += threefish1024Block.o \ - threefish256Block.o \ - threefish512Block.o \ - threefishApi.o +obj-$(CONFIG_CRYPTO_THREEFISH) += threefish_1024_block.o \ + threefish_256_block.o \ + threefish_512_block.o \ + threefish_api.o diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO index 88a6e81..cd3508d 100644 --- a/drivers/staging/skein/TODO +++ b/drivers/staging/skein/TODO @@ -1,6 +1,5 @@ skein/threefish TODO - - rename files - move macros into appropriate header files - add / pass test vectors - module support diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skein_api.h similarity index 99% rename from drivers/staging/skein/include/skeinApi.h rename to drivers/staging/skein/include/skein_api.h index b4e879d..87f769a 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skein_api.h @@ -28,7 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE. #define SKEINAPI_H /** - * @file skeinApi.h + * @file skein_api.h * @brief A Skein API and its functions. * @{ * @@ -44,7 +44,7 @@ OTHER DEALINGS IN THE SOFTWARE. * * @code * - * #include skeinApi.h + * #include skein_api.h * * ... * struct skein_ctx ctx; // a Skein hash or MAC context diff --git a/drivers/staging/skein/include/threefishApi.h b/drivers/staging/skein/include/threefish_api.h similarity index 99% rename from drivers/staging/skein/include/threefishApi.h rename to drivers/staging/skein/include/threefish_api.h index 96cc0e8..fe28981 100644 --- a/drivers/staging/skein/include/threefishApi.h +++ b/drivers/staging/skein/include/threefish_api.h @@ -3,7 +3,7 @@ #define THREEFISHAPI_H /** - * @file threefishApi.h + * @file threefish_api.h * @brief A Threefish cipher API and its functions. * @{ * diff --git a/drivers/staging/skein/skeinApi.c b/drivers/staging/skein/skein_api.c similarity index 99% rename from drivers/staging/skein/skeinApi.c rename to drivers/staging/skein/skein_api.c index 16d596b..7fb0160 100644 --- a/drivers/staging/skein/skeinApi.c +++ b/drivers/staging/skein/skein_api.c @@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE. */ #include linux/string.h -#include skeinApi.h +#include skein_api.h int skein_ctx_prepare(struct skein_ctx *ctx, enum skein_size size) { diff --git a/drivers/staging/skein/skeinBlockNo3F.c b/drivers/staging/skein/skein_block_no_3f.c similarity index 99% rename from drivers/staging/skein/skeinBlockNo3F.c rename to drivers/staging/skein/skein_block_no_3f.c index 4ee7f9f..23a3ac5 100644 --- a/drivers/staging/skein/skeinBlockNo3F.c +++ b/drivers/staging/skein/skein_block_no_3f.c @@ -1,7 +1,7 @@ #include linux/string.h #include skein.h -#include threefishApi.h +#include threefish_api.h
[PATCH v2 03/06] staging: crypto: skein: rename skein1024_ctx to skein_1024_ctx
Code have skein_512_ctx and skein_256_ctx but skein1024_ctx. It would be logical to convert these names to a single form. Signed-off-by: Anton Saraev antonysar...@gmail.com --- drivers/staging/skein/include/skein.h | 14 +++--- drivers/staging/skein/include/skeinApi.h| 2 +- drivers/staging/skein/include/skein_block.h | 2 +- drivers/staging/skein/skein.c | 12 ++-- drivers/staging/skein/skeinBlockNo3F.c | 2 +- drivers/staging/skein/skein_block.c | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/skein/include/skein.h b/drivers/staging/skein/include/skein.h index deaa9c8..09e96d6 100644 --- a/drivers/staging/skein/include/skein.h +++ b/drivers/staging/skein/include/skein.h @@ -81,7 +81,7 @@ struct skein_512_ctx { /* 512-bit Skein hash context structure */ u8 b[SKEIN_512_BLOCK_BYTES];/* partial block buf (8-byte aligned) */ }; -struct skein1024_ctx { /* 1024-bit Skein hash context structure */ +struct skein_1024_ctx { /* 1024-bit Skein hash context structure */ struct skein_ctx_hdr h; /* common header context variables */ u64 X[SKEIN1024_STATE_WORDS]; /* chaining variables */ u8 b[SKEIN1024_BLOCK_BYTES];/* partial block buf (8-byte aligned) */ @@ -90,18 +90,18 @@ struct skein1024_ctx { /* 1024-bit Skein hash context structure */ /* Skein APIs for (incremental) straight hashing */ int skein_256_init(struct skein_256_ctx *ctx, size_t hash_bit_len); int skein_512_init(struct skein_512_ctx *ctx, size_t hash_bit_len); -int skein_1024_init(struct skein1024_ctx *ctx, size_t hash_bit_len); +int skein_1024_init(struct skein_1024_ctx *ctx, size_t hash_bit_len); int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); -int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg, +int skein_1024_update(struct skein_1024_ctx *ctx, const u8 *msg, size_t msg_byte_cnt); int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_final(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val); /* ** Skein APIs for extended initialization: MAC keys, tree hashing. @@ -121,7 +121,7 @@ int skein_256_init_ext(struct skein_256_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); int skein_512_init_ext(struct skein_512_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); -int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len, +int skein_1024_init_ext(struct skein_1024_ctx *ctx, size_t hash_bit_len, u64 tree_info, const u8 *key, size_t key_bytes); /* @@ -131,7 +131,7 @@ int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len, */ int skein_256_final_pad(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_final_pad(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 *hash_val); #ifndef SKEIN_TREE_HASH #define SKEIN_TREE_HASH (1) @@ -139,7 +139,7 @@ int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val); #if SKEIN_TREE_HASH int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val); int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val); -int skein_1024_output(struct skein1024_ctx *ctx, u8 *hash_val); +int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val); #endif /* diff --git a/drivers/staging/skein/include/skeinApi.h b/drivers/staging/skein/include/skeinApi.h index 11ecab8..850d5c9 100644 --- a/drivers/staging/skein/include/skeinApi.h +++ b/drivers/staging/skein/include/skeinApi.h @@ -105,7 +105,7 @@ struct skein_ctx { struct skein_ctx_hdr h; struct skein_256_ctx s256; struct skein_512_ctx s512; - struct skein1024_ctx s1024; + struct skein_1024_ctx s1024; } m; }; diff --git a/drivers/staging/skein/include/skein_block.h b/drivers/staging/skein/include/skein_block.h index ec787a3..a8dd083 100644 --- a/drivers/staging/skein/include/skein_block.h +++ b/drivers/staging/skein/include/skein_block.h @@ -16,7 +16,7 @@ void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, size_t blk_cnt, size_t byte_cnt_add); void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr, size_t blk_cnt, size_t byte_cnt_add); -void skein_1024_process_block(struct skein1024_ctx *ctx, const u8 *blk_ptr, +void