Message ID | 20200310123615.448719347@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=QSPG=43=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72235C18E5A for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 12:47:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45E9324695 for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 12:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844430; bh=iYoThNzsN9sLo4BBTBPvBQeaRYlI3YW5q55/Nq573as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sI897qECAXTVPwxHTJst1YFfRkyrnoykRQURDUReSaVfo2FCgPuuFbxti2ZTnQip0 WZSek6RLj+MbQzrDwxKS65dKMhq0b0ziWTtEVXf20fs4FnyLWrmAD5RkvFtpB+F6W+ 54haVde6UCzJ7jUI6h7ZDJ3PWowPBGKbJJCR+LbE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727440AbgCJMrI (ORCPT <rfc822;stable@archiver.kernel.org>); Tue, 10 Mar 2020 08:47:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:50750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727938AbgCJMrH (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 10 Mar 2020 08:47:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D90A20674; Tue, 10 Mar 2020 12:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844426; bh=iYoThNzsN9sLo4BBTBPvBQeaRYlI3YW5q55/Nq573as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=skvQ1tfApCtlhdhzdVzZf9G4Xi9zZuwDZ44DiUlxkf87Q034MDTY7kLm6TILt+/z2 602CN6JqoQ1RDnejQQlj4aaH3a43T8rD29lBeJ/f48vlqXguNwl66V/kr+gmXByUYG A7VwPmKPF9iNBFu/5zXC+37HxFEnWXCw3uCQxheY= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Chris Wilson <chris@chris-wilson.co.uk>, Jani Nikula <jani.nikula@intel.com>, Randy Dunlap <rdunlap@infradead.org>, Andy Gospodarek <gospo@broadcom.com>, "David S. Miller" <davem@davemloft.net>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org> Subject: [PATCH 4.9 39/88] include/linux/bitops.h: introduce BITS_PER_TYPE Date: Tue, 10 Mar 2020 13:38:47 +0100 Message-Id: <20200310123615.448719347@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -3,7 +3,8 @@ #include <asm/types.h> #include <linux/bits.h> -#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)) extern unsigned int __sw_hweight8(unsigned int w); extern unsigned int __sw_hweight16(unsigned int w);