static int kdb_defcmd2(const char *cmdstr, const char *argv0)
{
	struct kdb_macro_statement *kms;

	if (!kdb_macro)
		return KDB_NOTIMP;

	if (strcmp(argv0, "endefcmd") == 0) {
		defcmd_in_progress = false;
		if (!list_empty(&kdb_macro->statements))
			kdb_register(&kdb_macro->cmd);
		return 0;
	}

	kms = kmalloc(sizeof(*kms), GFP_KDB);
	if (!kms) {
		kdb_printf("Could not allocate new kdb macro command: %s\n",
			   cmdstr);
		return KDB_NOTIMP;
	}

	kms->statement = kdb_strdup(cmdstr, GFP_KDB);
	list_add_tail(&kms->list_node, &kdb_macro->statements);

	return 0;
}
static int kdb_defcmd2(const char *cmdstr, const char *argv0)
{
	struct kdb_macro_statement *kms;

	if (!kdb_macro)
		return KDB_NOTIMP;

	if (strcmp(argv0, "endefcmd") == 0) {
		defcmd_in_progress = false;
		if (!list_empty(&kdb_macro->statements))
			kdb_register(&kdb_macro->cmd);
		return 0;
	}

	kms = kmalloc(sizeof(*kms), GFP_KDB);
	if (!kms) {
		kdb_printf("Could not allocate new kdb macro command: %s\n",
			   cmdstr);
		return KDB_NOTIMP;
	}

	kms->statement = kdb_strdup(cmdstr, GFP_KDB);
	list_add_tail(&kms->list_node, &kdb_macro->statements);

	return 0;
}