From nobody Wed May 1 19:56:54 2024 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 A81B9C433EF for ; Thu, 23 Jun 2022 08:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231150AbiFWI7k (ORCPT ); Thu, 23 Jun 2022 04:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbiFWI7h (ORCPT ); Thu, 23 Jun 2022 04:59:37 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC6B46B08 for ; Thu, 23 Jun 2022 01:59:35 -0700 (PDT) Received: from obbardc-laptop.home (unknown [IPv6:2a00:23c7:6883:e501:cf51:f3a2:10b5:accf]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: obbardc) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9B2916601792; Thu, 23 Jun 2022 09:59:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655974774; bh=tNnhHE/pxNIYHGG07KwvxWQNy+bn16D63BRweA5Ufe4=; h=From:To:Cc:Subject:Date:From; b=Jr2GXnsxgl2QnfHLSRKrh6dD7Ton6WvbHxOp/Zk57RTmXqo+lUcXCrnZHhbF0yQUT W1Ty//O9pAJZEP2C1vJPpX0149nvHHRVfaH2a+nAMiv5+s9v+3n2iwi5yltjlzKdhK DMGbRwGMiaZF/VF4tx9WuWunaUi7XERouMFzUv16vgFzfL0A2buI5OhR2X93X0dynn bcGPTgOATjdr+aEMLqJcaOTpWiJpaMj2+cJY1LRIykAmkWxszJ+7bcdDebwlDvCUCF 1ta3ys7O9s7E0M3+95JHf1xyQn8kEJ1vV8nnyTF1fYN4cK0ySVpVMhN6JJz/tNv3NW vVN9OOraG0vrw== From: Christopher Obbard To: linux-um@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Richard Weinberger , Anton Ivanov , Johannes Berg , kernel@collabora.com, Christopher Obbard , kernel test robot Subject: [PATCH] um: random: Don't initialise hwrng struct with zero Date: Thu, 23 Jun 2022 09:58:42 +0100 Message-Id: <20220623085842.238829-1-chris.obbard@collabora.com> X-Mailer: git-send-email 2.36.1 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" 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 --- 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 433a3f8f2ef3..32b3341fe970 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.36.1