Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1681069pxb; Tue, 26 Oct 2021 13:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxntwwyl9wDlJVIkiVwR0OSlwShzMDjP65yEIHwOrIu2PAM+jl6odlwiDnKh+74Zk+38vKM X-Received: by 2002:a17:906:a94b:: with SMTP id hh11mr34161811ejb.85.1635281040985; Tue, 26 Oct 2021 13:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635281040; cv=none; d=google.com; s=arc-20160816; b=oe2PuklfdLfl4jbwttpB/gGecYClGs0DspzioRSEg+K+hSLIFlV4eeQfGNrUigSnas 2JyaXinUcQN0kF/sT/g9mP1RjK8iEk3pjfmeCiVFUOahDxssMWGpc6/6BuC6juRRpibC xMbj02ckUHBj5yXDsyYCYYS0C/8d9eb07hbvnSRe6nlOnnx/0nFsbprsiGHifSenfOqT 6EAa6TsKAsgafIgdGCtbe1IDgCNzM4OqvWg/7wcHsaJgEj+J0S5vcpv/zgGHKYC2CxDG b9uOV5P1f6dvC6s6q5b9b2zPOzhhMGbXTZ3Uc4sXtj2XWdv3TbBMZc74fV9X7vrsEPgH 0Q2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=4AYJm7qd1hQYTfs/Z6RrpgJUNElL105ABdcefBVrSaA=; b=Da3tY8oo5Avvsb1jweLMvq6Jr3KrweiawJqitW1xcL5um+3ylVPLmW8h16tTZqXvbd 8oDRgRgQesBPqwvS7AXApO9ElnS/WeYqAF+UDghDHUiOQTFBfAEV3uQcEu4daMNUWK4g zZP2ATVWXC766z2deiZogXa7JCqp6XcSpByESoC5wugNWZIsBRAXoZ1tlM4nWtvHD6JZ TMEnFA4a3J4iZHvIgniTjdqZ7KmC5IldeN1i+45MemFlFprMJhxUIUehZUI0XsAnt9JW sQXOCNs7rAG6moax5Au6CfCs4p72/lIP6RWjcfg5h+bYMVjW5RmlKpW8XnOMhE3UH28G RLPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ulfshrPD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si35414928edd.80.2021.10.26.13.43.27; Tue, 26 Oct 2021 13:44:00 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ulfshrPD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235457AbhJZP2m (ORCPT + 99 others); Tue, 26 Oct 2021 11:28:42 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:48616 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbhJZP2k (ORCPT ); Tue, 26 Oct 2021 11:28:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1635261977; x=1666797977; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=4AYJm7qd1hQYTfs/Z6RrpgJUNElL105ABdcefBVrSaA=; b=ulfshrPD7KTLNpDywjV0Np1z08mPPkHg6W9qYf3qb3UUcqWN2Pp8phOv hrDl6LFaxZt5+Rl/Mv3HY7YrpLaj9/S7yOL9p55gs4y2TW1d3lyPJ1FRf aXgp5CsDpaktD8AcKR3ucMwVCJwsmPXhaHlwm6W9c0uYwnGlmRaHTvmen 0=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 26 Oct 2021 08:26:17 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 08:26:16 -0700 Received: from [10.110.83.137] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Tue, 26 Oct 2021 08:26:15 -0700 Subject: Re: [PATCH] bitmap: simplify GENMASK(size - 1, 0) lines To: Andy Shevchenko CC: Yury Norov , Rasmus Villemoes , References: <20211026144108.35373-1-quic_qiancai@quicinc.com> From: Qian Cai Message-ID: Date: Tue, 26 Oct 2021 11:26:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/21 11:10 AM, Andy Shevchenko wrote: > 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? Not yet. I'll setup a VM to run it soon.