Possible bug in linux-6.2/tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_marked_sample_test.c

2023-02-24 Thread David Binderman
uch doubt an expression like "sample & 0x3" will work correctly. Same thing on the line above FAIL_IF(EV_CODE_EXTRACT(event.attr.config, sample >> 2) != get_mmcra_rand_samp_elig(get_reg_value(intr_regs, "MMCRA"), 4)); "sample >> 2" doesn't look like a valid token to me. Regards David Binderman

linux-4.16-rc1/drivers/misc/ocxl/file.c:320:broken error checking ?

2018-02-12 Thread David Binderman
ion into signed variable, sanity check it, then assign it to an unsigned variable. Also, use of the gcc compiler flag -Wtype-limits will show up this kind of problem in future. Regards David Binderman

linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599: pointless test ?

2017-10-06 Thread David Binderman
Hello there, linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599]: (style) Unsigned variable 'ncpu' can't be negative so it is unnecessary to test it. Source code is if (ncpu >= 0 && ncpu < nr_cpu_ids) { but unsigned int ncpu, core_id; Suggest remove test. Regards David Binderman

linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:541: bad condition ?

2017-09-18 Thread David Binderman
Hello there, linux-4.14-rc1/arch/powerpc/perf/hv-24x7.c:543]: (warning) Identical condition 's1<s2', second condition is always false Source code is if (s1 < s2) return 1; if (s2 > s1) return -1; Suggest code rework. Regards David Binderman

Re: arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ?

2016-06-28 Thread David Binderman
int? I don't know the code, but given that insn is unsigned long and so can go past 32 bits, using a cast to unsigned int might throw away the possibly important upper bits. Regards David Binderman ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ?

2016-06-27 Thread David Binderman
is 'unsigned long'. Source code is static inline int print_insn_powerpc(unsigned long insn, unsigned long memaddr) { printf("%.8x", insn); return 0; } static inline int print_insn_spu(unsigned long insn, unsigned long memaddr) { printf("%.8x", insn); return

arch/powerpc/platforms/512x/clock-commonclk.c:824: wrong % specifier ?

2016-06-27 Thread David Binderman
Hello there, linux-4.7-rc5/arch/powerpc/platforms/512x/clock-commonclk.c:824]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'size_t {aka unsigned long}'. Source code is snprintf(name, sizeof(name), "psc%d", mclk_idx); Regards David

RE: linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?

2016-02-16 Thread David Binderman
ch, it looks ok to me. Regards David Binderman ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?

2016-02-16 Thread David Binderman
gest new code     emac = finddevice("/plb/opb/ethernet");     if (emac != 0) { Regards David Binderman ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

arch/powerpc/kernel/cacheinfo.c: Possible null pointer dereference

2011-02-12 Thread David Binderman
-level != level, cache level mismatch on lookup (got %d, expected %d)\n, cache-level, level); if (!cache) I agree with cppcheck. Suggest code rework. Regards David Binderman ___ Linuxppc