Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1576967rwd; Sun, 14 May 2023 23:12:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hm1KohuMdjFdTCEwwnt/DyWQpe87wwOwsuJbbizvDI6mY47/ZlGODx46p1b47i1T8SRLN X-Received: by 2002:a05:6a20:54a2:b0:100:aa15:f425 with SMTP id i34-20020a056a2054a200b00100aa15f425mr14469629pzk.20.1684131174015; Sun, 14 May 2023 23:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684131174; cv=none; d=google.com; s=arc-20160816; b=GPw4Xoflm7qlGmqCsGz2oGOAltq7RnT0iH7Db/xszCbtut8nPecA3ZZU+fdHh8Yqrt A7I1TcfF2Ih3YO5ezJJ6BBBDq1oc90zSXEI/UmnIgHooHGZ7jDVgp3tyjJGAHu05ypiM qrys+T0BVFwLhFUghnRsqmgb/dphB68eGqmftCsqFZptJaiz/szfxgNIKq824V8nJU6g Zi6i+MzJ00ACk3Nh83F8Z92y4s6aDrEp83rLdQWWis8zK15u+GqYrUOiUQfylVYYTBAN mtGPAosI70c2H2lPnV/CX82ZQs7td2N817aD2YXHBkAH2rX3pOiskoHcJfjWiTrBvIj0 2Avw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=BqZ8CvJ6NCBt01BH2Ad0RYvJ+wXTde1fW7CvhAT4lIg=; b=xL61IW55ymJ5F9UbX6t1KcAwOJrVBAPmIq3NEmD7fH5aLh4fKHeq7XbW05MtRfA0/3 J3BRWLZjQ6IPt98XGOo1J34twqS/0AVKXm17p/zcbhp8szjl/3L5HH2M9zIfD4uk2ED4 3vq/LAPsMW77jNefJbj2yL0+XUn2JDJIa9lcLOoWZDPhnQSJSmvT98stusjqC37GW3T5 Xx38n3zpEiIqsCgjrE5o6xtG3C54vJjzNsNg06U3g6vtfzziHJbNdLfq4HvouQQcbl2U Izr0zz4y1sdnfVHC1iJsIzB+hoDf8gHYdkeF6voOoL9H0iLFavoCDyJzTaNQNrXWjeK8 sj5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020aa79982000000b00643970acd01si16110443pfh.319.2023.05.14.23.12.41; Sun, 14 May 2023 23:12:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239399AbjEOGHq (ORCPT + 99 others); Mon, 15 May 2023 02:07:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238183AbjEOGHc (ORCPT ); Mon, 15 May 2023 02:07:32 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 037B32703; Sun, 14 May 2023 23:04:29 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id BD54D24DB84; Mon, 15 May 2023 14:04:27 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 15 May 2023 14:04:27 +0800 Received: from [192.168.155.85] (202.188.176.82) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 15 May 2023 14:04:24 +0800 Message-ID: <3ec4b399-48d8-0129-85b7-0fe30e6de9c5@starfivetech.com> Date: Mon, 15 May 2023 14:04:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v7 4/4] crypto: starfive - Add hash and HMAC support Content-Language: en-US To: Herbert Xu CC: "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Conor Dooley , Palmer Dabbelt , , , , References: <20230504073400.1170979-1-jiajie.ho@starfivetech.com> <20230504073400.1170979-5-jiajie.ho@starfivetech.com> <2ae2d187-5db7-9207-7846-1a80e87047b2@starfivetech.com> From: Jia Jie Ho In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 15/5/2023 12:24 pm, Herbert Xu wrote: > On Mon, May 15, 2023 at 11:27:35AM +0800, Jia Jie Ho wrote: >> >> I've added COMPILE_TEST in the Kconfig, then ran make W=1, sparse and smatch. >> However it did not produce the error message. > > I guess you weren't testing on a 64-bit platform. BIT(2) is > an unsigned long, so ~BIT(2) is 64-bit long on 64-bit platforms. > I am cross-compiling on a 64-bit platform. I'll check my compiler settings again in case this masks errors in future patches. > You're trying to feed it into writel which takes a 32-bit value, > hence the warning. > > If you have to use the BIT macro, then you need to cast the result > to u32: > > #define STARFIVE_IE_MASK_HASH_DONE ((u32)BIT(2)) > > But it's probably a lot clearer if you do it as: > > #define STARFIVE_IE_MASK_HASH_DONE 0x4 Sure, I'll do this for the next version. Thanks, Jia Jie