From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 17 Sep 2013 18:20:04 +0200 (CEST) Received: from localhost.localdomain ([127.0.0.1]:47016 "EHLO linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP id S6824764Ab3IQQT6SlGsw (ORCPT ); Tue, 17 Sep 2013 18:19:58 +0200 Received: from scotty.linux-mips.net (localhost.localdomain [127.0.0.1]) by scotty.linux-mips.net (8.14.7/8.14.4) with ESMTP id r8HGJvsQ001654; Tue, 17 Sep 2013 18:19:57 +0200 Received: (from ralf@localhost) by scotty.linux-mips.net (8.14.7/8.14.7/Submit) id r8HGJvvV001653; Tue, 17 Sep 2013 18:19:57 +0200 Date: Tue, 17 Sep 2013 18:19:57 +0200 From: Ralf Baechle To: "Maciej W. Rozycki" Cc: linux-mips@linux-mips.org Subject: Re: [MIPS] CP0 PRId and CP1 FPIR register access masks Message-ID: <20130917161957.GH22468@linux-mips.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 37836 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: ralf@linux-mips.org Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On Tue, Sep 17, 2013 at 04:58:10PM +0100, Maciej W. Rozycki wrote: > Replace hardcoded CP0 PRId and CP1 FPIR register access masks throughout. > The change does not touch places that use shifted or partial masks. > > Signed-off-by: Maciej W. Rozycki > --- > Ralf, > > Please apply. I think the places ignored by this change should be > further reviewed, especially the shifted masks that can likely remove the > shifts and rely on compiler optimisation instead. I decided to make this > change as straightforward as possible to avoid accidental breakage in code > I have no way to test. Also partial masks are probably better handled > with macros rather than hardcoded constants scattered throughout. I can > see steps have been taken towards this already (PRID_REV_ENCODE_*). Looks ok, queud for 3.13. But while it's cleaner, I think the idiom read_c0_prid() & some_MASK is so common that maybe something like #define read_c0_prid_imp() (read_c0_prid() & PRID_IMP_MASK) #define read_c0_prid_rev() (read_c0_prid() & PRID_REV_MASK) #define read_c0_prid_comp() (read_c0_prid() & PRID_COMP_MASK) should be introduced as a next step. Ralf