iov_iter: Move unnecessary inclusion of crypto/hash.h
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Jun 2020 06:57:37 +0000 (16:57 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 30 Jun 2020 13:34:23 +0000 (09:34 -0400)
The header file linux/uio.h includes crypto/hash.h which pulls in
most of the Crypto API.  Since linux/uio.h is used throughout the
kernel this means that every tiny bit of change to the Crypto API
causes the entire kernel to get rebuilt.

This patch fixes this by moving it into lib/iov_iter.c instead
where it is actually used.

This patch also fixes the ifdef to use CRYPTO_HASH instead of just
CRYPTO which does not guarantee the existence of ahash.

Unfortunately a number of drivers were relying on linux/uio.h to
provide access to linux/slab.h.  This patch adds inclusions of
linux/slab.h as detected by build failures.

Also skbuff.h was relying on this to provide a declaration for
ahash_request.  This patch adds a forward declaration instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
14 files changed:
arch/s390/lib/test_unwind.c
drivers/dma/sf-pdma/sf-pdma.c
drivers/dma/st_fdma.c
drivers/dma/uniphier-xdmac.c
drivers/misc/uacce/uacce.c
drivers/mtd/mtdpstore.c
drivers/mtd/nand/raw/cadence-nand-controller.c
drivers/remoteproc/qcom_q6v5_mss.c
drivers/soc/qcom/pdr_interface.c
fs/btrfs/inode.c
include/linux/skbuff.h
include/linux/socket.h
include/linux/uio.h
lib/iov_iter.c

index 32b7a30b2485d53f9dede2756ddfb7ce105bc4da..eb382ceaa116117f792e59435648b5f5aa73bfe9 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/kallsyms.h>
 #include <linux/kthread.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/kprobes.h>
 #include <linux/wait.h>
index 5c118c7e02bdc2d65e1ee8961000c1893ee80db4..6e530dca6d9e8f674eb5bb1dfe5e9f30525752b8 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
+#include <linux/slab.h>
 
 #include "sf-pdma.h"
 
index 67087dbe2f9facd8690616304ab7eb1e076c6e8a..962b6e05287b5f46f03dcb7df7a0f56cf9c7c80c 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/remoteproc.h>
+#include <linux/slab.h>
 
 #include "st_fdma.h"
 
index 7b2f8a8c2d31939699a70b2a6c7bd3fd648ab7ed..16b19654873dfdddc94674cdc08670bd00107fcf 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/of.h>
 #include <linux/of_dma.h>
 #include <linux/platform_device.h>
+#include <linux/slab.h>
 
 #include "dmaengine.h"
 #include "virt-dma.h"
index 107028e77ca3753bb88cfade001609f42b95b345..e45bfd409cc548e5a542bc412770a4a9f2fd7fa0 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/iommu.h>
 #include <linux/module.h>
 #include <linux/poll.h>
+#include <linux/slab.h>
 #include <linux/uacce.h>
 
 static struct class *uacce_class;
index a4fe6060b960f7c83539d15e3429ccaffff13195..a3ae8778f6a9b90312a7846e61b959911ab814e7 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/pstore_blk.h>
 #include <linux/mtd/mtd.h>
 #include <linux/bitops.h>
+#include <linux/slab.h>
 
 static struct mtdpstore_context {
        int index;
index c405722adfe1073638d4e8bee00e6cc1ae81ca32..c4f273e2fe78f7f99d5a6fc854567cfece4e2ae7 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/of_device.h>
 #include <linux/iopoll.h>
+#include <linux/slab.h>
 
 /*
  * HPNFC can work in 3 modes:
index feb70283b6a21c1af60861667f1a11d35faef788..903b2bb97e122234f8158208a04e9d922c674d38 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/reset.h>
 #include <linux/soc/qcom/mdt_loader.h>
 #include <linux/iopoll.h>
+#include <linux/slab.h>
 
 #include "remoteproc_internal.h"
 #include "qcom_common.h"
index bdcf16f88a97fd2595d1add3b2a981da6b2d1bb9..a90d707da68943ef6eb7f6ef2a62ea2fe6d2bb7a 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/workqueue.h>
 
index d04c82c8841817e203312889edf66110360539e3..d901d53e4f03baeb6ab610bbc6dfe75f16c19dec 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (C) 2007 Oracle.  All rights reserved.
  */
 
+#include <crypto/hash.h>
 #include <linux/kernel.h>
 #include <linux/bio.h>
 #include <linux/buffer_head.h>
index 0c0377fc00c2a4aed7b796bb5afb2bf5b171b3bf..1530e81a6cce730c14867c5fe2a7bfcf8048ce2b 100644 (file)
                         SKB_DATA_ALIGN(sizeof(struct sk_buff)) +       \
                         SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
 
+struct ahash_request;
 struct net_device;
 struct scatterlist;
 struct pipe_inode_info;
index 04d2bc97f497d07813ea5dfa780d93a007eadad4..e9cb30d8cbfb1979a3dc16cd61f565bdfd4ddbb7 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/compiler.h>            /* __user                       */
 #include <uapi/linux/socket.h>
 
+struct file;
 struct pid;
 struct cred;
 struct socket;
index 9576fd8158d7d05c6dc27bd38cf04317fc3b5edc..3835a8a8e9eae0a97a21b93ddbc147a058bb67cb 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <linux/kernel.h>
 #include <linux/thread_info.h>
-#include <crypto/hash.h>
 #include <uapi/linux/uio.h>
 
 struct page;
index bf538c2bec777f4efde6ee468f475aa400c06e0b..5e40786c8f123254bcc6272b67769ccc0ed040ed 100644 (file)
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
+#include <crypto/hash.h>
 #include <linux/export.h>
 #include <linux/bvec.h>
 #include <linux/uio.h>
@@ -1567,7 +1568,7 @@ EXPORT_SYMBOL(csum_and_copy_to_iter);
 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
                struct iov_iter *i)
 {
-#ifdef CONFIG_CRYPTO
+#ifdef CONFIG_CRYPTO_HASH
        struct ahash_request *hash = hashp;
        struct scatterlist sg;
        size_t copied;