From patchwork Thu Jun 23 08:58:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Obbard X-Patchwork-Id: 1646944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=RTpH5Vm4; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=Jr2GXnsx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LTDj64Ht8z9sGP for ; Thu, 23 Jun 2022 18:59:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Au6ewZTtuKUC6TiHVOjuJHKSVPmdqZQ+kZgtMsGooGU=; b=RTpH5Vm4A3s4n7 89T75Ydsv3SSGw9Gb7tn/spGSUiRrmTUaSmJVDczdRZwQuvX8MDVx4E8LeMz3YTkHuV2zEH4HNmUJ tF5CxgmYHysFPBbVqLVVwRwAUQFAeTiKhdXqVt1/+xxsatSCNXTbfNxk4N9B0i2zVmzgYEDfwxxEC IUeIdC+PWuEWXP42AuPXEhHLq33cOfdHQIZAcbVFpWQwgJNj9YIKGRZVg5KmyAuSZctfy2ctoAcUr Wbk86xO7tU22Z1nJ7Wx6fmHIWk3Z6uHchRxqK6rIKhkJrtTXE8CZUyAg9BR8t+KprjGT+Bihq+1Tq 7AhqGtzwMgYKUFrnTykw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Igg-00EDmr-01; Thu, 23 Jun 2022 08:59:42 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4Igb-00EDke-Pb for linux-um@lists.infradead.org; Thu, 23 Jun 2022 08:59:39 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220623_015937_996623_ED8A211B X-CRM114-Status: GOOD ( 10.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Initialising the hwrng struct with zeros causes a compile-time sparse warning: $ ARCH=um make -j10 W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ... CHECK arch/um/drivers/random.c arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NULL pointer Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Initialising the hwrng struct with zeros causes a compile-time sparse warning: $ ARCH=um make -j10 W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ... CHECK arch/um/drivers/random.c arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NULL 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 = -1; -static struct hwrng hwrng = { 0, }; +static struct hwrng hwrng; static DECLARE_COMPLETION(have_data); static int rng_dev_read(struct hwrng *rng, void *buf, size_t max, bool block)