Skip to content

Commit

Permalink
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu int…
Browse files Browse the repository at this point in the history
…o staging

trivial patches for 2024-04-29

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEe3O61ovnosKJMUsicBtPaxppPlkFAmYvknIACgkQcBtPaxpp
# Pln8ywf+LthaeFDBccSYDKE+bu0zGshog5wBvlD6PHH7+e/tL6y5rKBmoC8aa2Pv
# 9Op57otEGAjOviLwFh+Xm78B6SwTweFwDlRsLDhzZUyVWMV6RqfPQ2Ix2rTGncCZ
# t7hpHwnDqtHPkwqqEdXzNC6tlL5wjTlZLOK8osCpUz7Ji4Iqt79KaxGiuEjdHovb
# DBTOzC1DbfmCEWf7UcoBFsoQLHhYwnasAC+obEGD2ahiIfetyqOwaS0QrpWiw/47
# fl4sfuFgI2n56AdEtD7PNDiHZaCJ7ZnvlAz4wXu4veqdefgKNi2vlBXKNc0DokNK
# pHaBsEnFswjVsz5w2ynQRH+i3hMzWg==
# =rRV+
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 29 Apr 2024 05:28:34 AM PDT
# gpg:                using RSA key 7B73BAD68BE7A2C289314B22701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" [full]
# gpg:                 aka "Michael Tokarev <mjt@debian.org>" [full]
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>" [full]

* tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu:
  checkpatch.pl: forbid strerrorname_np()
  target/riscv/kvm: remove sneaky strerrorname_np() instance
  target/loongarch/cpu.c: typo fix: expection
  backends/cryptodev-builtin: Fix local_error leaks
  scripts/checkpatch: Do not use mailmap
  scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org
  target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list
  target/s390x/cpu_models: Rework the output of "-cpu help"
  target/i386/cpu: Remove "x86" prefix from the CPU list

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Apr 30, 2024
2 parents 5fee33d + ce1992d commit 2358f1b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
9 changes: 5 additions & 4 deletions backends/cryptodev-builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "qemu/osdep.h"
#include "sysemu/cryptodev.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "standard-headers/linux/virtio_crypto.h"
#include "crypto/cipher.h"
Expand Down Expand Up @@ -396,8 +397,8 @@ static int cryptodev_builtin_create_session(
case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
default:
error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
sess_info->op_code);
error_report("Unsupported opcode :%" PRIu32 "",
sess_info->op_code);
return -VIRTIO_CRYPTO_NOTSUPP;
}

Expand Down Expand Up @@ -554,8 +555,8 @@ static int cryptodev_builtin_operation(

if (op_info->session_id >= MAX_NUM_SESSIONS ||
builtin->sessions[op_info->session_id] == NULL) {
error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
op_info->session_id);
error_report("Cannot find a valid session id: %" PRIu64 "",
op_info->session_id);
return -VIRTIO_CRYPTO_INVSESS;
}

Expand Down
11 changes: 7 additions & 4 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ sub build_types {
my @patches;
my %git_commits = ();
my $HASH;
open($HASH, "-|", "git", "log", "--reverse", "--no-merges", "--format=%H %s", $ARGV[0]) ||
die "$P: git log --reverse --no-merges --format='%H %s' $ARGV[0] failed - $!\n";
open($HASH, "-|", "git", "log", "--reverse", "--no-merges", "--no-mailmap", "--format=%H %s", $ARGV[0]) ||
die "$P: git log --reverse --no-merges --no-mailmap --format='%H %s' $ARGV[0] failed - $!\n";

for my $line (<$HASH>) {
$line =~ /^([0-9a-fA-F]{40,40}) (.*)$/;
Expand All @@ -460,7 +460,7 @@ sub build_types {
"-c", "diff.renamelimit=0",
"-c", "diff.renames=True",
"-c", "diff.algorithm=histogram",
"show",
"show", "--no-mailmap",
"--patch-with-stat", $hash) ||
die "$P: git show $hash - $!\n";
while (<$FILE>) {
Expand Down Expand Up @@ -1573,7 +1573,7 @@ sub process {
$is_patch = 1;
}

if ($line =~ /^(Author|From): .* via .*<qemu-devel\@nongnu.org>/) {
if ($line =~ /^(Author|From): .* via .*<qemu-\w+\@nongnu\.org>/) {
ERROR("Author email address is mangled by the mailing list\n" . $herecurr);
}

Expand Down Expand Up @@ -3078,6 +3078,9 @@ sub process {
if ($line =~ /\b(g_)?assert\(0\)/) {
ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr);
}
if ($line =~ /\bstrerrorname_np\(/) {
ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr);
}
my $non_exit_glib_asserts = qr{g_assert_cmpstr|
g_assert_cmpint|
g_assert_cmpuint|
Expand Down
2 changes: 1 addition & 1 deletion target/i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5708,7 +5708,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
desc = g_strdup_printf("%s (deprecated)", olddesc);
}

qemu_printf("x86 %-20s %s\n", name, desc);
qemu_printf(" %-20s %s\n", name, desc);
}

/* list available CPU models and flags */
Expand Down
2 changes: 1 addition & 1 deletion target/loongarch/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
{
CPUState *cs = env_cpu(env);

qemu_log_mask(CPU_LOG_INT, "%s: expection: %d (%s)\n",
qemu_log_mask(CPU_LOG_INT, "%s: exception: %d (%s)\n",
__func__,
exception,
loongarch_exception_name(exception));
Expand Down
9 changes: 5 additions & 4 deletions target/ppc/cpu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7063,7 +7063,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
}

name = cpu_model_from_type(typename);
qemu_printf("PowerPC %-16s PVR %08x\n", name, pcc->pvr);
qemu_printf(" %-16s PVR %08x\n", name, pcc->pvr);
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
ObjectClass *alias_oc = ppc_cpu_class_by_name(alias->model);
Expand All @@ -7076,10 +7076,10 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
* avoid printing the wrong alias here and use "preferred" instead
*/
if (strcmp(alias->alias, family->desc) == 0) {
qemu_printf("PowerPC %-16s (alias for preferred %s CPU)\n",
qemu_printf(" %-16s (alias for preferred %s CPU)\n",
alias->alias, family->desc);
} else {
qemu_printf("PowerPC %-16s (alias for %s)\n",
qemu_printf(" %-16s (alias for %s)\n",
alias->alias, name);
}
}
Expand All @@ -7090,14 +7090,15 @@ void ppc_cpu_list(void)
{
GSList *list;

qemu_printf("Available CPUs:\n");
list = object_class_get_list(TYPE_POWERPC_CPU, false);
list = g_slist_sort(list, ppc_cpu_list_compare);
g_slist_foreach(list, ppc_cpu_list_entry, NULL);
g_slist_free(list);

#ifdef CONFIG_KVM
qemu_printf("\n");
qemu_printf("PowerPC %s\n", "host");
qemu_printf(" %s\n", "host");
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions target/riscv/kvm/kvm-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,8 @@ static void kvm_riscv_read_vlenb(RISCVCPU *cpu, KVMScratchCPU *kvmcpu,

ret = ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, &reg);
if (ret != 0) {
error_report("Unable to read vlenb register, error code: %s",
strerrorname_np(errno));
error_report("Unable to read vlenb register, error code: %d",
errno);
exit(EXIT_FAILURE);
}

Expand Down
9 changes: 5 additions & 4 deletions target/s390x/cpu_models.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
/* strip off the -s390x-cpu */
g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
if (details->len) {
qemu_printf("s390 %-15s %-35s (%s)\n", name, scc->desc, details->str);
qemu_printf(" %-15s %-35s (%s)\n", name, scc->desc, details->str);
} else {
qemu_printf("s390 %-15s %-35s\n", name, scc->desc);
qemu_printf(" %-15s %-35s\n", name, scc->desc);
}
g_free(name);
}
Expand Down Expand Up @@ -402,6 +402,7 @@ void s390_cpu_list(void)
S390Feat feat;
GSList *list;

qemu_printf("Available CPUs:\n");
list = object_class_get_list(TYPE_S390_CPU, false);
list = g_slist_sort(list, s390_cpu_list_compare);
g_slist_foreach(list, s390_print_cpu_model_list_entry, NULL);
Expand All @@ -411,14 +412,14 @@ void s390_cpu_list(void)
for (feat = 0; feat < S390_FEAT_MAX; feat++) {
const S390FeatDef *def = s390_feat_def(feat);

qemu_printf("%-20s %s\n", def->name, def->desc);
qemu_printf(" %-20s %s\n", def->name, def->desc);
}

qemu_printf("\nRecognized feature groups:\n");
for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
const S390FeatGroupDef *def = s390_feat_group_def(group);

qemu_printf("%-20s %s\n", def->name, def->desc);
qemu_printf(" %-20s %s\n", def->name, def->desc);
}
}

Expand Down

0 comments on commit 2358f1b

Please sign in to comment.