提交 78ee6bd0 编写于 作者: P Philippe Mathieu-Daudé 提交者: Markus Armbruster

various: Remove suspicious '\' character outside of #define in C code

Fixes the following coccinelle warnings:

  $ spatch --sp-file --verbose-parsing  ... \
      scripts/coccinelle/remove_local_err.cocci
  ...
  SUSPICIOUS: a \ character appears outside of a #define at ./target/ppc/translate_init.inc.c:5213
  SUSPICIOUS: a \ character appears outside of a #define at ./target/ppc/translate_init.inc.c:5261
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:166
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:167
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:169
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:170
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:171
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:172
  SUSPICIOUS: a \ character appears outside of a #define at ./target/microblaze/cpu.c:173
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5787
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5789
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5800
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5801
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5802
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5804
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5805
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:5806
  SUSPICIOUS: a \ character appears outside of a #define at ./target/i386/cpu.c:6329
  SUSPICIOUS: a \ character appears outside of a #define at ./hw/sd/sdhci.c:1133
  SUSPICIOUS: a \ character appears outside of a #define at ./hw/scsi/scsi-disk.c:3081
  SUSPICIOUS: a \ character appears outside of a #define at ./hw/net/virtio-net.c:1529
  SUSPICIOUS: a \ character appears outside of a #define at ./hw/riscv/sifive_u.c:468
  SUSPICIOUS: a \ character appears outside of a #define at ./dump/dump.c:1895
  SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2209
  SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2215
  SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2221
  SUSPICIOUS: a \ character appears outside of a #define at ./block/vhdx.c:2222
  SUSPICIOUS: a \ character appears outside of a #define at ./block/replication.c:172
  SUSPICIOUS: a \ character appears outside of a #define at ./block/replication.c:173
Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200412223619.11284-2-f4bug@amsat.org>
Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 fdd76fec
...@@ -172,8 +172,8 @@ static void replication_child_perm(BlockDriverState *bs, BdrvChild *c, ...@@ -172,8 +172,8 @@ static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
if ((bs->open_flags & (BDRV_O_INACTIVE | BDRV_O_RDWR)) == BDRV_O_RDWR) { if ((bs->open_flags & (BDRV_O_INACTIVE | BDRV_O_RDWR)) == BDRV_O_RDWR) {
*nperm |= BLK_PERM_WRITE; *nperm |= BLK_PERM_WRITE;
} }
*nshared = BLK_PERM_CONSISTENT_READ \ *nshared = BLK_PERM_CONSISTENT_READ
| BLK_PERM_WRITE \ | BLK_PERM_WRITE
| BLK_PERM_WRITE_UNCHANGED; | BLK_PERM_WRITE_UNCHANGED;
return; return;
} }
......
...@@ -2206,20 +2206,20 @@ static QemuOptsList vhdx_create_opts = { ...@@ -2206,20 +2206,20 @@ static QemuOptsList vhdx_create_opts = {
.name = VHDX_BLOCK_OPT_BLOCK_SIZE, .name = VHDX_BLOCK_OPT_BLOCK_SIZE,
.type = QEMU_OPT_SIZE, .type = QEMU_OPT_SIZE,
.def_value_str = stringify(0), .def_value_str = stringify(0),
.help = "Block Size; min 1MB, max 256MB. " \ .help = "Block Size; min 1MB, max 256MB. "
"0 means auto-calculate based on image size." "0 means auto-calculate based on image size."
}, },
{ {
.name = BLOCK_OPT_SUBFMT, .name = BLOCK_OPT_SUBFMT,
.type = QEMU_OPT_STRING, .type = QEMU_OPT_STRING,
.help = "VHDX format type, can be either 'dynamic' or 'fixed'. "\ .help = "VHDX format type, can be either 'dynamic' or 'fixed'. "
"Default is 'dynamic'." "Default is 'dynamic'."
}, },
{ {
.name = VHDX_BLOCK_OPT_ZERO, .name = VHDX_BLOCK_OPT_ZERO,
.type = QEMU_OPT_BOOL, .type = QEMU_OPT_BOOL,
.help = "Force use of payload blocks of type 'ZERO'. "\ .help = "Force use of payload blocks of type 'ZERO'. "
"Non-standard, but default. Do not set to 'off' when "\ "Non-standard, but default. Do not set to 'off' when "
"using 'qemu-img convert' with subformat=dynamic." "using 'qemu-img convert' with subformat=dynamic."
}, },
{ NULL } { NULL }
......
...@@ -1892,7 +1892,7 @@ static void dump_process(DumpState *s, Error **errp) ...@@ -1892,7 +1892,7 @@ static void dump_process(DumpState *s, Error **errp)
result = qmp_query_dump(NULL); result = qmp_query_dump(NULL);
/* should never fail */ /* should never fail */
assert(result); assert(result);
qapi_event_send_dump_completed(result, !!local_err, (local_err ? \ qapi_event_send_dump_completed(result, !!local_err, (local_err ?
error_get_pretty(local_err) : NULL)); error_get_pretty(local_err) : NULL));
qapi_free_DumpQueryResult(result); qapi_free_DumpQueryResult(result);
......
...@@ -1526,7 +1526,7 @@ static void virtio_net_rsc_extract_unit6(VirtioNetRscChain *chain, ...@@ -1526,7 +1526,7 @@ static void virtio_net_rsc_extract_unit6(VirtioNetRscChain *chain,
+ sizeof(struct eth_header)); + sizeof(struct eth_header));
unit->ip = ip6; unit->ip = ip6;
unit->ip_plen = &(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen); unit->ip_plen = &(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen);
unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)\ unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)
+ sizeof(struct ip6_header)); + sizeof(struct ip6_header));
unit->tcp_hdrlen = (htons(unit->tcp->th_offset_flags) & 0xF000) >> 10; unit->tcp_hdrlen = (htons(unit->tcp->th_offset_flags) & 0xF000) >> 10;
......
...@@ -465,7 +465,7 @@ static void riscv_sifive_u_machine_instance_init(Object *obj) ...@@ -465,7 +465,7 @@ static void riscv_sifive_u_machine_instance_init(Object *obj)
object_property_add_bool(obj, "start-in-flash", sifive_u_get_start_in_flash, object_property_add_bool(obj, "start-in-flash", sifive_u_get_start_in_flash,
sifive_u_set_start_in_flash, NULL); sifive_u_set_start_in_flash, NULL);
object_property_set_description(obj, "start-in-flash", object_property_set_description(obj, "start-in-flash",
"Set on to tell QEMU's ROM to jump to " \ "Set on to tell QEMU's ROM to jump to "
"flash. Otherwise QEMU will jump to DRAM", "flash. Otherwise QEMU will jump to DRAM",
NULL); NULL);
} }
......
...@@ -3078,7 +3078,7 @@ static const TypeInfo scsi_cd_info = { ...@@ -3078,7 +3078,7 @@ static const TypeInfo scsi_cd_info = {
#ifdef __linux__ #ifdef __linux__
static Property scsi_block_properties[] = { static Property scsi_block_properties[] = {
DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf), \ DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),
DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk), DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false), DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0), DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
......
...@@ -1130,7 +1130,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) ...@@ -1130,7 +1130,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
/* Limit block size to the maximum buffer size */ /* Limit block size to the maximum buffer size */
if (extract32(s->blksize, 0, 12) > s->buf_maxsz) { if (extract32(s->blksize, 0, 12) > s->buf_maxsz) {
qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than " \ qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than "
"the maximum buffer 0x%x", __func__, s->blksize, "the maximum buffer 0x%x", __func__, s->blksize,
s->buf_maxsz); s->buf_maxsz);
......
...@@ -5784,9 +5784,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, ...@@ -5784,9 +5784,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
host_cpuid(index, 0, eax, ebx, ecx, edx); host_cpuid(index, 0, eax, ebx, ecx, edx);
break; break;
} }
*eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) | \ *eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) |
(L1_ITLB_2M_ASSOC << 8) | (L1_ITLB_2M_ENTRIES); (L1_ITLB_2M_ASSOC << 8) | (L1_ITLB_2M_ENTRIES);
*ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) | \ *ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) |
(L1_ITLB_4K_ASSOC << 8) | (L1_ITLB_4K_ENTRIES); (L1_ITLB_4K_ASSOC << 8) | (L1_ITLB_4K_ENTRIES);
*ecx = encode_cache_cpuid80000005(env->cache_info_amd.l1d_cache); *ecx = encode_cache_cpuid80000005(env->cache_info_amd.l1d_cache);
*edx = encode_cache_cpuid80000005(env->cache_info_amd.l1i_cache); *edx = encode_cache_cpuid80000005(env->cache_info_amd.l1i_cache);
...@@ -5797,13 +5797,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, ...@@ -5797,13 +5797,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
host_cpuid(index, 0, eax, ebx, ecx, edx); host_cpuid(index, 0, eax, ebx, ecx, edx);
break; break;
} }
*eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) | \ *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) |
(L2_DTLB_2M_ENTRIES << 16) | \ (L2_DTLB_2M_ENTRIES << 16) |
(AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) | \ (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) |
(L2_ITLB_2M_ENTRIES); (L2_ITLB_2M_ENTRIES);
*ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) | \ *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) |
(L2_DTLB_4K_ENTRIES << 16) | \ (L2_DTLB_4K_ENTRIES << 16) |
(AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) | \ (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) |
(L2_ITLB_4K_ENTRIES); (L2_ITLB_4K_ENTRIES);
encode_cache_cpuid80000006(env->cache_info_amd.l2_cache, encode_cache_cpuid80000006(env->cache_info_amd.l2_cache,
cpu->enable_l3_cache ? cpu->enable_l3_cache ?
...@@ -6326,7 +6326,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp) ...@@ -6326,7 +6326,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
*/ */
env->features[w] |= env->features[w] |=
x86_cpu_get_supported_feature_word(w, cpu->migratable) & x86_cpu_get_supported_feature_word(w, cpu->migratable) &
~env->user_features[w] & \ ~env->user_features[w] &
~feature_word_info[w].no_autoenable_flags; ~feature_word_info[w].no_autoenable_flags;
} }
} }
......
...@@ -163,14 +163,14 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) ...@@ -163,14 +163,14 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
qemu_init_vcpu(cs); qemu_init_vcpu(cs);
env->pvr.regs[0] = PVR0_USE_EXC_MASK \ env->pvr.regs[0] = PVR0_USE_EXC_MASK
| PVR0_USE_ICACHE_MASK \ | PVR0_USE_ICACHE_MASK
| PVR0_USE_DCACHE_MASK; | PVR0_USE_DCACHE_MASK;
env->pvr.regs[2] = PVR2_D_OPB_MASK \ env->pvr.regs[2] = PVR2_D_OPB_MASK
| PVR2_D_LMB_MASK \ | PVR2_D_LMB_MASK
| PVR2_I_OPB_MASK \ | PVR2_I_OPB_MASK
| PVR2_I_LMB_MASK \ | PVR2_I_LMB_MASK
| PVR2_FPU_EXC_MASK \ | PVR2_FPU_EXC_MASK
| 0; | 0;
version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION; version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION;
......
...@@ -5210,7 +5210,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data) ...@@ -5210,7 +5210,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data)
PPC_FLOAT_STFIWX | PPC_WAIT | PPC_FLOAT_STFIWX | PPC_WAIT |
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC | PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
PPC_64B | PPC_POPCNTB | PPC_POPCNTWD; PPC_64B | PPC_POPCNTB | PPC_POPCNTWD;
pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \ pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
PPC2_FP_CVT_S64; PPC2_FP_CVT_S64;
pcc->msr_mask = (1ull << MSR_CM) | pcc->msr_mask = (1ull << MSR_CM) |
(1ull << MSR_GS) | (1ull << MSR_GS) |
...@@ -5258,7 +5258,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, void *data) ...@@ -5258,7 +5258,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, void *data)
PPC_FLOAT_STFIWX | PPC_WAIT | PPC_FLOAT_STFIWX | PPC_WAIT |
PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC | PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
PPC_64B | PPC_POPCNTB | PPC_POPCNTWD | PPC_ALTIVEC; PPC_64B | PPC_POPCNTB | PPC_POPCNTWD | PPC_ALTIVEC;
pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \ pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
PPC2_FP_CVT_S64 | PPC2_ATOMIC_ISA206; PPC2_FP_CVT_S64 | PPC2_ATOMIC_ISA206;
pcc->msr_mask = (1ull << MSR_CM) | pcc->msr_mask = (1ull << MSR_CM) |
(1ull << MSR_GS) | (1ull << MSR_GS) |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册