Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbdGRINF (ORCPT ); Tue, 18 Jul 2017 04:13:05 -0400 Received: from mail.eperm.de ([89.247.134.16]:60586 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbdGRILE (ORCPT ); Tue, 18 Jul 2017 04:11:04 -0400 From: Stephan =?ISO-8859-1?Q?M=FCller?= To: "Jason A. Donenfeld" , Greg Kroah-Hartman , Arnd Bergmann Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v12 2/4] random: conditionally compile code depending on LRNG Date: Tue, 18 Jul 2017 09:58:31 +0200 Message-ID: <1830340.t0pR7po4tk@positron.chronox.de> In-Reply-To: <3910055.ntkqcq1Chb@positron.chronox.de> References: <3910055.ntkqcq1Chb@positron.chronox.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 32 When selecting the LRNG for compilation, disable add_disk_randomness and its supporting function. CC: Greg Kroah-Hartman CC: Arnd Bergmann CC: Jason A. Donenfeld Signed-off-by: Stephan Mueller --- include/linux/genhd.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e619fae..7e08ebc 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -422,8 +422,13 @@ extern void disk_flush_events(struct gendisk *disk, unsigned int mask); extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); /* drivers/char/random.c */ +#ifdef CONFIG_LRNG +#define add_disk_randomness(disk) do {} while (0) +#define rand_initialize_disk(disk) do {} while (0) +#else extern void add_disk_randomness(struct gendisk *disk) __latent_entropy; extern void rand_initialize_disk(struct gendisk *disk); +#endif static inline sector_t get_start_sect(struct block_device *bdev) { -- 2.9.4