Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2515168ybg; Fri, 5 Jun 2020 16:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ22pudo9iy2JWHBdydnjEoGQNStyH1sOH2KKxFeiW9R8IIP1q74hfFJNTPZwd+IZvOlDj X-Received: by 2002:a50:f05d:: with SMTP id u29mr11738276edl.229.1591398628528; Fri, 05 Jun 2020 16:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591398628; cv=none; d=google.com; s=arc-20160816; b=Txtt5w+GZbOLAbZEErYzHfTBtebJdw6bLomZaVhmTZljRgi0BPQhKUp6KekWY5UVMm LkvzjYwOB3GkkkcKkL5jkRjtA94uA4V0BqJCpYO0+t9D3SsoVxWovvqjPZofI8wIczJV d8QQ46uyHuKRsvpHLrLfZ4uPBaUUSQC8g+1TzUnS252V+f7Yk+SO/yjL5YndxwYUoVjq 5D1cGmx38HK4vyIi45osfV129nJGesjhIfNHJj9rYjMk1YD0jrrk9cirEwVyeBL6+USq smCJ1Sjrp+muH3P6S55UfgsOBH9CtcK8AqEAZQZZp3A+kFGKp4VF5l2IMcpwTE3iWBPG oFOw== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=3u4/mtv2/jBtgjltUFBJn+fwtcCTe1s6zswW2F4KCzY=; b=vXntSn86hVfegzutO9RkJTWrS9q4qZ2sbPsWWXC2zp7Sj8suCclu16JKxaIiJFNsVV 2sczVYWlwKb1i9yRlK94kMBtakNWnrcdFaJ77ABj23CQdVQAhIUrts8Iumi9WbwgY+2X Bmbw2aiG87qLbUYf1cY+wjou7U19bAvaKCvYnWtfTKeB2GGfIrInGqKNG4Og8W8aQXm8 Ba4Eq1SvYL2CHRLGhR63oEzByLibhugN4MUmyCNrc5LFy3Qo8QDZn+8BpkYUig4x0EKg G6NTmDlflZ/OKbZ9hgi88Ez8LHhcLMZLrhXBsOM1HfCJ77PoBQTegsqz9hK2fnueh/BY /4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vRmndE7d; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj15si4249662ejb.622.2020.06.05.16.10.06; Fri, 05 Jun 2020 16:10:28 -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=@gmail.com header.s=20161025 header.b=vRmndE7d; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728363AbgFEXGO (ORCPT + 99 others); Fri, 5 Jun 2020 19:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728296AbgFEXGO (ORCPT ); Fri, 5 Jun 2020 19:06:14 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BF15C08C5C2 for ; Fri, 5 Jun 2020 16:06:14 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id a25so11827003ejg.5 for ; Fri, 05 Jun 2020 16:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3u4/mtv2/jBtgjltUFBJn+fwtcCTe1s6zswW2F4KCzY=; b=vRmndE7dOuxm/AAsAHQcsWeerof/xY/UgYciuRI/oDFw0rGmfA91Q2fcSIrKIIaPfF D9M/AZyrktT5qX5lcuvboDcNQ7o+j7JYqpb4hgz7TwDD8z9VKFQ5QOQhK/rXMa4EwsVK fHWDRcgJvZCy8/vcCuY1jQ6osj87sktKX017wU5NiKLh1USimm10LRGxE6LaOeax7GT+ NcOMw+Ksl0l1XGuZPOGkQ2uEkoTcAd47rb7WPF3tKzi4RG5F/2JSbsuAObpanwHiMYOY 3I3peJ/s+zkUGBd55kMH2Y713lOHDZYr1jdyL57YvsMjv3ydDPd+DFUVdv61KwORvhmo iVzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=3u4/mtv2/jBtgjltUFBJn+fwtcCTe1s6zswW2F4KCzY=; b=GpuB1D1romv+4e+0pGxCLGIFprs2Nz5WDpQ60HFec9nwh66vO0iRW2GVgj8Wx2e1+r w6UKNIf2wsk9dm/2xaYOynC8c+jlKOyYNXxNMWzblSrulSfH5362czsXWWkDhkzJFkqi yxE/ZCLjkIx7B1MW3mBXWTtSMdS+H7UyZ5mrIW1n20KxgQKYYzhlg8NIy8n7LyyjrEG9 lWnUk5NUmW3wgnHno47ojc/lM6pvLt8QkkurV9Pwrg91S55OCs9I6gVue9kqyRlNyXcr ASozBFY4x2vD8bKJSk9WdQ/EsTBmvOKg1uXNgvjHBsNrfNOcW3k2VzxBYW40/iGgHDIW zLvw== X-Gm-Message-State: AOAM530V3cn+IMEWtEtbdlicEU/34iOTHCgu06sS87C0ZyOQH4jrCQ91 okGOVhtbxqTbTb+VzoPxvjs= X-Received: by 2002:a17:906:6403:: with SMTP id d3mr10712622ejm.386.1591398372697; Fri, 05 Jun 2020 16:06:12 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id q25sm5282481ejz.93.2020.06.05.16.06.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jun 2020 16:06:11 -0700 (PDT) Date: Fri, 5 Jun 2020 23:06:10 +0000 From: Wei Yang To: Geert Uytterhoeven Cc: Wei Yang , Andrew Morton , Andy Shevchenko , Christian Brauner , Linux Kernel Mailing List Subject: Re: [Patch v2] lib: test get_count_order/long in test_bitops.c Message-ID: <20200605230610.bizp2j23ivyma5rn@master> Reply-To: Wei Yang References: <20200602223728.32722-1-richard.weiyang@gmail.com> <20200604122805.d2ndjmkmti6wl3nz@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 02:51:40PM +0200, Geert Uytterhoeven wrote: >Hi Wei, > >On Thu, Jun 4, 2020 at 2:28 PM Wei Yang wrote: [...] >> >> You mean >> >> {0x0000000000000003, 2}, >> {0x0000000000000004, 2}, >> {0x0000000000001fff, 13}, >> {0x0000000000002000, 13}, >> {0x0000000050000000, 31}, >> {0x0000000080000000, 31}, >> {0x0000000080003000, 32}, > >Yes, those values. And those should work with get_count_order_long() >on both 32-bit and 64-bit. Hi, Geert To be frank, I am afraid I lack some of the skill to achieve this. Maybe you could give some guide. get_count_order_long() takes one parameter, which is of type unsigned long. This one has different size on 32bit and 64bit platform. On 32bit platform, those value would be truncated. Would you mind giving me a hint on this? What we may achieve is like the implementation of fls_long(). This one check the size of unsigned long on running, and choose different function. We could use ifdef to check the size of unsigned long and use different data to feed get_count_order_long(). But I don't find a way to feed get_count_order_long() with 64bit data on 32bit platform. > >Gr{oetje,eeting}s, > > Geert > >-- >Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > >In personal conversations with technical people, I call myself a hacker. But >when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds -- Wei Yang Help you, Help me