From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751225AbdJDXZ5 (ORCPT ); Wed, 4 Oct 2017 19:25:57 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:49443 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdJDXZz (ORCPT ); Wed, 4 Oct 2017 19:25:55 -0400 X-Google-Smtp-Source: AOwi7QBRzPS6tNWAW42oe/1VFzZpPK63RPRN0vqjKw3v9aL/94yqmwtCnKUcKYJzB4slM6Hz//Gl2w== Date: Wed, 4 Oct 2017 16:25:50 -0700 From: Jakub Kicinski To: Matthias Kaehlcke Cc: Joe Perches , "David S . Miller" , Simon Horman , Dirk van der Merwe , oss-drivers@netronome.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Renato Golin , Manoj Gupta , Guenter Roeck , Doug Anderson Subject: Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro Message-ID: <20171004162550.20edf18c@cakuba.netronome.com> In-Reply-To: <20171004231649.GP173745@google.com> References: <20171003200546.165731-1-mka@chromium.org> <1507140439.4434.14.camel@perches.com> <20171004184957.GO173745@google.com> <20171004152203.2a4f564d@cakuba.netronome.com> <20171004231649.GP173745@google.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote: > > > Thanks for the suggestion. This seems a viable alternative if David > > > and the NFP owners can live without the extra checking provided by > > > __BF_FIELD_CHECK. > > > > The reason the __BF_FIELD_CHECK refuses to compile non-constant masks > > is that it will require runtime ffs on the mask, which is potentially > > costly. I would also feel quite stupid adding those macros to the nfp > > driver, given that I specifically created the bitfield.h header to not > > have to reimplement these in every driver I write/maintain. > > That make sense, thanks for providing more context. > > > Can you please test the patch I provided in the other reply? > > With this patch there are no errors when building the kernel with > clang. Cool, thanks for checking! I will run it through full tests and queue for upstreaming :)