]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: ufs: Minimize #include directives
authorBart Van Assche <bvanassche@acm.org>
Tue, 19 Apr 2022 22:58:08 +0000 (15:58 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Apr 2022 03:23:04 +0000 (23:23 -0400)
Follow the convention that is used elsewhere in the Linux kernel source
code and only include those headers of which the declarations are used
directly.

Link: https://lore.kernel.org/r/20220419225811.4127248-26-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
23 files changed:
drivers/scsi/ufs/cdns-pltfrm.c
drivers/scsi/ufs/tc-dwc-g210-pci.c
drivers/scsi/ufs/tc-dwc-g210-pltfrm.c
drivers/scsi/ufs/tc-dwc-g210.c
drivers/scsi/ufs/tc-dwc-g210.h
drivers/scsi/ufs/ufs-exynos.c
drivers/scsi/ufs/ufs-hisi.c
drivers/scsi/ufs/ufs-mediatek.c
drivers/scsi/ufs/ufs-qcom-ice.c
drivers/scsi/ufs/ufs-qcom.c
drivers/scsi/ufs/ufs-sysfs.c
drivers/scsi/ufs/ufs-sysfs.h
drivers/scsi/ufs/ufs_bsg.c
drivers/scsi/ufs/ufs_bsg.h
drivers/scsi/ufs/ufshcd-crypto.h
drivers/scsi/ufs/ufshcd-dwc.c
drivers/scsi/ufs/ufshcd-dwc.h
drivers/scsi/ufs/ufshcd-pci.c
drivers/scsi/ufs/ufshcd-pltfrm.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h
drivers/scsi/ufs/ufshci.h
drivers/scsi/ufs/ufshpb.c

index e91cf9fd5a9568cac4da29c5363e5b18c13f6946..e05c0ae64eea47e8e1fea3d9aea01b0086acbbf0 100644 (file)
@@ -9,6 +9,7 @@
  *
  */
 
+#include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
index 7b08e2e07cc5fd009815a6bf1377ca96e8a9fc77..e635c211c78389bc88453c07e740b432bdbbd413 100644 (file)
@@ -11,6 +11,7 @@
 #include "ufshcd-dwc.h"
 #include "tc-dwc-g210.h"
 
+#include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 
index 783ec43efa78949266112b9bc368935a78027ec2..f15a84d0c176b6edd564de450e7f34a3d0f93ca7 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/delay.h>
+#include <linux/pm_runtime.h>
 
 #include "ufshcd-pltfrm.h"
 #include "ufshcd-dwc.h"
index f954a68f6b4cc0e79b00b380e97fe2f7adcd432c..7ef67c9fc5b835c9597b98d964a771101b3e549b 100644 (file)
@@ -7,6 +7,8 @@
  * Authors: Joao Pinto <jpinto@synopsys.com>
  */
 
+#include <linux/module.h>
+
 #include "ufshcd.h"
 #include "unipro.h"
 
index 5a506da03f4a9ada436c7545bad2557fc819e38c..f7154012f5c7b61d5bd62452da78a600599ad15b 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef _TC_DWC_G210_H
 #define _TC_DWC_G210_H
 
+struct ufs_hba;
+
 int tc_dwc_g210_config_40_bit(struct ufs_hba *hba);
 int tc_dwc_g210_config_20_bit(struct ufs_hba *hba);
 
index 0b99c74955ef113c2aabd15df966e35667ec887a..ddb2d42605c532ecffa92db68cc83d6fbff47bfb 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
index ab1a7ebd89b1ce808ead593ace5d068eaf6f88da..7046143063ee6963c1cc84d3f34f6c53c7277a9a 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <linux/time.h>
+#include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/dma-mapping.h>
index 84ccb5258736e5306a1711f6092bbdcaf3b5acce..083d6bd4d561bf7655e0c7452a1a8fc3f1b89f04 100644 (file)
@@ -8,6 +8,9 @@
 
 #include <linux/arm-smccc.h>
 #include <linux/bitfield.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
index 921d6a93b653ca8a39ebed88fc0f2a5b06751550..745e48ec598f8016722b45546451eae149508181 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright 2019 Google LLC
  */
 
+#include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/qcom_scm.h>
 
index 150a8313dcdbbf5223a57607d35dc366c5cd3c79..d18bc534c62de36368e41384ba121c14f70b0dac 100644 (file)
@@ -5,6 +5,9 @@
 
 #include <linux/acpi.h>
 #include <linux/time.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/phy/phy.h>
@@ -18,6 +21,7 @@
 #include "ufs-qcom.h"
 #include "ufshci.h"
 #include "ufs_quirks.h"
+
 #define UFS_QCOM_DEFAULT_DBG_PRINT_EN  \
        (UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN)
 
index 5c405ff7b6eaa2071a02bfa72023689692d40b50..95a4e64ce40145a5414f6b35b153f302c58d5c29 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "ufs.h"
 #include "ufs-sysfs.h"
+#include "ufshcd.h"
 
 static const char *ufshcd_uic_link_state_to_string(
                        enum uic_link_state state)
index 0f4e750a6748146198bc9dc24a9553dd80dbf60e..8d94af3b80771932557a7ab66a57afbe81413e00 100644 (file)
@@ -7,11 +7,12 @@
 
 #include <linux/sysfs.h>
 
-#include "ufshcd.h"
+struct device;
 
 void ufs_sysfs_add_nodes(struct device *dev);
 void ufs_sysfs_remove_nodes(struct device *dev);
 
 extern const struct attribute_group ufs_sysfs_unit_descriptor_group;
 extern const struct attribute_group ufs_sysfs_lun_attributes_group;
+
 #endif
index 39bf204c6ec3e4e63e2aedce487e798f075fb1d7..fbcdfb7135420ffbb22e555c2246d0209d3e856b 100644 (file)
@@ -4,7 +4,12 @@
  *
  * Copyright (C) 2018 Western Digital Corporation
  */
+
+#include <linux/bsg-lib.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_host.h>
 #include "ufs_bsg.h"
+#include "ufshcd.h"
 
 static int ufs_bsg_get_query_desc_size(struct ufs_hba *hba, int *desc_len,
                                       struct utp_upiu_query *qr)
index d0991875863140f5950a620f7c363ac39f895289..57712d2656d2a28dc72f6d390ca607dca5d44205 100644 (file)
@@ -5,12 +5,7 @@
 #ifndef UFS_BSG_H
 #define UFS_BSG_H
 
-#include <linux/bsg-lib.h>
-#include <scsi/scsi.h>
-#include <scsi/scsi_host.h>
-
-#include "ufshcd.h"
-#include "ufs.h"
+struct ufs_hba;
 
 #ifdef CONFIG_SCSI_UFS_BSG
 void ufs_bsg_remove(struct ufs_hba *hba);
index e18c012768732001612a4e0dfb75991811e1805f..57dd51256b57d6163cf881b979a54756e5cd97c7 100644 (file)
@@ -6,9 +6,10 @@
 #ifndef _UFSHCD_CRYPTO_H
 #define _UFSHCD_CRYPTO_H
 
-#ifdef CONFIG_SCSI_UFS_CRYPTO
+#include <scsi/scsi_cmnd.h>
 #include "ufshcd.h"
-#include "ufshci.h"
+
+#ifdef CONFIG_SCSI_UFS_CRYPTO
 
 static inline void ufshcd_prepare_lrbp_crypto(struct request *rq,
                                              struct ufshcd_lrb *lrbp)
index 5bb9d3a88795c305e2fb73e248b5b1132bfa4e8f..a57973c8d2a122bbdceee32d4389cb68428761ed 100644 (file)
@@ -7,6 +7,8 @@
  * Authors: Joao Pinto <jpinto@synopsys.com>
  */
 
+#include <linux/module.h>
+
 #include "ufshcd.h"
 #include "unipro.h"
 
index 4268ca2eb64c03e50e22481f47cd6b74f61617fd..43b70794e24ff4d5d18ac143da70cb011d1b2897 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef _UFSHCD_DWC_H
 #define _UFSHCD_DWC_H
 
+#include "ufshcd.h"
+
 struct ufshcd_dme_attr_val {
        u32 attr_sel;
        u32 mib_val;
index 270ec675d15cc75319bb15c3b86b98b3eac32393..20af2fbc3af145f5119300e563eee101682c6d13 100644 (file)
@@ -10,6 +10,8 @@
  */
 
 #include "ufshcd.h"
+#include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/pm_qos.h>
index fc51911011920b1b14a7b0aa7bfb5b6ffbcd2525..f5313f4076175bf022e3f16f428ef773613381ac 100644 (file)
@@ -8,6 +8,7 @@
  *     Vinayak Holikatti <h.vinayak@samsung.com>
  */
 
+#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
index ba6b35f36bcc3fab5c8e085d3572c01cf8cc8eb7..bac4ae63eb20c42234229ac15ef8e0d700abc441 100644 (file)
 #include <linux/bitfield.h>
 #include <linux/blk-pm.h>
 #include <linux/blkdev.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/nls.h>
+#include <linux/regulator/consumer.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_driver.h>
+#include <scsi/scsi_eh.h>
 #include "ufshcd.h"
 #include "ufs_quirks.h"
 #include "unipro.h"
index b42ed2fcc4593bcbc944f6637d3c5b8de8ed3f17..ca36d8354f112a07b7460d35f538d26617f52f3f 100644 (file)
 #ifndef _UFSHCD_H
 #define _UFSHCD_H
 
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include <linux/rwsem.h>
-#include <linux/workqueue.h>
-#include <linux/errno.h>
-#include <linux/types.h>
-#include <linux/wait.h>
-#include <linux/bitops.h>
-#include <linux/pm_runtime.h>
-#include <linux/clk.h>
-#include <linux/completion.h>
-#include <linux/regulator/consumer.h>
 #include <linux/bitfield.h>
-#include <linux/devfreq.h>
 #include <linux/blk-crypto-profile.h>
+#include <linux/blk-mq.h>
+#include <linux/devfreq.h>
+#include <linux/pm_runtime.h>
+#include <scsi/scsi_device.h>
 #include "unipro.h"
-
-#include <asm/irq.h>
-#include <asm/byteorder.h>
-#include <scsi/scsi.h>
-#include <scsi/scsi_cmnd.h>
-#include <scsi/scsi_host.h>
-#include <scsi/scsi_tcq.h>
-#include <scsi/scsi_dbg.h>
-#include <scsi/scsi_eh.h>
-
 #include "ufs.h"
 #include "ufs_quirks.h"
 #include "ufshci.h"
index a7ff0e5b54946d3e367c6c482c19bfea78462b19..f81aa95ffbc40b490eb3fe3fd64f8b8deb0960c8 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef _UFSHCI_H
 #define _UFSHCI_H
 
+#include <scsi/scsi_host.h>
+
 enum {
        TASK_REQ_UPIU_SIZE_DWORDS       = 8,
        TASK_RSP_UPIU_SIZE_DWORDS       = 8,
index 40f365c537f5877d2060f422604aa12ef5cda9a2..68c97a2e825c478b08e0432cb4735405b629e1b4 100644 (file)
  */
 
 #include <asm/unaligned.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <scsi/scsi_cmnd.h>
 
 #include "ufshcd.h"
 #include "ufshpb.h"