Message ID | 20200204013724.KBXeMBIPM%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=xrrM=3Y=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF4C13A4 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 4 Feb 2020 01:37:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AD1C20732 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 4 Feb 2020 01:37:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fMddOrLB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AD1C20732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B7FFD6B02CB; Mon, 3 Feb 2020 20:37:26 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B06006B02CD; Mon, 3 Feb 2020 20:37:26 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F4816B02CE; Mon, 3 Feb 2020 20:37:26 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 851366B02CB for <linux-mm@kvack.org>; Mon, 3 Feb 2020 20:37:26 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2D1B8180AD802 for <linux-mm@kvack.org>; Tue, 4 Feb 2020 01:37:26 +0000 (UTC) X-FDA: 76450732092.13.salt88_23c43c09e780e X-Spam-Summary: 2,0,0,b6e211ea44f18e45,d41d8cd98f00b204,akpm@linux-foundation.org,:acme@redhat.com:akpm@linux-foundation.org:amritha.nambiar@intel.com:andriy.shevchenko@linux.intel.com:chris@chris-wilson.co.uk:keescook@chromium.org::linux@rasmusvillemoes.dk:mm-commits@vger.kernel.org:mszeredi@redhat.com:steffen.klassert@secunet.com:tobin@kernel.org:torvalds@linux-foundation.org:vineet.gupta1@synopsys.com:will.deacon@arm.com:willemb@google.com:willy@infradead.org:yury.norov@gmail.com,RULES_HIT:41:355:379:800:960:967:973:988:989:1260:1263:1345:1359:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2693:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6261:6653:6737:7514:7576:7904:8599:9025:9545:10004:10913:11026:11473:11658:11914:12043:12048:12297:12517:12519:12555:12679:12783:12986:13161:13229:13846:14096:14181:14721:14849: 21080:21 X-HE-Tag: salt88_23c43c09e780e X-Filterd-Recvd-Size: 4446 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf41.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Tue, 4 Feb 2020 01:37:25 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (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 7FACB20732; Tue, 4 Feb 2020 01:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580780245; bh=MfpTuHTAFPsqB+r6D3f7BFQ7QkqaBlQA69/B9XhuT+M=; h=Date:From:To:Subject:In-Reply-To:From; b=fMddOrLBoksIrk63A+s7bkMdHGOMmGtvCB80dXqOdZRyHebtiWN+H4Emi6HS/qOL6 7xUkieXWu4TdNToZAaAXJIQiT8b2kbrjUMFQNDL5EA6nfk0BVm/OqJXMqSDVd7JkcA Jxbi64zpYpvkX0lTOjnEalg3iAqswQ8vJezw4tYc= Date: Mon, 03 Feb 2020 17:37:24 -0800 From: Andrew Morton <akpm@linux-foundation.org> To: acme@redhat.com, akpm@linux-foundation.org, amritha.nambiar@intel.com, andriy.shevchenko@linux.intel.com, chris@chris-wilson.co.uk, keescook@chromium.org, linux-mm@kvack.org, linux@rasmusvillemoes.dk, mm-commits@vger.kernel.org, mszeredi@redhat.com, steffen.klassert@secunet.com, tobin@kernel.org, torvalds@linux-foundation.org, vineet.gupta1@synopsys.com, will.deacon@arm.com, willemb@google.com, willy@infradead.org, yury.norov@gmail.com Subject: [patch 60/67] bitops: more BITS_TO_* macros Message-ID: <20200204013724.KBXeMBIPM%akpm@linux-foundation.org> In-Reply-To: <20200203173311.6269a8be06a05e5a4aa08a93@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[01/67] ocfs2: fix oops when writing cloned file
|
expand
|
--- a/include/linux/bitops.h~bitops-more-bits_to_-macros +++ a/include/linux/bitops.h @@ -11,8 +11,10 @@ # define aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n))) #endif -#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) +#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long)) +#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(u64)) +#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(u32)) #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(char)) extern unsigned int __sw_hweight8(unsigned int w); --- a/tools/include/linux/bitops.h~bitops-more-bits_to_-macros +++ a/tools/include/linux/bitops.h @@ -14,10 +14,11 @@ #include <linux/bits.h> #include <linux/compiler.h> -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) -#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) -#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) -#define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) +#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long)) +#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(u64)) +#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(u32)) +#define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(char)) extern unsigned int __sw_hweight8(unsigned int w); extern unsigned int __sw_hweight16(unsigned int w);