Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4518648ooa; Tue, 14 Aug 2018 07:04:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwkcplXD4LUFCbTlCawBV6mWeY5jwx0HhUr/UCi2zALp8sOjKpVIUJHeeD3/nq8QhD3PQvD X-Received: by 2002:a62:2646:: with SMTP id m67-v6mr23727052pfm.254.1534255488678; Tue, 14 Aug 2018 07:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534255488; cv=none; d=google.com; s=arc-20160816; b=miARfprCKJFHjlm8z5N07mGM/JEmGxAR6L1VTp4KXCIZwkdMxslT8mmVPOyVEGP38T HUx4FueLzMd4HN29K75hp9wMQ7IARr5vfOjn9NmX80rMCtJNDozNXdgctY7MMgqIcftQ cx3JScXvMX19zFEMbi2weLFQsdlqMsYbexGD2iwREOi1DoR44CBgqIX1vL4ShRjPyKl7 8WmYpuNBDUCwuBgPPGl13o1qmunNMlWnyZsH5rmLe4Bh7ZCh6ncuXxKSiqPVI8V/5dLv 8pitS2AqeTfSyjJ0Z605FkkxrGVw890uKOrZDt7g75n9m0kzGEHZgovXe3VBWAheTSQP xrOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=2Ly3z6zYWRMnVJAMzbSgmGnV1h7BCRViWVJPf0raK5w=; b=vEE8zbhTdkYoxm3euJ0vuQULQiTlCwNAIhBLCbNAEtQj0Em2MYzyvmxKo1EPxJc1ij XJKTJ2ufwcQzVDW2bN7qGEU8SeJxxQBR/+MIyrurX59rXrG4qUpXkrbMolom4Klf8/+R PpvdBEXxVAnwACJKwPv2560tMdPHtymQIL2xgl5NTXeHI9b30PLU8I6yEOOTgUJ25qoc t9gJqFMHuwQUmQoHg7nR5RC5wam/7wKIutaR6JFgG643WytnYe518+WkJo1AX7ZlLTEJ z4nw2GjoYlAyyr+VZGu5q3fvzP0OwAI/Dd0Il3r3tjg3Ei5Lf4hFqviDXKRro2kWIsaE gBOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uilOEDL2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p35-v6si19034321pgl.202.2018.08.14.07.04.33; Tue, 14 Aug 2018 07:04:48 -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=pass header.i=@gmail.com header.s=20161025 header.b=uilOEDL2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732495AbeHNPdI (ORCPT + 99 others); Tue, 14 Aug 2018 11:33:08 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35881 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732092AbeHNPdH (ORCPT ); Tue, 14 Aug 2018 11:33:07 -0400 Received: by mail-qk0-f196.google.com with SMTP id x192-v6so13241384qkb.3 for ; Tue, 14 Aug 2018 05:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2Ly3z6zYWRMnVJAMzbSgmGnV1h7BCRViWVJPf0raK5w=; b=uilOEDL2t/YC40xvCB/Ejor90BirvnkWW0fNJx8Ftfow5CEM+v5/XdAzmQXh+/ohZv C/i2fpv4zkvXkdi4UGNnI199UdLzpnCGxWgr6TskQvoxv6kiV33fjJwz1S+G0maeLLhd vf3Qpqvgo97cjZjkhgivTfmetksoB41C9olp4EpbfL25fFXAt50HvOTCrYRp0ez3/kSM QQFHN6Kl3uJUDOHIBmGl+GFH+pa4voPQ5p8hx107t0ZX8p5e4BvlW6fZctsgVHINyldP xAyUCZf8Zzd8iw/GlsGtpJd9ZfE/3rM1//qtwhFuPMDXY++D+3V2VLeE2qKAqFdU2TLp ocig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2Ly3z6zYWRMnVJAMzbSgmGnV1h7BCRViWVJPf0raK5w=; b=Sf2Uy2Z1FJx5UzXLwrd8HO6lqJCUaPkXHtySCi18Q35vXBgQzOjQIjVwk8bEYyhzmQ DcI/HHO0E8wncvB3R9w3LUUzpK7RzsUDoZjUANe7zenXdITJ8zfhmmQtDPAlHoG8Xwrq 24m1zzlM5eZqQFQC6eVCbh3OdNvECEHt2RKnUVSVAHI1yMsJ1GWsCk7Zf4NlByjTrkTO UWzuhDkfTxUsqi6QTbHoNrtQQZGuGSBsPPP+XBb20HzySGumC5jngFhncXIgd0ajwvr4 g8sGMKFyAUP+zkplgmldOWY99mSrCE2YDAV8jZBvqzMxexE6CcuMTG0eNF7U6x/KLyiI VNbg== X-Gm-Message-State: AOUpUlHJYytrIFVoVbDah3JzZtZs7mudJsOV2mD+QRaJ9lahjEZprU5K 62JnsHuHd8yMliNxIGr5gpwnWYNEXyyk8Ys+QekL5cIc X-Received: by 2002:a37:2bc5:: with SMTP id r66-v6mr19623038qkr.3.1534250764836; Tue, 14 Aug 2018 05:46:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9c4a:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 05:46:04 -0700 (PDT) In-Reply-To: <5B698106.5080806@intel.com> References: <1532592471-21177-1-git-send-email-wei.w.wang@intel.com> <20180726093728.GA9069@yury-thinkpad> <5B599F5F.2070705@intel.com> <08410774-8b10-d620-064c-fdf4399d7336@rasmusvillemoes.dk> <5B69445D.1000107@intel.com> <5B698106.5080806@intel.com> From: Andy Shevchenko Date: Tue, 14 Aug 2018 15:46:04 +0300 Message-ID: Subject: Re: [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK To: Wei Wang Cc: Rasmus Villemoes , Yury Norov , Linux Kernel Mailing List , Andrew Morton , Jonathan Corbet , dgilbert@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 7, 2018 at 2:22 PM, Wei Wang wrote: > On 08/07/2018 06:26 PM, Andy Shevchenko wrote: > "there", I meant that user-space port, not in the kernel. > e.g. > Line 225 at https://github.com/qemu/qemu/blob/master/include/qemu/bitmap.h > (there are a couple of other places) So, means no problems in Linux kernel project. Thus -> NAK. >>> nbits=64, means all the 64 bits need to mask >>> >>> The two are different cases, I'm not sure why we let the macro to return >>> the >>> same value. >> >> The point is macro mustn't be called when nbits==0. > Yes, I fully agree with that point, but it seems Rasmus NAK-ed that point. No, we are talking about different things. Rasmus pretty much right that the caller should have already known nbits and avoid calling this macro if it's zero. -- With Best Regards, Andy Shevchenko