defcmd_in_progress is the state trace for command group processing - within a command group or not - usable is an indicator if a command set is valid (allocated/non-empty) - so use a bool for those binary indication here.
Showing the changes to kernel/debug (1 of 1 file). Show all
Unified · Split
| @@ -658,7 +658,7 @@ static void kdb_cmderror(int diag) · 657 unmodified lines | ||
| 658 | 658 | */ |
| 659 | 659 | struct defcmd_set { |
| 660 | 660 | int count; |
| 661 | − int usable; | |
| 661 | + bool usable; | |
| 662 | 662 | char *name; |
| 663 | 663 | char *usage; |
| 664 | 664 | char *help; |
| @@ -666,7 +666,7 @@ struct defcmd_set { · 1 unmodified line | ||
| 666 | 666 | }; |
| 667 | 667 | static struct defcmd_set *defcmd_set; |
| 668 | 668 | static int defcmd_set_count; |
| 669 | −static int defcmd_in_progress; | |
| 669 | +static bool defcmd_in_progress; | |
| 670 | 670 | |
| 671 | 671 | /* Forward references */ |
| 672 | 672 | static int kdb_exec_defcmd(int argc, const char **argv); |
| @@ -676,9 +676,9 @@ static int kdb_defcmd2(const char *cmdstr, const char *argv0) · 3 unmodified lines | ||
| 676 | 676 | struct defcmd_set *s = defcmd_set + defcmd_set_count - 1; |
| 677 | 677 | char **save_command = s->command; |
| 678 | 678 | if (strcmp(argv0, "endefcmd") == 0) { |
| 679 | − defcmd_in_progress = 0; | |
| 679 | + defcmd_in_progress = false; | |
| 680 | 680 | if (!s->count) |
| 681 | − s->usable = 0; | |
| 681 | + s->usable = false; | |
| 682 | 682 | if (s->usable) |
| 683 | 683 | /* macros are always safe because when executed each |
| 684 | 684 | * internal command re-enters kdb_parse() and is |
| @@ -695,7 +695,7 @@ static int kdb_defcmd2(const char *cmdstr, const char *argv0) · 10 unmodified lines | ||
| 695 | 695 | if (!s->command) { |
| 696 | 696 | kdb_printf("Could not allocate new kdb_defcmd table for %s\n", |
| 697 | 697 | cmdstr); |
| 698 | − s->usable = 0; | |
| 698 | + s->usable = false; | |
| 699 | 699 | return KDB_NOTIMP; |
| 700 | 700 | } |
| 701 | 701 | memcpy(s->command, save_command, s->count * sizeof(*(s->command))); |
| @@ -737,7 +737,7 @@ static int kdb_defcmd(int argc, const char **argv) · 35 unmodified lines | ||
| 737 | 737 | defcmd_set_count * sizeof(*defcmd_set)); |
| 738 | 738 | s = defcmd_set + defcmd_set_count; |
| 739 | 739 | memset(s, 0, sizeof(*s)); |
| 740 | − s->usable = 1; | |
| 740 | + s->usable = true; | |
| 741 | 741 | s->name = kdb_strdup(argv[1], GFP_KDB); |
| 742 | 742 | if (!s->name) |
| 743 | 743 | goto fail_name; |
| @@ -756,7 +756,7 @@ static int kdb_defcmd(int argc, const char **argv) · 12 unmodified lines | ||
| 756 | 756 | s->help[strlen(s->help)-1] = '\0'; |
| 757 | 757 | } |
| 758 | 758 | ++defcmd_set_count; |
| 759 | − defcmd_in_progress = 1; | |
| 759 | + defcmd_in_progress = true; | |
| 760 | 760 | kfree(save_defcmd_set); |
| 761 | 761 | return 0; |
| 762 | 762 | fail_help: |