Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp883732pxb; Wed, 27 Oct 2021 14:25:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl4OknMBYWHbb62hG15BKSHSbQfs4+RqobL5kfTBk/l3QAuGlq5gFrsmoljb7twaOiTBX2 X-Received: by 2002:a17:907:7f8b:: with SMTP id qk11mr96754ejc.238.1635369953725; Wed, 27 Oct 2021 14:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369953; cv=none; d=google.com; s=arc-20160816; b=W+8XNHGJkMWXekqgi64OUL0+TpHN+ftOsyVskflU6+vGMg7DuBNqxb+2JpFGnBbiEj gcIeauwHMH7lbWNt18B0vJr9clHaUUcNYD4v/hltg/vScAZnPSeJ08H+Unhge347ZZeu 3aQoTJCFNjrHDBLlkxOW3cPqNHoFBqds5SL77ApXbkUohjjvMi8ugjIyfjar5JTptP4S dGE4oZmF9wVlpuUjzEhUhq2VoMOJ8k+t2msbaFklkid6VsAX4adOWX3GpQAlBi6ZTz6g R2oeNiWbPX5MtZmoHpv7sRvZVItDRzNdxpIhAX28X58yw5yZ/T4P2S+aLa/RctbFtdxU mk0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bkYh9nczQn3I0b/wu2In2wvJi6x8jr78kYioNJYUfCQ=; b=NhFytzzACWn4JmseVJNrtY91XVrumWIAQKJjvGSycmhMhl5cmfCMpfj4De2Jv4qJiZ a9MRepUQl8A1Azfi9+OF51e2g4rf8QeaSEcX2yJ0LPsliPwRG/z1kIjr7oLT77vE9R1e km3TL4EPUMObsgBIKeeaQUW3/R95Y6oZpp63+gXxkjbw0f9FyX/wd6DgiCG1BKZfBBLg b3WwbFxa3upxo7iLuG8UhVvIRYqie4V+mzQK/WxhrLOFkCIjlwrV9HEdbvacOytW0wTk ZxLlOnGcWfRZqbJkiVG4R2H0waYHlkgKc8mjeMpLS571uwr7sXNlBIvBgnRZEvZAJQrZ WemQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si567095edf.1.2021.10.27.14.25.28; Wed, 27 Oct 2021 14:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239234AbhJ0KaJ (ORCPT + 97 others); Wed, 27 Oct 2021 06:30:09 -0400 Received: from mga05.intel.com ([192.55.52.43]:4474 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhJ0KaH (ORCPT ); Wed, 27 Oct 2021 06:30:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="316334146" X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="316334146" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 03:27:42 -0700 X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="597312127" Received: from smile.fi.intel.com ([10.237.72.184]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 03:27:39 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mfg9P-001R57-CT; Wed, 27 Oct 2021 13:27:19 +0300 Date: Wed, 27 Oct 2021 13:27:19 +0300 From: Andy Shevchenko To: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , Jim Quinlan , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas Subject: Re: [PATCH v1 1/1] PCI: brcmstb: Use GENMASK() as __GENMASK() is for internal use only Message-ID: References: <20211027093433.4832-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 12:00:16PM +0200, Krzysztof Wilczyński wrote: > > Use GENMASK() as __GENMASK() is for internal use only. > > To add, for posterity, that using __GENMASK() bypasses the > GENMASK_INPUT_CHECK() macro that adds extra validation. In general, yes, but here we have a variable... > > - u32 val = __GENMASK(31, msi->legacy_shift); > > + u32 val = GENMASK(31, msi->legacy_shift); ...which make me thing that the whole construction is ugly (and I truly believe the code is very ugly here, because the idea behind GENMASK() is to be used with constants). So, what about u32 val = ~(BIT(msi->legacy_shift) - 1); instead? > Thank you! > > Reviewed-by: Krzysztof Wilczyński Thank you! -- With Best Regards, Andy Shevchenko