From patchwork Fri Feb 14 13:55:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 865168 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [195.130.132.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61E3A263C82 for ; Fri, 14 Feb 2025 13:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739541389; cv=none; b=CIiYtm/VGdTgsJRUPEJ5awxb/BMCI5+xvUsH/MGxCT11xhperLcomQn2+zLwRSNdWn5hP5jhd9aL/vmmeGl+xY0dhLPXFQfbiF8E5ZScwCNYdwBAyhlOAa1rWlaopPWYF6ur/d/3veQZMwXj14ZbMmgdfdZLqKP9sLICBaGfq7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739541389; c=relaxed/simple; bh=rAT0/yGqIinWIkWPVthBs57MGz6pH/o3E4AoxBOUIfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pSveU6CQ+GcPefr/QtUtlflZi5YTGlsCblQggaUescYZLkJBHnAF2uboe2ZdxWWh6Y0uGlxk192h3Kx0LcGFd0Re1yQgg4ojBFOeV+ll9HBCCzMNrpNfJd33sZ6OujLI+0m9oPfqs0EeNHB7wlrzfuTjCETF45Q3idb3Un4tE3Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:6395:73cc:7fc4:4cab]) by baptiste.telenet-ops.be with cmsmtp id DRvu2E00H1MuxXz01RvuSz; Fri, 14 Feb 2025 14:56:25 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.97) (envelope-from ) id 1tiwAL-00000006p2o-1GsL; Fri, 14 Feb 2025 14:55:54 +0100 Received: from geert by rox.of.borg with local (Exim 4.97) (envelope-from ) id 1tiwAc-00000000qEs-2BGZ; Fri, 14 Feb 2025 14:55:54 +0100 From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 4/4] soc: renesas: Use bitfield helpers Date: Fri, 14 Feb 2025 14:55:53 +0100 Message-ID: <77384c0a6660b90c5c9f1eaa9d1f5ce32f3330a3.1739540679.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use the field_get() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- v3: - No changes, v2: - Drop RFC, as a dependency was applied. --- drivers/soc/renesas/renesas-soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c index df2b38417b8042fc..8030b9a62ec46668 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -5,6 +5,7 @@ * Copyright (C) 2014-2016 Glider bvba */ +#include #include #include #include @@ -512,8 +513,7 @@ static int __init renesas_soc_init(void) eshi, eslo); } - if (soc->id && - ((product & id->mask) >> __ffs(id->mask)) != soc->id) { + if (soc->id && field_get(id->mask, product) != soc->id) { pr_warn("SoC mismatch (product = 0x%x)\n", product); ret = -ENODEV; goto free_soc_dev_attr;