[Intel-gfx] linux-4.15-rc1/drivers/gpu/drm/i915/gvt/cmd_parser.c:1640: poor error checking ?
Hello there, linux-4.15-rc1/drivers/gpu/drm/i915/gvt/cmd_parser.c:1640]: (style) Checking if unsigned variable 'bb_size' is less than zero. Source code is /* get the size of the batch buffer */ bb_size = find_bb_size(s); if (bb_size < 0) return -EINVAL; but static int find_bb_size(struct parser_exec_state *s) so the code isn't properly checking the return value. Suggest code rework. Regards David Binderman ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] drivers/gpu/drm/i915/intel_pm.c:4467: bad comparison ?
Hello there, drivers/gpu/drm/i915/intel_pm.c:4467]: (warning) Comparison of a boolean expression with an integer other than 0 or 1. Source code is else if ((ddb_allocation && ddb_allocation / fixed_16_16_to_u32_round_up(plane_blocks_per_line)) >= 1) Regards David Binderman ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] include/drm/i915_drm.h:96: possible bad bitmask ?
Hello there, Recent versions of gcc say this: include/drm/i915_drm.h:96:34: warning: result of ‘65535 << 20’ requires 37 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=] Source code is #define INTEL_BSM_MASK (0x << 20) Maybe something like #define INTEL_BSM_MASK (0xUL<< 20) might be better. Regards David Binderman ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] drivers/gpu/drm/i915/i915_reg.h:90:shift-overflow problem ?
Hello there, drivers/gpu/drm/i915/i915_reg.h:90:28: warning: result of ‘65535 << 20’ requires 37 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=] Source code is #define BSM_MASK (0x << 20) Maybe better code #define BSM_MASK (((unsigned long) 0x) << 20) Regards David Binderman ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] linux-4.2-rc1/drivers/gpu/drm/i915/intel_csr.c:353: bad if statement ?
Hello there, [linux-4.2-rc1/drivers/gpu/drm/i915/intel_csr.c:353]: (warning) Logical conjunction always evaluates to false: EXPR < 524288 && EXPR> 589823. Source code is if (dmc_header->mmioaddr[i] < CSR_MMIO_START_RANGE && dmc_header->mmioaddr[i]> CSR_MMIO_END_RANGE) { Maybe better code if (dmc_header->mmioaddr[i] < CSR_MMIO_START_RANGE || dmc_header->mmioaddr[i]> CSR_MMIO_END_RANGE) { Regards David Binderman ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx