From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B6994418CC; Tue, 28 Apr 2026 14:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777386063; cv=none; b=dPS63SdYNpofgWXtGLiEoAu+3fd/RWZy6cuAR8t/sI6yiM7B/nkgS+4J0ACQeMCoBOWt3Jh1imkQzEojWzR7adh8hmQdH4tfzZk7CsRT9NrVLzteqgVftUjF7u8B92inH/ZPoCDD5e6zhASNrT+P16qp3B/q8TnkdA+MuNrbYws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777386063; c=relaxed/simple; bh=Gf+XrcYgPenGEIKbsoSDcC9F+FbyEhYGvpS57tMlaI0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OICK6HWQNvOkkcFe8gi4Y6kzK/6UhiwJYkhBL68KsniClzJrJ/Bte5Gr7hBiU5TTFTIZctUAeiC3eZFW1pIqCw4IKKd03Buq2cozsYau22kuLiMSbGYn16za2S/4DIRuxJ1eimZ+hT2x+9gTZ1uDZ3uODbsmaZhYlhgrHXyYZgQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=vxjVaeVo; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="vxjVaeVo" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 2E8E3C5EF13; Tue, 28 Apr 2026 14:21:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 71025601D0; Tue, 28 Apr 2026 14:20:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C9BD910728AA4; Tue, 28 Apr 2026 16:20:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777386050; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=Se88myibkKEKJupqIWVDpzFA5fJPWlqZId0UB7SQ3r8=; b=vxjVaeVoViKGSjmy7yA8GP/7DlUObLqX7S8zv6rcnNtDxwGmIJXvVzu3v4mrrviqaY5A9e LJp++FMBsE1rBNkgf+gPOlF7M4dmIf8dfvFsZ8mr/BXasf4iWnFFBYk6V5+ocpAxJmQclD dqAoNv2o6aTuDlojzUMk7cANEAVzmJvw9SwcZ66z57zpBrriy/fe+UhXu8x6GUD8ItAIjn 5OwX3oTmK5ouLl/du3JxUfurO0KeigVf4PiX8ZzxgUeGMefgok2tSohk1VICdEGxouRQs/ QVYdzCGuyaj+yMIMPX6HUQ2HwIPF/1GVumnQAW14Vjlp9xzAmcvW2MbU7oEcvg== Date: Tue, 28 Apr 2026 16:20:40 +0200 From: Alexandre Belloni To: Yury Norov Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Jonathan Cameron , David Lechner , Johannes Berg , David Laight , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Ping-Ke Shih , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Rasmus Villemoes , Hans de Goede , Linus Walleij , Sakari Ailus , Salah Triki , Achim Gratz , Ben Collins , x86@kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org Subject: Re: [PATCH v2 8/9] rtc: rv3032: switch to using FIELD_GET_SIGNED() Message-ID: <202604281420408aa2e078@mail.local> References: <20260427214127.406067-1-ynorov@nvidia.com> <20260427214127.406067-9-ynorov@nvidia.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260427214127.406067-9-ynorov@nvidia.com> X-Last-TLS-Session-Version: TLSv1.3 On 27/04/2026 17:41:25-0400, Yury Norov wrote: > Switch from sign_extend32(FIELD_GET()) to the dedicated > FIELD_GET_SIGNED() and don't calculate the fields length explicitly. > > Signed-off-by: Yury Norov Acked-by: Alexandre Belloni > --- > drivers/rtc/rtc-rv3032.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c > index 6c09da7738e1..6bafdec637ae 100644 > --- a/drivers/rtc/rtc-rv3032.c > +++ b/drivers/rtc/rtc-rv3032.c > @@ -376,7 +376,7 @@ static int rv3032_read_offset(struct device *dev, long *offset) > if (ret < 0) > return ret; > > - steps = sign_extend32(FIELD_GET(RV3032_OFFSET_MSK, value), 5); > + steps = FIELD_GET_SIGNED(RV3032_OFFSET_MSK, value); > > *offset = DIV_ROUND_CLOSEST(steps * OFFSET_STEP_PPT, 1000); > > -- > 2.51.0 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com