Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: libfc: Move scsi/fc_encode.h to libfc

Most of this file is only used inside of libfc, so move it to where it is
actually used, with only fc_fill_fc_hdr() left inside of the header.

Link: https://lore.kernel.org/r/20201026160705.3706396-1-arnd@kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Arnd Bergmann and committed by
Martin K. Petersen
e31ac898 ae6b4e69

+36 -39
-1
drivers/scsi/bnx2fc/bnx2fc.h
··· 51 51 #include <scsi/scsi_tcq.h> 52 52 #include <scsi/libfc.h> 53 53 #include <scsi/libfcoe.h> 54 - #include <scsi/fc_encode.h> 55 54 #include <scsi/scsi_transport.h> 56 55 #include <scsi/scsi_transport_fc.h> 57 56 #include <scsi/fc/fc_fip.h>
+1 -1
drivers/scsi/libfc/fc_elsct.c
··· 15 15 #include <scsi/fc/fc_ns.h> 16 16 #include <scsi/fc/fc_els.h> 17 17 #include <scsi/libfc.h> 18 - #include <scsi/fc_encode.h> 18 + #include "fc_encode.h" 19 19 #include "fc_libfc.h" 20 20 21 21 /**
-1
drivers/scsi/libfc/fc_exch.c
··· 20 20 #include <scsi/fc/fc_fc2.h> 21 21 22 22 #include <scsi/libfc.h> 23 - #include <scsi/fc_encode.h> 24 23 25 24 #include "fc_libfc.h" 26 25
+1 -1
drivers/scsi/libfc/fc_fcp.c
··· 26 26 #include <scsi/fc/fc_fc2.h> 27 27 28 28 #include <scsi/libfc.h> 29 - #include <scsi/fc_encode.h> 30 29 30 + #include "fc_encode.h" 31 31 #include "fc_libfc.h" 32 32 33 33 static struct kmem_cache *scsi_pkt_cachep;
+1 -1
drivers/scsi/libfc/fc_libfc.c
··· 12 12 #include <linux/module.h> 13 13 14 14 #include <scsi/libfc.h> 15 - #include <scsi/fc_encode.h> 16 15 16 + #include "fc_encode.h" 17 17 #include "fc_libfc.h" 18 18 19 19 MODULE_AUTHOR("Open-FCoE.org");
+1 -1
drivers/scsi/libfc/fc_lport.c
··· 84 84 #include <scsi/fc/fc_gs.h> 85 85 86 86 #include <scsi/libfc.h> 87 - #include <scsi/fc_encode.h> 88 87 #include <linux/scatterlist.h> 89 88 89 + #include "fc_encode.h" 90 90 #include "fc_libfc.h" 91 91 92 92 /* Fabric IDs to use for point-to-point mode, chosen on whims. */
+1 -1
drivers/scsi/libfc/fc_rport.c
··· 58 58 #include <asm/unaligned.h> 59 59 60 60 #include <scsi/libfc.h> 61 - #include <scsi/fc_encode.h> 62 61 62 + #include "fc_encode.h" 63 63 #include "fc_libfc.h" 64 64 65 65 static struct workqueue_struct *rport_event_queue;
-1
drivers/scsi/qedf/qedf.h
··· 11 11 #include <scsi/fc/fc_fip.h> 12 12 #include <scsi/fc/fc_fc2.h> 13 13 #include <scsi/scsi_tcq.h> 14 - #include <scsi/fc_encode.h> 15 14 #include <linux/version.h> 16 15 17 16
-1
drivers/target/tcm_fc/tfc_cmd.c
··· 19 19 #include <asm/unaligned.h> 20 20 #include <scsi/scsi_tcq.h> 21 21 #include <scsi/libfc.h> 22 - #include <scsi/fc_encode.h> 23 22 24 23 #include <target/target_core_base.h> 25 24 #include <target/target_core_fabric.h>
-1
drivers/target/tcm_fc/tfc_io.c
··· 28 28 #include <linux/ratelimit.h> 29 29 #include <asm/unaligned.h> 30 30 #include <scsi/libfc.h> 31 - #include <scsi/fc_encode.h> 32 31 33 32 #include <target/target_core_base.h> 34 33 #include <target/target_core_fabric.h>
+1 -29
include/scsi/fc_encode.h drivers/scsi/libfc/fc_encode.h
··· 9 9 #define _FC_ENCODE_H_ 10 10 #include <asm/unaligned.h> 11 11 #include <linux/utsname.h> 12 + #include <scsi/fc/fc_ms.h> 12 13 13 14 /* 14 15 * F_CTL values for simple requests and responses. ··· 39 38 struct fc_fdmi_dhba dhba; 40 39 } payload; 41 40 }; 42 - 43 - static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh, 44 - enum fc_rctl r_ctl, 45 - u32 did, u32 sid, enum fc_fh_type type, 46 - u32 f_ctl, u32 parm_offset) 47 - { 48 - WARN_ON(r_ctl == 0); 49 - fh->fh_r_ctl = r_ctl; 50 - hton24(fh->fh_d_id, did); 51 - hton24(fh->fh_s_id, sid); 52 - fh->fh_type = type; 53 - hton24(fh->fh_f_ctl, f_ctl); 54 - fh->fh_cs_ctl = 0; 55 - fh->fh_df_ctl = 0; 56 - fh->fh_parm_offset = htonl(parm_offset); 57 - } 58 - 59 - /** 60 - * fill FC header fields in specified fc_frame 61 - */ 62 - static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, 63 - u32 did, u32 sid, enum fc_fh_type type, 64 - u32 f_ctl, u32 parm_offset) 65 - { 66 - struct fc_frame_header *fh; 67 - 68 - fh = fc_frame_header_get(fp); 69 - __fc_fill_fc_hdr(fh, r_ctl, did, sid, type, f_ctl, parm_offset); 70 - } 71 41 72 42 /** 73 43 * fc_adisc_fill() - Fill in adisc request frame
+30
include/scsi/fc_frame.h
··· 246 246 */ 247 247 void fc_frame_leak_check(void); 248 248 249 + static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh, 250 + enum fc_rctl r_ctl, 251 + u32 did, u32 sid, enum fc_fh_type type, 252 + u32 f_ctl, u32 parm_offset) 253 + { 254 + WARN_ON(r_ctl == 0); 255 + fh->fh_r_ctl = r_ctl; 256 + hton24(fh->fh_d_id, did); 257 + hton24(fh->fh_s_id, sid); 258 + fh->fh_type = type; 259 + hton24(fh->fh_f_ctl, f_ctl); 260 + fh->fh_cs_ctl = 0; 261 + fh->fh_df_ctl = 0; 262 + fh->fh_parm_offset = htonl(parm_offset); 263 + } 264 + 265 + /** 266 + * fill FC header fields in specified fc_frame 267 + */ 268 + static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, 269 + u32 did, u32 sid, enum fc_fh_type type, 270 + u32 f_ctl, u32 parm_offset) 271 + { 272 + struct fc_frame_header *fh; 273 + 274 + fh = fc_frame_header_get(fp); 275 + __fc_fill_fc_hdr(fh, r_ctl, did, sid, type, f_ctl, parm_offset); 276 + } 277 + 278 + 249 279 #endif /* _FC_FRAME_H_ */