Message ID | 212adb212cb0234a7d395daf31b2578b9409d492.1670015476.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1075312wrr; Fri, 2 Dec 2022 13:20:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dtWGVa/GEV5+mJZRuuIBsI2yL49+ChDpfnVLtRpCbbjDVBuy2vmEvguTjMAIrj8S+WVro X-Received: by 2002:a05:6402:370d:b0:462:1a67:75ef with SMTP id ek13-20020a056402370d00b004621a6775efmr48507753edb.16.1670016017163; Fri, 02 Dec 2022 13:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670016017; cv=none; d=google.com; s=arc-20160816; b=NISXCBPY2nAjncoT0BnsbTWMOfegp4iv9m+MTYf8yg4rw9sBOXWpcC2wV+iI7AYeHt Pj8017UFyqwqJFLEGpPpfZDfyI9ytT60XlDSnWYYZfVFrbgnQ8eFApK+/76Jm8xorOBe jDBrrKKrw4zP/fiHJ0lanS4Y4f5v9bJwHyeHHZNI4QEOEAxIhfwa0Bc6tuFONnzQxjQj RFmjZtq6ic64uORh4UmgjBlFW+vz5peupl+tBixEwrxjhr7Ef0vDhJxl1TwlaHmiFrpw GiD7NHuXOQYQBbt0B79i8+QbMbjcrOwtfbfJ+BId1qSE9Mczdsy35393Txfyhj5EhOZ/ HdVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8IgX9uRAa6v6jxaCOQ9tSIIhjVYisn9SfCFshShQU/A=; b=BcIk6Zzg7H5AsCkqQJdUzk8bnHxSBSoEZSgnoyxK3XgMfC5gcf2NyjMrnJAGNMS2lY +mE3s73x7X5de/pAybKRbbiTCLX9OJjpyKGaNvzel0kPl5g3aXRP4DiplWH/XEOyb5MO L1d6NKCzujU8Y/1nxvMM0X9ms4/tAH5bQZD00cxkY8W0DHABRmOtLq8SHQU0FvgrXDag qyPmwroXde81tL3/djwZm0hztPkRyDQOJUBGAwlIbWasL9xuNYMkklwaoBM2wq1ZC99d GPAFzkpU8TAM5QimPaQsNARvrDAyLUssn5aGWesewBk3pByaLTS52yrbM1IF6cxSh4Kg M0uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg11-20020a170907a40b00b0078df3bd80b9si7396089ejc.46.2022.12.02.13.19.53; Fri, 02 Dec 2022 13:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbiLBVNq (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 16:13:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234097AbiLBVNn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 16:13:43 -0500 Received: from smtp.smtpout.orange.fr (smtp-12.smtpout.orange.fr [80.12.242.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD34DB1E9 for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 13:13:41 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 1DLlpPcSnM75k1DLlp2pVY; Fri, 02 Dec 2022 22:13:39 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 02 Dec 2022 22:13:39 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Jason@zx2c4.com, kuba@kernel.org, tytso@mit.edu, elver@google.com, yury.norov@gmail.com, linux@dominikbrodowski.net, gregkh@linuxfoundation.org, pmladek@suse.com, keescook@chromium.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH] random: Include <linux/once.h> in the right header Date: Fri, 2 Dec 2022 22:13:36 +0100 Message-Id: <212adb212cb0234a7d395daf31b2578b9409d492.1670015476.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751138715317815847?= X-GMAIL-MSGID: =?utf-8?q?1751138715317815847?= |
Series |
random: Include <linux/once.h> in the right header
|
|
Commit Message
Christophe JAILLET
Dec. 2, 2022, 9:13 p.m. UTC
<linux/prandom.h> uses DO_ONCE(). So it should include <linux/once.h>
directly.
On the contrary, <linux/random.h> doesn't use functionalities from
<linux/once.h>, so it should be removed.
All this is true since commit c0842fbc1b18 ("random32: move the
pseudo-random 32-bit definitions to prandom.h")
Move the #include <linux/once.h> in the right file.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Let see if build-bots agree with me!
---
include/linux/prandom.h | 1 +
include/linux/random.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Dec 02, 2022 at 10:13:36PM +0100, Christophe JAILLET wrote: > <linux/prandom.h> uses DO_ONCE(). So it should include <linux/once.h> > directly. > > On the contrary, <linux/random.h> doesn't use functionalities from > <linux/once.h>, so it should be removed. > > All this is true since commit c0842fbc1b18 ("random32: move the > pseudo-random 32-bit definitions to prandom.h") > > Move the #include <linux/once.h> in the right file. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Kees Cook <keescook@chromium.org>
Hi Christophe, On Fri, Dec 02, 2022 at 10:13:36PM +0100, Christophe JAILLET wrote: > <linux/prandom.h> uses DO_ONCE(). So it should include <linux/once.h> > directly. > > On the contrary, <linux/random.h> doesn't use functionalities from > <linux/once.h>, so it should be removed. > > All this is true since commit c0842fbc1b18 ("random32: move the > pseudo-random 32-bit definitions to prandom.h") > > Move the #include <linux/once.h> in the right file. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Thanks, applied for now as: https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?id=1ea746beac98ad11132b0a9a11978d5cf0a055ef > --- > Let see if build-bots agree with me! Indeed. I've got a few builds of my own going, and so far so good, but we'll learn soon enough if something goes wrong. Jason
diff --git a/include/linux/prandom.h b/include/linux/prandom.h index 1f4a0de7b019..c94c02ba065c 100644 --- a/include/linux/prandom.h +++ b/include/linux/prandom.h @@ -9,6 +9,7 @@ #define _LINUX_PRANDOM_H #include <linux/types.h> +#include <linux/once.h> #include <linux/percpu.h> #include <linux/random.h> diff --git a/include/linux/random.h b/include/linux/random.h index b1a34181eed6..4a2a1de423cd 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -6,7 +6,6 @@ #include <linux/bug.h> #include <linux/kernel.h> #include <linux/list.h> -#include <linux/once.h> #include <uapi/linux/random.h>