Thread (12 messages) flat view 12 messages, 4 authors, 2016-02-14

[PATCH] [media] zl10353: use div_u64 instead of do_div

From: Nicolas Pitre <hidden>
Date: 2016-02-12 21:38:58
Also in: linux-media, lkml

On Fri, 12 Feb 2016, Arnd Bergmann wrote:
On Friday 12 February 2016 13:21:33 Nicolas Pitre wrote:
quoted
This is all related to the gcc bug for which I produced a test case 
here:

http://article.gmane.org/gmane.linux.kernel.cross-arch/29801

Do you know if this is fixed in recent gcc?
I have a fairly recent gcc, but I also never got around to submit
it properly.

However, I did stumble over an older patch I did now, which I could
not remember what it was good for. It does fix the problem, and
it seems to be a better solution.
WTF?

Hmmm... it apparently doesn't fix it if I apply this change to the gcc 
test case.

quoted hunk ↗ jump to hunk
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index b5acbb404854..b5ff9881bef8 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -148,7 +148,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
  */
 #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
 #define __trace_if(cond) \
-	if (__builtin_constant_p((cond)) ? !!(cond) :			\
+	if (__builtin_constant_p(!!(cond)) ? !!(cond) :			\
 	({								\
 		int ______r;						\
 		static struct ftrace_branch_data			\
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help