Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8302010rwr; Wed, 10 May 2023 22:22:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67tccXRWVHFjU41OwZq2/dIcZVT3SaqcrLiYTy8M7NNiDfZEYzyumCu02TbouuwLjJ+4Z+ X-Received: by 2002:a05:6a20:7283:b0:102:dd98:509b with SMTP id o3-20020a056a20728300b00102dd98509bmr5704295pzk.21.1683782564557; Wed, 10 May 2023 22:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683782564; cv=none; d=google.com; s=arc-20160816; b=oQt70/TRSEHOcZ+0PjPezHV8rTZ4TLM19wrZKbd2A5GjiVHK1VXnDAC9oP7vrPKm5M FcsqrjLKffShKrFyrk8e8Ch0PselzwuCHARSec10svqRln+Pmt5YzVjxiPYr0lprITf3 KJoIOyzkmt8rpAgpB/BZSX9hdLumH4x+qcUrZNw/nf3mDPqADu91Hw1//Oru6WIcAO0V SofXeUaj7/uUwOKa39QgVWv0kuOeai6DechxhOqyumj4qsj7grvgQ4f8i7lUpNniG5RJ WLO04IvtZaMbU4I3NHNH2JX43/a+lP3yKs8ZgrB+OYD2MukdJQbdUX37BsTPHuG5gBdY 4D8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=U9RowZn1NwtPG9zYvNOx3VsnBiQ7qe1z41/fBsFjmXA=; b=nFxEnM3M3sX/JbPiMkRAqDMrzxMbnuXd/wu6EwfvgRNN+9BPqxd2XWIlrWce13Vqto 36BAyOv2zIQyeaWvRuUWHsWXNXjDvbYeDaIdx8xla5WpscHzWUr7YA706P7TUXpHdWho Ju9aJgwJuJT4Dh/LWaKA0tvs32hOR7kEPsulhJ9n6Whdr2FISwgCUASGSf/BwLDxTycx UwoOYdkC57gNzVgAbSM0XM2moelXdUjdt/bOb4ib32BVJ/Z27V+hrERLo6eNqejjHiHx wDEUlCEAOHk5iS5BWMYqMUIeNzrVFo5tECEpBD2yHZYbjo+Kjrb9R+b4OmpVHMZeVtsO gU+g== 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 u128-20020a637986000000b005304543ac4asi5028114pgc.139.2023.05.10.22.22.24; Wed, 10 May 2023 22:22:44 -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 S231749AbjEKFRH (ORCPT + 99 others); Thu, 11 May 2023 01:17:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjEKFRG (ORCPT ); Thu, 11 May 2023 01:17:06 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73111420B; Wed, 10 May 2023 22:17:01 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pwyfU-007a2A-HF; Thu, 11 May 2023 13:16:46 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 11 May 2023 13:16:45 +0800 Date: Thu, 11 May 2023 13:16:45 +0800 From: Herbert Xu To: Martin Kaiser Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] hwrng: imx-rngc - use bitfield macros to read fifo level Message-ID: References: <20230427185357.923412-1-martin@kaiser.cx> <20230427185357.923412-2-martin@kaiser.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230427185357.923412-2-martin@kaiser.cx> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 Thu, Apr 27, 2023 at 08:53:55PM +0200, Martin Kaiser wrote: > > @@ -133,9 +133,7 @@ static int imx_rngc_read(struct hwrng *rng, void *data, size_t max, bool wait) > break; > > /* how many random numbers are in FIFO? [0-16] */ > - level = (status & RNGC_STATUS_FIFO_LEVEL_MASK) >> > - RNGC_STATUS_FIFO_LEVEL_SHIFT; > - > + level = FIELD_GET(RNGC_STATUS_FIFO_LEVEL, status); Wouldn't it be simpler to just get rid of the shift? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt