Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp258903imm; Thu, 26 Jul 2018 03:05:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc9I1nmSOwwMrCRQVZq9admbov/3Tndlqll0WyDYMqCkq5Yjesal4J8KCV08DGFNWK4FSbm X-Received: by 2002:a17:902:bf44:: with SMTP id u4-v6mr1387502pls.84.1532599558049; Thu, 26 Jul 2018 03:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532599558; cv=none; d=google.com; s=arc-20160816; b=hiME4SjmbMahBOEVtytE0unOq+60SOC48G1Lc3rjCB4/BpX7uWOQn/lBSRldaeBVPw L3/Kllx6uTXVg9oCg3mSJ3+PllSqweiRFMKx5JXwZlax/vdn5SGPFpIeISY4IoGO2gVL D37Wded8k84v3PdbnT0IcODdf2KTlcknToRukfslDPmShmSRwCSKs0Tc+IhWjJJSUiv3 Lsz/UFa59J6YheYJNDUT7o7NRKD5aIeZGiX9/J5J3IqzWURHvRXkDoVA/PGTZ/FbVFXN C1DyP8EFQ+DPTW6C5pOLAudYzgZPUDie+UWVOxKzAvbsmeZc6tlJtCEMMJ5v/dQVMmB2 /lZQ== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=DA1aEJsp5A/I9Ql8tPvOGL0m+Zauv60lY9PUJqTFPBs=; b=sFDx+J2m1DsPVf6mSrocmDKnZdRMScZk9pbOsVW7lhNFxSsf2HBLS4lQmdSSP9hYMP gQknzv4HG7VaCotq6ioJIk43yIOeadhTNlFaXAl6K4iLQltrRjdnzmfAvImzzhjFpaD7 tbboAewifhM8+b0xxTvyDY+T92w8zoxaG1OZ0qbY5kTOVHhKnrTBCF50h/CdjC5VJFXL Ns2RvW2L1647P4yM9JlDU4kH7WLwwOfjkMHl6/zN9hXoHc6yBoav1b+Mq4nbOLudpwlP 5m5/ceXYcta3D60YIbTX6XVux6/GIQzfySIahJpU/rECkGuAKsIeAsIEnqFa0wfmhkse jfyA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k125-v6si955859pgk.315.2018.07.26.03.05.42; Thu, 26 Jul 2018 03:05:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729191AbeGZLUx (ORCPT + 99 others); Thu, 26 Jul 2018 07:20:53 -0400 Received: from mga11.intel.com ([192.55.52.93]:53973 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728792AbeGZLUx (ORCPT ); Thu, 26 Jul 2018 07:20:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2018 03:04:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,404,1526367600"; d="scan'208";a="74672233" Received: from unknown (HELO [10.239.13.97]) ([10.239.13.97]) by fmsmga004.fm.intel.com with ESMTP; 26 Jul 2018 03:04:36 -0700 Message-ID: <5B599DB7.4050700@intel.com> Date: Thu, 26 Jul 2018 18:08:55 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andy Shevchenko CC: Linux Kernel Mailing List , Andrew Morton , Yury Norov , Jonathan Corbet , Rasmus Villemoes , dgilbert@redhat.com, Matthew Wilcox Subject: Re: [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK References: <1532592471-21177-1-git-send-email-wei.w.wang@intel.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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/26/2018 04:48 PM, Andy Shevchenko wrote: > On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote: >> The existing BITMAP_LAST_WORD_MASK macro returns 0xffffffff if nbits is >> 0. This patch changes the macro to return 0 when there is no bit needs to >> be masked. >> > Can you provide a practical example of what's going wrong before this > patch applied? > The reason of making this patch is that I saw some other software which ports this function and has possibilities to fall into bugs with usages which pass 0 to the macro. So I wonder if it would be necessary to make such changes in case we would get a similar bug. Or adding something to explain that "0" is not applicable to this macro as a reminder to people who would use it. Best, Wei