[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.1 v3 01/24] various: Remove suspicious '\' character ou
From: |
David Gibson |
Subject: |
Re: [PATCH-for-5.1 v3 01/24] various: Remove suspicious '\' character outside of #define in C code |
Date: |
Tue, 14 Apr 2020 12:08:30 +1000 |
On Mon, Apr 13, 2020 at 12:35:56AM +0200, Philippe Mathieu-Daudé wrote:
> 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: Marc-André Lureau <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
ppc parts
Acked-by: David Gibson <address@hidden>
> ---
> block/replication.c | 4 ++--
> block/vhdx.c | 8 ++++----
> dump/dump.c | 2 +-
> hw/net/virtio-net.c | 2 +-
> hw/riscv/sifive_u.c | 2 +-
> hw/scsi/scsi-disk.c | 2 +-
> hw/sd/sdhci.c | 2 +-
> target/i386/cpu.c | 18 +++++++++---------
> target/microblaze/cpu.c | 14 +++++++-------
> target/ppc/translate_init.inc.c | 4 ++--
> 10 files changed, 29 insertions(+), 29 deletions(-)
>
> diff --git a/block/replication.c b/block/replication.c
> index da013c2041..971f0fe266 100644
> --- a/block/replication.c
> +++ b/block/replication.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) {
> *nperm |= BLK_PERM_WRITE;
> }
> - *nshared = BLK_PERM_CONSISTENT_READ \
> - | BLK_PERM_WRITE \
> + *nshared = BLK_PERM_CONSISTENT_READ
> + | BLK_PERM_WRITE
> | BLK_PERM_WRITE_UNCHANGED;
> return;
> }
> diff --git a/block/vhdx.c b/block/vhdx.c
> index 33e57cd656..e16fdc2f2d 100644
> --- a/block/vhdx.c
> +++ b/block/vhdx.c
> @@ -2206,20 +2206,20 @@ static QemuOptsList vhdx_create_opts = {
> .name = VHDX_BLOCK_OPT_BLOCK_SIZE,
> .type = QEMU_OPT_SIZE,
> .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."
> },
> {
> .name = BLOCK_OPT_SUBFMT,
> .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'."
> },
> {
> .name = VHDX_BLOCK_OPT_ZERO,
> .type = QEMU_OPT_BOOL,
> - .help = "Force use of payload blocks of type 'ZERO'. "\
> - "Non-standard, but default. Do not set to 'off' when "\
> + .help = "Force use of payload blocks of type 'ZERO'. "
> + "Non-standard, but default. Do not set to 'off' when "
> "using 'qemu-img convert' with subformat=dynamic."
> },
> { NULL }
> diff --git a/dump/dump.c b/dump/dump.c
> index 22ed1d3b0d..248ea06370 100644
> --- a/dump/dump.c
> +++ b/dump/dump.c
> @@ -1892,7 +1892,7 @@ static void dump_process(DumpState *s, Error **errp)
> result = qmp_query_dump(NULL);
> /* should never fail */
> 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));
> qapi_free_DumpQueryResult(result);
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index a46e3b37a7..eddfa7f923 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1526,7 +1526,7 @@ static void
> virtio_net_rsc_extract_unit6(VirtioNetRscChain *chain,
> + sizeof(struct eth_header));
> unit->ip = ip6;
> 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));
> unit->tcp_hdrlen = (htons(unit->tcp->th_offset_flags) & 0xF000) >> 10;
>
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index 56351c4faa..998666c91f 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -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,
> sifive_u_set_start_in_flash, NULL);
> 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",
> NULL);
> }
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 1c0cb63a6f..e5bcd0baf8 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -3078,7 +3078,7 @@ static const TypeInfo scsi_cd_info = {
>
> #ifdef __linux__
> 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_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
> DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index de63ffb037..70531ad360 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1130,7 +1130,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val,
> unsigned size)
>
> /* Limit block size to the maximum buffer size */
> 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,
> s->buf_maxsz);
>
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 90ffc5f3b1..9c256ab159 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -5784,9 +5784,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
> uint32_t count,
> host_cpuid(index, 0, eax, ebx, ecx, edx);
> 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);
> - *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);
> *ecx = encode_cache_cpuid80000005(env->cache_info_amd.l1d_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,
> host_cpuid(index, 0, eax, ebx, ecx, edx);
> break;
> }
> - *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) | \
> - (L2_DTLB_2M_ENTRIES << 16) | \
> - (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) | \
> + *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) |
> + (L2_DTLB_2M_ENTRIES << 16) |
> + (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) |
> (L2_ITLB_2M_ENTRIES);
> - *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) | \
> - (L2_DTLB_4K_ENTRIES << 16) | \
> - (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) | \
> + *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) |
> + (L2_DTLB_4K_ENTRIES << 16) |
> + (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) |
> (L2_ITLB_4K_ENTRIES);
> encode_cache_cpuid80000006(env->cache_info_amd.l2_cache,
> cpu->enable_l3_cache ?
> @@ -6326,7 +6326,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error
> **errp)
> */
> env->features[w] |=
> x86_cpu_get_supported_feature_word(w, cpu->migratable) &
> - ~env->user_features[w] & \
> + ~env->user_features[w] &
> ~feature_word_info[w].no_autoenable_flags;
> }
> }
> diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
> index a2c2f271df..c9cf2364ca 100644
> --- a/target/microblaze/cpu.c
> +++ b/target/microblaze/cpu.c
> @@ -163,14 +163,14 @@ static void mb_cpu_realizefn(DeviceState *dev, Error
> **errp)
>
> qemu_init_vcpu(cs);
>
> - env->pvr.regs[0] = PVR0_USE_EXC_MASK \
> - | PVR0_USE_ICACHE_MASK \
> + env->pvr.regs[0] = PVR0_USE_EXC_MASK
> + | PVR0_USE_ICACHE_MASK
> | PVR0_USE_DCACHE_MASK;
> - env->pvr.regs[2] = PVR2_D_OPB_MASK \
> - | PVR2_D_LMB_MASK \
> - | PVR2_I_OPB_MASK \
> - | PVR2_I_LMB_MASK \
> - | PVR2_FPU_EXC_MASK \
> + env->pvr.regs[2] = PVR2_D_OPB_MASK
> + | PVR2_D_LMB_MASK
> + | PVR2_I_OPB_MASK
> + | PVR2_I_LMB_MASK
> + | PVR2_FPU_EXC_MASK
> | 0;
>
> version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION;
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index e853164a86..fd763e588e 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -5210,7 +5210,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data)
> PPC_FLOAT_STFIWX | PPC_WAIT |
> PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
> 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;
> pcc->msr_mask = (1ull << MSR_CM) |
> (1ull << MSR_GS) |
> @@ -5258,7 +5258,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, void *data)
> PPC_FLOAT_STFIWX | PPC_WAIT |
> PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
> 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;
> pcc->msr_mask = (1ull << MSR_CM) |
> (1ull << MSR_GS) |
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
[PATCH-for-5.1 v3 01/24] various: Remove suspicious '\' character outside of #define in C code, Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 03/24] hw/arm/allwinner-a10: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 04/24] hw/arm/aspeed_ast2600: Simplify use of Error*, Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 05/24] hw/arm/aspeed_ast2600: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 06/24] hw/arm/aspeed_soc: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 07/24] hw/arm/aspeed_soc: Simplify use of Error*, Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 08/24] hw/arm/fsl-imx6: Simplify checks on 'smp_cpus' count, Philippe Mathieu-Daudé, 2020/04/12
[PATCH-for-5.1 v3 09/24] hw/arm/fsl-imx6: Move some code from realize() to init(), Philippe Mathieu-Daudé, 2020/04/12