Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1669427pxb; Tue, 26 Oct 2021 13:27:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYWbFx3596FA8JBx5gVA70d4YJUQPv6zgp5Mj51hHEwGPQ94mZ6GFTmYw13Q1hP9Z/qqOa X-Received: by 2002:a50:d0c9:: with SMTP id g9mr22285130edf.132.1635280064193; Tue, 26 Oct 2021 13:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635280064; cv=none; d=google.com; s=arc-20160816; b=USM+4JV4mD5MIlBxTk9izsOcPfNVwnNPsFZZ5YWgi9p13HgGhIlGxGgZzLBoRpmZFM 11KwTmUYi4ZGFyR/M2JVw9UEYr7hDtXdhKHv/Yj4xvKWYxRd7gdEwF+tWny3tSQ7FGmh Gt0tEcgFs1UbU+iniQTBhFT8+0tnZhN0QSiKwaCoc6j75ahNjPkLvASOM0IXy7UWRxel VV2vqEdK1+OIGPP0mzvDxGs/6bHk4RCQwaINBMCmYHxDJac6dg/4P7tonSapYRBqxe4i hoXTTQmrWBYMEgYdSURFSq2IpP8xrf4RZpKedVaHQX0xnpXFZax5uSX+/EmNfCdv4kP0 oryg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=U0U7TaB9UO+Y43XmJaaJM5iMxRhvXN36/hgldHrEono=; b=prCMH9/sFDFtdUIo+V/YViq79AYWfS7y1S3IPyc6eu/ZNv7SiYY+qKzQ0WP53fp1Dr TFALGdlaBTzznPyf9o2vtiNM4Z8wbSZ/0yZJtYVzGxp8x7Ow+pcXoVZOGKhH0iT/BYS3 ojmAGcdno9iAKV9iL1qNDUcd+26OD1e0y+lku354Xec9UBamGmHAF4g7sF+q0KEHKVJx q+PgSyFmfWTxQ6VfJZ8zQmxM2Ui4RakJ3qqmGfZBAct499Xg4t8+8EMW9JGzlBYj2vKM Nl/AL42WJHA1aCME1RdOB/1v3te/z8bHz8WKq5kU7ox/u7rEWt9oylzb/WDTuoR2ygec FRUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id y11si32686346edp.315.2021.10.26.13.27.18; Tue, 26 Oct 2021 13:27:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235101AbhJZPNn (ORCPT + 99 others); Tue, 26 Oct 2021 11:13:43 -0400 Received: from mga06.intel.com ([134.134.136.31]:15154 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234890AbhJZPNl (ORCPT ); Tue, 26 Oct 2021 11:13:41 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="290772296" X-IronPort-AV: E=Sophos;i="5.87,184,1631602800"; d="scan'208";a="290772296" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 08:11:17 -0700 X-IronPort-AV: E=Sophos;i="5.87,184,1631602800"; d="scan'208";a="447153418" Received: from smile.fi.intel.com ([10.237.72.184]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 08:11:16 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mfO6J-0019XK-8U; Tue, 26 Oct 2021 18:10:55 +0300 Date: Tue, 26 Oct 2021 18:10:55 +0300 From: Andy Shevchenko To: Qian Cai Cc: Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitmap: simplify GENMASK(size - 1, 0) lines Message-ID: References: <20211026144108.35373-1-quic_qiancai@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026144108.35373-1-quic_qiancai@quicinc.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 10:41:08AM -0400, Qian Cai wrote: > Since "size" is an "unsigned int", the rvalue "size - 1" will still be > "unsigned int" according to the C standard (3.2.1.5 Usual arithmetic > conversions). Therefore, GENMASK(size - 1, 0) will always return 0UL. Huh?! Have you run test_bitmap et al., btw? -- With Best Regards, Andy Shevchenko