[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Fix rounding errors and use scaling in i915.

Patchwork patchwork at emeril.freedesktop.org
Mon Apr 30 14:16:42 UTC 2018


== Series Details ==

Series: drm: Fix rounding errors and use scaling in i915.
URL   : https://patchwork.freedesktop.org/series/42476/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
febeff5693c0 drm/rect: Round above 1 << 16 upwards to correct scale calculation functions.
-:25: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#25: FILE: drivers/gpu/drm/drm_rect.c:111:
+		return DIV_ROUND_UP(src, dst);
+	else

total: 0 errors, 1 warnings, 0 checks, 47 lines checked
339983c9bb65 drm/rect: Handle rounding errors in drm_rect_clip_scaled, v2.
-:37: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#37: FILE: drivers/gpu/drm/drm_rect.c:65:
+		return DIV_ROUND_UP(src, dst);
+	else

-:56: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'oldscale' - possible side-effects?
#56: FILE: drivers/gpu/drm/drm_rect.c:98:
+#define FIXUP(oldscale, fn, m, second) do { \
+	if (oldscale != 1 << 16) { \
+		int newscale = drm_calc_scale(fn(src), fn(dst)); \
+ \
+		if (newscale < 0) \
+			return false; \
+ \
+		if ((oldscale < 0x10000) != (newscale < 0x10000)) { \
+			if (!second) \
+				src->m##1 = src->m##2 - (fn(dst) << 16); \
+			else \
+				src->m##2 = src->m##1 + (fn(dst) << 16); \
+		} \
+	} \
+ } while (0)

-:56: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fn' - possible side-effects?
#56: FILE: drivers/gpu/drm/drm_rect.c:98:
+#define FIXUP(oldscale, fn, m, second) do { \
+	if (oldscale != 1 << 16) { \
+		int newscale = drm_calc_scale(fn(src), fn(dst)); \
+ \
+		if (newscale < 0) \
+			return false; \
+ \
+		if ((oldscale < 0x10000) != (newscale < 0x10000)) { \
+			if (!second) \
+				src->m##1 = src->m##2 - (fn(dst) << 16); \
+			else \
+				src->m##2 = src->m##1 + (fn(dst) << 16); \
+		} \
+	} \
+ } while (0)

-:59: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#59: FILE: drivers/gpu/drm/drm_rect.c:101:
+ \$

-:62: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#62: FILE: drivers/gpu/drm/drm_rect.c:104:
+ \$

-:63: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'oldscale < 0x10000'
#63: FILE: drivers/gpu/drm/drm_rect.c:105:
+		if ((oldscale < 0x10000) != (newscale < 0x10000)) { \

-:63: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'newscale < 0x10000'
#63: FILE: drivers/gpu/drm/drm_rect.c:105:
+		if ((oldscale < 0x10000) != (newscale < 0x10000)) { \

-:70: WARNING:LEADING_SPACE: please, no spaces at the start of a line
#70: FILE: drivers/gpu/drm/drm_rect.c:112:
+ } while (0)$

total: 0 errors, 4 warnings, 4 checks, 107 lines checked
035d2ea322b2 drm/i915: Do not adjust scale when out of bounds, v2.
-:180: CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
#180: FILE: drivers/gpu/drm/i915/intel_sprite.c:1030:
+			if (INTEL_GEN(dev_priv) < 9 && (

total: 0 errors, 0 warnings, 1 checks, 179 lines checked
882b62db73fa drm/selftests: Rename the Kconfig option to CONFIG_DRM_DEBUG_SELFTEST
59b43359b5d7 drm/selftests: Add drm helper selftest
-:28: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#28: 
new file mode 100644

-:48: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#48: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:1:
+/*

-:63: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#63: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:16:
+#define FAIL(test, msg, ...) \
+	do { \
+		if (test) { \
+			pr_err("%s/%u: " msg, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+			return -EINVAL; \
+		} \
+	} while (0)

-:66: WARNING:USE_FUNC: __func__ should be used instead of gcc specific __FUNCTION__
#66: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:19:
+			pr_err("%s/%u: " msg, __FUNCTION__, __LINE__, ##__VA_ARGS__); \

-:71: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#71: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:24:
+#define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n")

-:74: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#74: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:27:
+		    unsigned src_x, unsigned src_y,

-:74: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#74: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:27:
+		    unsigned src_x, unsigned src_y,

-:75: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#75: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:28:
+		    unsigned src_w, unsigned src_h)

-:75: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#75: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:28:
+		    unsigned src_w, unsigned src_h)

-:84: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#84: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:37:
+			 unsigned src_x, unsigned src_y,

-:84: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#84: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:37:
+			 unsigned src_x, unsigned src_y,

-:85: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#85: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:38:
+			 unsigned src_w, unsigned src_h)

-:85: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#85: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:38:
+			 unsigned src_w, unsigned src_h)

-:111: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#111: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:64:
+		     unsigned crtc_w, unsigned crtc_h)

-:111: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#111: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:64:
+		     unsigned crtc_w, unsigned crtc_h)

-:121: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#121: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:74:
+			  unsigned crtc_w, unsigned crtc_h)

-:121: WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#121: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:74:
+			  unsigned crtc_w, unsigned crtc_h)

-:145: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#145: FILE: drivers/gpu/drm/selftests/test-drm-helper.c:98:
+			DRM_MODE("1024x768", 0, 65000, 1024, 1048,
+				1184, 1344, 0, 768, 771, 777, 806, 0,

total: 0 errors, 16 warnings, 2 checks, 265 lines checked



More information about the Intel-gfx mailing list