Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4237968ybc; Tue, 26 Nov 2019 06:06:30 -0800 (PST) X-Google-Smtp-Source: APXvYqziju4f3BBJCA6d9wXifhkcvBLp8zLI5/WD7yms0Z2Zc4P0Bngi2veuedsTOr8vH5XIQ+1c X-Received: by 2002:a50:a7c5:: with SMTP id i63mr25171389edc.79.1574777189629; Tue, 26 Nov 2019 06:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574777189; cv=none; d=google.com; s=arc-20160816; b=E2gPgfgx+FCzPr6J5xyL1Fjot0APoN2wEDAfRlDPxrAmHEb19o1Gh16xjzYT0lwL+J qidqgKrYGkKOiDrBplEavTRGPWYO0fXMPsLngjZy0Es2TrKLHSy/vs2ViC0w//CisVED a6vkhL+Vvv8z+Nr3q4JDouIpr1MaN0myArq6ufkupA+8P4w/6H1Wv+1BvR4sHXGFzi0U mwmHwX6+ZWROnEEpqF6olLz86P6xw6bYbZuBHQ7W4C6R4kG7pTU/GPXh4RCfI994ltkH aROK6zl61RjH0Cn39NYU3JQO1iktTBfiooys6uUf5dxH4o8rhZCNEkhAbbHrUDiXM51x vuig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5nAvciWjljSlo0MRrEzGu4vA1rOXmiskCOHgf/ck+dw=; b=tNt3DMwDq68/feEq4JoWj2kFDecmUgAAbiZJFFcI0kTU4eN9S3lqkOtQE9RR1oOwoG jDKlCwh/EfSZKmLt0TZ3vw6tPHILik0Fn+8ubyNFhW/jh/5BBRmH1fBxwFJucUkLd9nd 134KdLeEe1BuJY0BgRM+eh5QiA3w4cJGEe4mj8S6hSrSepfUWjuv63gdGnZffmQbiXti UpHQ4JgUTXKtYxUDWIB54/XZMdntx7CAnjSEF4Jr4cjhJleshYrkQYn3FkmtWr37H1UH XzXLOfssFbYPg9DSrBkuLrfQYEknMST3Xv6aP+uHhB3zhnrT4fWjTUkZNuak45mydu7m z5rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RvVzSwrz; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch10si6891621ejb.356.2019.11.26.06.05.50; Tue, 26 Nov 2019 06:06:29 -0800 (PST) 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=@kernel.org header.s=default header.b=RvVzSwrz; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbfKZMvn (ORCPT + 99 others); Tue, 26 Nov 2019 07:51:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:49014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfKZMvn (ORCPT ); Tue, 26 Nov 2019 07:51:43 -0500 Received: from localhost (unknown [193.47.165.251]) (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 69E61206BF; Tue, 26 Nov 2019 12:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574772702; bh=5nAvciWjljSlo0MRrEzGu4vA1rOXmiskCOHgf/ck+dw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RvVzSwrzBkQ8faXu4UMgM41piS9lOzszU7IBHz2T7OmjxLWK42N9HPWM4t8WYcewV PUlUbBehr242PJuxMMaPAyqmIpZMmTP8A2xzlNoVjXorIj5w1xm/6m7g83zpY3rYyX 9x/57jz1HLZHD/qWHYTPD9Y14fFMXbPWmvXEBy20= Date: Tue, 26 Nov 2019 14:51:37 +0200 From: Leon Romanovsky To: Nicolas Saenz Julienne Cc: andrew.murray@arm.com, maz@kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Tariq Toukan , Rob Herring , Frank Rowand , Shawn Lin , Heiko Stuebner , Christoph Hellwig , Marek Szyprowski , Robin Murphy , james.quinlan@broadcom.com, mbrugger@suse.com, f.fainelli@gmail.com, phil@raspberrypi.org, wahrenst@gmx.net, jeremy.linton@arm.com, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, "Rafael J. Wysocki" , Len Brown , "David S. Miller" , Bjorn Helgaas , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH v3 1/7] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions Message-ID: <20191126125137.GA10331@unreal> References: <20191126091946.7970-1-nsaenzjulienne@suse.de> <20191126091946.7970-2-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191126091946.7970-2-nsaenzjulienne@suse.de> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 26, 2019 at 10:19:39AM +0100, Nicolas Saenz Julienne wrote: > Some users need to make sure their rounding function accepts and returns > 64bit long variables regardless of the architecture. Sadly > roundup/rounddown_pow_two() takes and returns unsigned longs. Create a > new generic 64bit variant of the function and cleanup rougue custom > implementations. Is it possible to create general roundup/rounddown_pow_two() which will work correctly for any type of variables, instead of creating special variant for every type? Thanks