From nobody Tue Dec 16 16:37:15 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F71DC38142 for ; Fri, 19 Aug 2022 16:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352898AbiHSQZs (ORCPT ); Fri, 19 Aug 2022 12:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352476AbiHSQVF (ORCPT ); Fri, 19 Aug 2022 12:21:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4482649; Fri, 19 Aug 2022 09:02:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 54CCEB8280F; Fri, 19 Aug 2022 16:02:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5E58C433C1; Fri, 19 Aug 2022 16:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924942; bh=WsWSH+oyi1DODDRADVOG7AcofdZtoMJUgq/k2eKaiPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DPO8KRIYD2eIhCMrEx4hCNSv8uh/Du//ub7DW2NCyVauKRyfHguhqiD7jxbiNrbRT hTHxCXCDuMxS+OtHrJy8ytlfX8XymQqK9VDp/4dxPFnUSAT1XO8tHGgGvK7rcMzGUm 3s+VdmiejHKgpd9PtUAmUDRTpKHfXZVGWyvEOC3w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Christopher Obbard , Richard Weinberger , Sasha Levin Subject: [PATCH 5.10 331/545] um: random: Dont initialise hwrng struct with zero Date: Fri, 19 Aug 2022 17:41:41 +0200 Message-Id: <20220819153844.191617220@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Christopher Obbard [ Upstream commit 9e70cbd11b03889c92462cf52edb2bd023c798fa ] Initialising the hwrng struct with zeros causes a compile-time sparse warning: $ ARCH=3Dum make -j10 W=3D1 C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDI= AN__' ... CHECK arch/um/drivers/random.c arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NU= LL pointer Fix the warning by not initialising the hwrng struct with zeros as it is initialised anyway during module init. Fixes: 72d3e093afae ("um: random: Register random as hwrng-core device") Reported-by: kernel test robot Signed-off-by: Christopher Obbard Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/drivers/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c index e4b9b2ce9abf..4b712395763e 100644 --- a/arch/um/drivers/random.c +++ b/arch/um/drivers/random.c @@ -28,7 +28,7 @@ * protects against a module being loaded twice at the same time. */ static int random_fd =3D -1; -static struct hwrng hwrng =3D { 0, }; +static struct hwrng hwrng; static DECLARE_COMPLETION(have_data); =20 static int rng_dev_read(struct hwrng *rng, void *buf, size_t max, bool blo= ck) --=20 2.35.1