From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497AbcBLVi6 (ORCPT ); Fri, 12 Feb 2016 16:38:58 -0500 Received: from mail-qg0-f47.google.com ([209.85.192.47]:35471 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbcBLVi4 (ORCPT ); Fri, 12 Feb 2016 16:38:56 -0500 Date: Fri, 12 Feb 2016 16:38:53 -0500 (EST) From: Nicolas Pitre To: Arnd Bergmann cc: Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Stefan Richter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [media] zl10353: use div_u64 instead of do_div In-Reply-To: <6737272.LXr2g355Yt@wuerfel> Message-ID: References: <1455287246-3540549-1-git-send-email-arnd@arndb.de> <2712691.b9gkR7KMX7@wuerfel> <6737272.LXr2g355Yt@wuerfel> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Feb 2016, Arnd Bergmann wrote: > On Friday 12 February 2016 13:21:33 Nicolas Pitre wrote: > > 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. > 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 \ > >