Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp2089090imm; Fri, 6 Jul 2018 11:39:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmTq0vs6xm4aGhnOxMBdZUbpF3ZJ/t2JjCBzqGodIlJcOpbtnYmC/HhqCbgWHM+91Ar2pX X-Received: by 2002:a62:98d6:: with SMTP id d83-v6mr11759917pfk.186.1530902347519; Fri, 06 Jul 2018 11:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530902347; cv=none; d=google.com; s=arc-20160816; b=ZZdKlLQov2pb1MjdnlKpQL++BpmvK5MUIjD6dHTIBHzyHomNqg0G+XKRGj1kdlJBUl /koxBSlptl5KV7h8CxO6BZ05UjDxGE2J7kyHZTnzOflD4QNKMAW5OkPeR+zvuy99HrCu DgXg4h7cTVmGI0SGFvYavC2JmXZ2MgFbTOA6t0JXepvG+5xrgAT0U+OM9aMcxFxXqNTm Tzr2FcO5FrnqSg0WcI/R9JCMT2gzxfshRdkqftENeCFg03ex1am5IQc3SqlVU7WIKfsH /HsLGXr5kNH3kaxkv6vNq4OW9o3II9Z8LAnOtQu+rCowAg8qTe2c/BGTLp3pgZhoTYEi bnmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=7pCxR79CKR/a6VjVA6KTtpHV/iHPrBoWPzeeDLGpMPU=; b=zCsjeNTvIfn0CAoeIagQgdm6dcHu6/PNwdifupq39aU+tmKCipIFCpP1d6k6SCB+Ss EmLN9sJq7hk629pDL4KY6fZigepueW1pyEAv+xRHn2hu8gGmhcq3MJ6D3Sya6AhFPm14 EKa/iXc/yRa6cvBHz8D5I9MuT7rbsYNtv046z4DCjF/Nu/4KIIJJTkJ1ZvhZIu8HHKEl ToCLVWtp+exThvcaDbebqzhY5iFljZjRyfM7kgzak8+75OsB2tq6kg4UXiybthUWv9px e2jTQSs1W+UhWGL/s2+lqpV4ZiTsFAkwtHa2rm8XpGvwHUYt0X/m9fcxLjDKovLvD+vM ac2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M6o+RHxF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k72-v6si8834164pgc.304.2018.07.06.11.38.53; Fri, 06 Jul 2018 11:39:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M6o+RHxF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934424AbeGFSiQ (ORCPT + 99 others); Fri, 6 Jul 2018 14:38:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49556 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934112AbeGFSiO (ORCPT ); Fri, 6 Jul 2018 14:38:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7pCxR79CKR/a6VjVA6KTtpHV/iHPrBoWPzeeDLGpMPU=; b=M6o+RHxFDAL+bggx5xPkHisQ8 uV1Egif0e/Ri/K/wDAK/hCQK/BIu5Tihx9o2ECc878y/DK0EEHWZ9Zbxm1/V9rhU2+PvUnbV3O2sT FjbBPO1eu0iTOa6lToHImPB7g8ipCFTErHWtIlcL5TaeKkoDesB4oapBJCLlcMLwHQ2vh1QTrAGs/ VjkVbUTjhUSob37djdoKZOiTHkaO9DdPeyI2e5NzovcsHziAUPTCkfAm1e7v8s6wiDqV78oqxt81/ 7e6miNyd3kowN7h9fygadAtxwtk1CkKv/V7iD0zDGnuJuU+k2tybmJCwOzgUIp7BJnIG/6uku9Vdu VHY24hgJA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fbVcS-0003bS-Tu; Fri, 06 Jul 2018 18:38:12 +0000 Subject: Re: [PATCH] bitops: Introduce BITS_PER_TYPE To: Chris Wilson , linux-kernel@vger.kernel.org Cc: Jani Nikula , Andy Gospodarek , "David S . Miller" , Thomas Gleixner , Andrew Morton , Ingo Molnar References: <20180706094458.14116-1-chris@chris-wilson.co.uk> <48904284-14d7-45c2-cf41-0c0b311ccf7e@infradead.org> <153089946144.7594.5374061827926275070@cwilso3-mobl.ger.corp.intel.com> <2d7d3dfc-e7cc-f844-4728-e1dbe13858fe@infradead.org> <153090001992.7594.17876223022816534941@cwilso3-mobl.ger.corp.intel.com> From: Randy Dunlap Message-ID: Date: Fri, 6 Jul 2018 11:38:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <153090001992.7594.17876223022816534941@cwilso3-mobl.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/06/18 11:00, Chris Wilson wrote: > Quoting Randy Dunlap (2018-07-06 18:55:57) >> On 07/06/18 10:51, Chris Wilson wrote: >>> Quoting Randy Dunlap (2018-07-06 18:48:55) >>>> >>>> On 07/06/18 02:44, Chris Wilson wrote: >>>>> net_dim.h has a rather useful extension to BITS_PER_BYTE to compute the >>>>> number of bits in a type (BITS_PER_BYTE * sizeof(T)), so promote the >>>>> macro to bitops.h, alongside BITS_PER_BYTE, for wider usage. >>>>> >>>>> Signed-off-by: Chris Wilson >>>>> Cc: Jani Nikula >>>>> Cc: Andy Gospodarek >>>>> Cc: David S. Miller >>>>> Cc: Thomas Gleixner >>>>> Cc: Andrew Morton >>>>> Cc: Ingo Molnar >>>>> --- >>>>> include/linux/bitops.h | 3 ++- >>>>> include/linux/net_dim.h | 1 - >>>>> 2 files changed, 2 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/include/linux/bitops.h b/include/linux/bitops.h >>>>> index 4cac4e1a72ff..091cb17d1a9b 100644 >>>>> --- a/include/linux/bitops.h >>>>> +++ b/include/linux/bitops.h >>>>> @@ -11,7 +11,8 @@ >>>>> #define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) >>>>> #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) >>>>> #define BITS_PER_BYTE 8 >>>>> -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) >>>>> +#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) >>>>> +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long)) >>>>> #endif >>>>> >>>>> /* >>>> >>>> doesn't need to #include ? >>> >>> It already has to in order to obtain BITS_PER_BYTE. Just doesn't do so >>> directly. >> >> Right. and does that work on all $ARCHes? > > It's a pre-existing dependency in the header, net_dim.h cannot > compile unless BITS_PER_BYTE is defined i.e. bitops.h is included. > The patch does not affect that. Yes, I see. net_dim.h should have #included bits.h and/or bitops.h previously. thanks, -- ~Randy