From mboxrd@z Thu Jan 1 00:00:00 1970 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 A2C6CC433EF for ; Mon, 25 Jul 2022 08:34:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbiGYIel (ORCPT ); Mon, 25 Jul 2022 04:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiGYIei (ORCPT ); Mon, 25 Jul 2022 04:34:38 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E391BA5 for ; Mon, 25 Jul 2022 01:34:37 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Lrtd745lSz4x1b; Mon, 25 Jul 2022 18:34:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1658738076; bh=2SHi/7MiYuZZ+RFbqHJ2P9vUPRO0hmbQRyNXAW/lWsQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kVqvVrWP8qwBu33A7IqhqO9r0BeBrUIlk6CRqjtI1NzrQT+0GTPPk7Bdq87u9NJqY FArZqKHMOpyU3GYM8ewX10ZMmvIyVKbJ/xyf2hDajfnYiyUVhc0NaMppu+e+ci/kUJ rtKFjdstnTcCcAayMQgBQDcOyrpplXodiWwWy1KgMpQYUEsp4TBKeyS15aY1LtyY4x HE1wWO2caXRtArMXVDk/7JkvZBeVdgG/UeOLVVYb8Jt6I3BIy8nCb5GP2sJd/NUPPQ SBVSZUGyKt6w3ZzsEjeIZdKaYvTylulmO38M0K7qnHQOp6LRBmZg6T4zsD7WmcXNmz nGG76IHo7HrJw== From: Michael Ellerman To: Yury Norov , linux-kernel@vger.kernel.org, Andy Shevchenko , Rasmus Villemoes , linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Stephen Rothwell Cc: Yury Norov Subject: Re: [PATCH 1/2] powerpc: drop dependency on in archrandom.h In-Reply-To: <20220723214537.2054208-2-yury.norov@gmail.com> References: <20220723214537.2054208-1-yury.norov@gmail.com> <20220723214537.2054208-2-yury.norov@gmail.com> Date: Mon, 25 Jul 2022 18:34:35 +1000 Message-ID: <8735epd204.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > archrandom.h includes to refer ppc_md. This causes > circular header dependency, if generic nodemask.h includes random.h: > > In file included from include/linux/cred.h:16, > from include/linux/seq_file.h:13, > from arch/powerpc/include/asm/machdep.h:6, > from arch/powerpc/include/asm/archrandom.h:5, > from include/linux/random.h:109, > from include/linux/nodemask.h:97, > from include/linux/list_lru.h:12, > from include/linux/fs.h:13, > from include/linux/compat.h:17, > from arch/powerpc/kernel/asm-offsets.c:12: > include/linux/sched.h:1203:9: error: unknown type name 'nodemask_t' > 1203 | nodemask_t mems_allowed; > | ^~~~~~~~~~ > > Fix it by removing dependency from archrandom.h > > Signed-off-by: Yury Norov > --- > arch/powerpc/include/asm/archrandom.h | 9 +-------- > arch/powerpc/kernel/setup-common.c | 11 +++++++++++ > 2 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h > index 9a53e29680f4..21def59ef1a6 100644 > --- a/arch/powerpc/include/asm/archrandom.h > +++ b/arch/powerpc/include/asm/archrandom.h > @@ -4,7 +4,7 @@ > > #ifdef CONFIG_ARCH_RANDOM > > -#include > +bool __must_check arch_get_random_seed_long(unsigned long *v); > > static inline bool __must_check arch_get_random_long(unsigned long *v) > { > @@ -16,13 +16,6 @@ static inline bool __must_check arch_get_random_int(unsigned int *v) > return false; > } > > -static inline bool __must_check arch_get_random_seed_long(unsigned long *v) > -{ > - if (ppc_md.get_random_seed) > - return ppc_md.get_random_seed(v); > - > - return false; > -} I'd rather we didn't have to force this out of line. I think I see a different way to fix it, I'll just do some more build tests. cheers