From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Subject: Re: [RFC 2/3] drm/i915: Prefer IS_GEN check with bitmask. Date: Fri, 26 Oct 2018 21:47:05 +0200 (CEST) Message-ID: References: <20181023233620.10159-1-rodrigo.vivi@intel.com> <20181023233620.10159-2-rodrigo.vivi@intel.com> <20181024102257.GZ9144@intel.com> <20181024234106.GK3942@intel.com> <20181025105903.GI9144@intel.com> <20181026194055.GI2232@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1262453425-1540583226=:2791" Return-path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43F606E542 for ; Fri, 26 Oct 2018 19:47:08 +0000 (UTC) In-Reply-To: <20181026194055.GI2232@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1262453425-1540583226=:2791 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT On Fri, 26 Oct 2018, Rodrigo Vivi wrote: > On Thu, Oct 25, 2018 at 12:11:57PM +0100, Julia Lawall wrote: > > > > > > On Thu, 25 Oct 2018, Ville Syrjälä wrote: > > > > > On Wed, Oct 24, 2018 at 04:41:06PM -0700, Rodrigo Vivi wrote: > > > > On Wed, Oct 24, 2018 at 01:22:57PM +0300, Ville Syrjälä wrote: > > > > > On Tue, Oct 23, 2018 at 04:36:19PM -0700, Rodrigo Vivi wrote: > > > > > > Whenever possible we should stick with IS_GEN checks. > > > > > > > > > > > > Bitmaks has been introduced on commit ae7617f0ef18 ("drm/i915: > > > > > > Allow optimized platform checks") for efficiency. > > > > > > > > > > > > Let's stick with it whenever possible. > > > > > > > > > > > > This patch was generated with coccinelle: > > > > > > > > > > > > spatch -sp_file is_gen.cocci *{c,h} --in-place > > > > > > > > > > > > is_gen.cocci: > > > > > > @gen2@ expression e; @@ > > > > > > -INTEL_GEN(e) == 2 > > > > > > +IS_GEN2(e) > > > > > > @gen3@ expression e; @@ > > > > > > -INTEL_GEN(e) == 3 > > > > > > +IS_GEN3(e) > > > > > > @gen4@ expression e; @@ > > > > > > -INTEL_GEN(e) == 4 > > > > > > +IS_GEN4(e) > > > > > > @gen5@ expression e; @@ > > > > > > -INTEL_GEN(e) == 5 > > > > > > +IS_GEN5(e) > > > > > > @gen6@ expression e; @@ > > > > > > -INTEL_GEN(e) == 6 > > > > > > +IS_GEN6(e) > > > > > > @gen7@ expression e; @@ > > > > > > -INTEL_GEN(e) == 7 > > > > > > +IS_GEN7(e) > > > > > > @gen8@ expression e; @@ > > > > > > -INTEL_GEN(e) == 8 > > > > > > +IS_GEN8(e) > > > > > > @gen9@ expression e; @@ > > > > > > -INTEL_GEN(e) == 9 > > > > > > +IS_GEN9(e) > > > > > > @gen10@ expression e; @@ > > > > > > -INTEL_GEN(e) == 10 > > > > > > +IS_GEN10(e) > > > > > > @gen11@ expression e; @@ > > > > > > -INTEL_GEN(e) == 11 > > > > > > +IS_GEN11(e) > > > > > > > > > > Slightly less repetitive version. > > > > > > > > Thanks. I'm supper newbie on coccinelle and it was > > > > easier to duplicate then trying to learn all this new lang. > > > > > > > > But I really appreciate you sharing this. I'd like > > > > to go with this so the better rule keeps on commit message. > > > > > > > > > Sadly not super neat on > > > > > account of having to use the python stuff. > > > > > > > > however it seems python version didn't work so well here: > > > > > > > > init_defs_builtins: /usr/lib64/coccinelle/standard.h > > > > Python error: No module named coccilib.elems > > > > > > > > do you have any idea about it? > > > > > > Never seen it. On gentoo it just works when I have the python > > > use flag enabled. > > > > > > Maybe your distro doesn't include the python support in the > > > build, or maybe some kind of python version issue? > > > > Thanks for the report. I will have someone look into it. It's an > > internal Coccinelle thing. Perhaps python is not enabled. Do you have > > the version of Coccinelle from github? > > I just tried with coccinelle from github but got same result. > > But with this commit before the bump to automake1.16: > > commit 4db95998768557c66d6e337be2253032b5d810bc (HEAD -> master) > Author: Thierry Martinez > Date: Wed Sep 12 14:43:41 2018 +0200 > > Compute depend by calling make recursilevy > > The set of files in $(source_files) may change when the tarball is > unpacked. > > ---- > > $ python --version > Python 2.7.15 > $ python3 --version > Python 3.6.6 > > ---- > > I believe I'm moving this patch with the repetitive bad > rule for now that I'm sure it works in most of the distros. Sorry, I'm not sure to understand the last sentence. Are things ok now, or not? thanks, julia --8323329-1262453425-1540583226=:2791 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --8323329-1262453425-1540583226=:2791--