Commit-ID: 2c1c8ce404c921f0aec72efe8c2a895799797445 Gitweb: http://git.kernel.org/tip/2c1c8ce404c921f0aec72efe8c2a895799797445 Author: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> AuthorDate: Tue, 20 Dec 2011 17:08:42 +0800 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Wed, 21 Dec 2011 22:28:07 +0200 kvm tools: mark usages functions as NORETURN It will help for simplifying codes like this: { if (cond == NULL) NORETURN_func(); /* use cond safely, it is not NULL and don't need to check it again */ } It also helps for readability. Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/include/kvm/builtin-balloon.h | 4 +++- tools/kvm/include/kvm/builtin-debug.h | 3 ++- tools/kvm/include/kvm/builtin-list.h | 4 +++- tools/kvm/include/kvm/builtin-pause.h | 4 +++- tools/kvm/include/kvm/builtin-resume.h | 4 +++- tools/kvm/include/kvm/builtin-run.h | 4 +++- tools/kvm/include/kvm/builtin-setup.h | 4 +++- tools/kvm/include/kvm/builtin-stat.h | 4 +++- tools/kvm/include/kvm/builtin-stop.h | 4 +++- tools/kvm/include/kvm/parse-options.h | 3 ++- 10 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tools/kvm/include/kvm/builtin-balloon.h b/tools/kvm/include/kvm/builtin-balloon.h index 85055eb..77ee656 100644 --- a/tools/kvm/include/kvm/builtin-balloon.h +++ b/tools/kvm/include/kvm/builtin-balloon.h @@ -1,7 +1,9 @@ #ifndef KVM__BALLOON_H #define KVM__BALLOON_H +#include <kvm/util.h> + int kvm_cmd_balloon(int argc, const char **argv, const char *prefix); -void kvm_balloon_help(void); +void kvm_balloon_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-debug.h b/tools/kvm/include/kvm/builtin-debug.h index 0aafef9..97df0d97bd 100644 --- a/tools/kvm/include/kvm/builtin-debug.h +++ b/tools/kvm/include/kvm/builtin-debug.h @@ -1,6 +1,7 @@ #ifndef KVM__DEBUG_H #define KVM__DEBUG_H +#include <kvm/util.h> #include <linux/types.h> #define KVM_DEBUG_CMD_TYPE_DUMP (1 << 0) @@ -18,6 +19,6 @@ struct debug_cmd { }; int kvm_cmd_debug(int argc, const char **argv, const char *prefix); -void kvm_debug_help(void); +void kvm_debug_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-list.h b/tools/kvm/include/kvm/builtin-list.h index 04fca22..7b697f6 100644 --- a/tools/kvm/include/kvm/builtin-list.h +++ b/tools/kvm/include/kvm/builtin-list.h @@ -1,7 +1,9 @@ #ifndef KVM__LIST_H #define KVM__LIST_H +#include <kvm/util.h> + int kvm_cmd_list(int argc, const char **argv, const char *prefix); -void kvm_list_help(void); +void kvm_list_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-pause.h b/tools/kvm/include/kvm/builtin-pause.h index 540cc8e..84aaee3 100644 --- a/tools/kvm/include/kvm/builtin-pause.h +++ b/tools/kvm/include/kvm/builtin-pause.h @@ -1,7 +1,9 @@ #ifndef KVM__PAUSE_H #define KVM__PAUSE_H +#include <kvm/util.h> + int kvm_cmd_pause(int argc, const char **argv, const char *prefix); -void kvm_pause_help(void); +void kvm_pause_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-resume.h b/tools/kvm/include/kvm/builtin-resume.h index 9e6e8d7..7de999b 100644 --- a/tools/kvm/include/kvm/builtin-resume.h +++ b/tools/kvm/include/kvm/builtin-resume.h @@ -1,7 +1,9 @@ #ifndef KVM__RESUME_H #define KVM__RESUME_H +#include <kvm/util.h> + int kvm_cmd_resume(int argc, const char **argv, const char *prefix); -void kvm_resume_help(void); +void kvm_resume_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-run.h b/tools/kvm/include/kvm/builtin-run.h index c4b8ccb..91521a5 100644 --- a/tools/kvm/include/kvm/builtin-run.h +++ b/tools/kvm/include/kvm/builtin-run.h @@ -1,8 +1,10 @@ #ifndef __KVM_RUN_H__ #define __KVM_RUN_H__ +#include <kvm/util.h> + int kvm_cmd_run(int argc, const char **argv, const char *prefix); -void kvm_run_help(void); +void kvm_run_help(void) NORETURN; void kvm_run_set_wrapper_sandbox(void); diff --git a/tools/kvm/include/kvm/builtin-setup.h b/tools/kvm/include/kvm/builtin-setup.h index f70ae78..4a8d7ee 100644 --- a/tools/kvm/include/kvm/builtin-setup.h +++ b/tools/kvm/include/kvm/builtin-setup.h @@ -1,8 +1,10 @@ #ifndef KVM__SETUP_H #define KVM__SETUP_H +#include <kvm/util.h> + int kvm_cmd_setup(int argc, const char **argv, const char *prefix); -void kvm_setup_help(void); +void kvm_setup_help(void) NORETURN; int kvm_setup_create_new(const char *guestfs_name); void kvm_setup_resolv(const char *guestfs_name); diff --git a/tools/kvm/include/kvm/builtin-stat.h b/tools/kvm/include/kvm/builtin-stat.h index e3ce292..4fecb37 100644 --- a/tools/kvm/include/kvm/builtin-stat.h +++ b/tools/kvm/include/kvm/builtin-stat.h @@ -1,7 +1,9 @@ #ifndef KVM__STAT_H #define KVM__STAT_H +#include <kvm/util.h> + int kvm_cmd_stat(int argc, const char **argv, const char *prefix); -void kvm_stat_help(void); +void kvm_stat_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/builtin-stop.h b/tools/kvm/include/kvm/builtin-stop.h index 7570695..b26b275 100644 --- a/tools/kvm/include/kvm/builtin-stop.h +++ b/tools/kvm/include/kvm/builtin-stop.h @@ -1,7 +1,9 @@ #ifndef KVM__STOP_H #define KVM__STOP_H +#include <kvm/util.h> + int kvm_cmd_stop(int argc, const char **argv, const char *prefix); -void kvm_stop_help(void); +void kvm_stop_help(void) NORETURN; #endif diff --git a/tools/kvm/include/kvm/parse-options.h b/tools/kvm/include/kvm/parse-options.h index b65820d..7886ff7 100644 --- a/tools/kvm/include/kvm/parse-options.h +++ b/tools/kvm/include/kvm/parse-options.h @@ -2,6 +2,7 @@ #define __PARSE_OPTIONS_H__ #include <inttypes.h> +#include <kvm/util.h> enum parse_opt_type { /* special types */ @@ -207,7 +208,7 @@ struct parse_opt_ctx_t { /* global functions */ void usage_with_options(const char * const *usagestr, - const struct option *opts); + const struct option *opts) NORETURN; int parse_options(int argc, const char **argv, const struct option *options, const char * const usagestr[], int flags); #endif -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html