Skip to content

Commit 704ed03

Browse files
damien-lemoalmartinkpetersen
authored andcommitted
scsi: libsas: Move declarations of internal functions to sas_internal.h
Move the declaration of all functions used only within libsas from include/scsi/sas_ata.h to drivers/scsi/libsas/sas_internal.h. No functional changes. Signed-off-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Jason Yan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent bd31394 commit 704ed03

File tree

2 files changed

+75
-67
lines changed

2 files changed

+75
-67
lines changed

drivers/scsi/libsas/sas_internal.h

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,78 @@ static inline void sas_put_device(struct domain_device *dev)
222222
kref_put(&dev->kref, sas_free_device);
223223
}
224224

225+
#ifdef CONFIG_SCSI_SAS_ATA
226+
227+
int sas_ata_init(struct domain_device *dev);
228+
void sas_ata_task_abort(struct sas_task *task);
229+
int sas_discover_sata(struct domain_device *dev);
230+
int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
231+
struct domain_device *child, int phy_id);
232+
void sas_ata_strategy_handler(struct Scsi_Host *shost);
233+
void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q);
234+
void sas_ata_end_eh(struct ata_port *ap);
235+
void sas_ata_wait_eh(struct domain_device *dev);
236+
void sas_probe_sata(struct asd_sas_port *port);
237+
void sas_suspend_sata(struct asd_sas_port *port);
238+
void sas_resume_sata(struct asd_sas_port *port);
239+
240+
#else
241+
242+
static inline int sas_ata_init(struct domain_device *dev)
243+
{
244+
return 0;
245+
}
246+
247+
static inline void sas_ata_task_abort(struct sas_task *task)
248+
{
249+
}
250+
251+
static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
252+
{
253+
}
254+
255+
static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q)
256+
{
257+
}
258+
259+
static inline void sas_ata_end_eh(struct ata_port *ap)
260+
{
261+
}
262+
263+
static inline void sas_ata_wait_eh(struct domain_device *dev)
264+
{
265+
}
266+
267+
static inline void sas_probe_sata(struct asd_sas_port *port)
268+
{
269+
}
270+
271+
static inline void sas_suspend_sata(struct asd_sas_port *port)
272+
{
273+
}
274+
275+
static inline void sas_resume_sata(struct asd_sas_port *port)
276+
{
277+
}
278+
279+
static inline void sas_ata_disabled_notice(void)
280+
{
281+
pr_notice_once("ATA device seen but CONFIG_SCSI_SAS_ATA=N\n");
282+
}
283+
284+
static inline int sas_discover_sata(struct domain_device *dev)
285+
{
286+
sas_ata_disabled_notice();
287+
return -ENXIO;
288+
}
289+
290+
static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
291+
struct domain_device *child, int phy_id)
292+
{
293+
sas_ata_disabled_notice();
294+
return -ENODEV;
295+
}
296+
297+
#endif
298+
225299
#endif /* _SAS_INTERNAL_H_ */

include/scsi/sas_ata.h

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -28,77 +28,24 @@ static inline bool dev_is_sata(struct domain_device *dev)
2828
}
2929
}
3030

31-
int sas_ata_init(struct domain_device *dev);
32-
void sas_ata_task_abort(struct sas_task *task);
33-
void sas_ata_strategy_handler(struct Scsi_Host *shost);
34-
void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q);
3531
void sas_ata_schedule_reset(struct domain_device *dev);
36-
void sas_ata_wait_eh(struct domain_device *dev);
37-
void sas_probe_sata(struct asd_sas_port *port);
38-
void sas_suspend_sata(struct asd_sas_port *port);
39-
void sas_resume_sata(struct asd_sas_port *port);
40-
void sas_ata_end_eh(struct ata_port *ap);
4132
void sas_ata_device_link_abort(struct domain_device *dev, bool force_reset);
42-
int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
43-
int force_phy_id);
33+
int sas_execute_ata_cmd(struct domain_device *device, u8 *fis, int force_phy_id);
4434
int smp_ata_check_ready_type(struct ata_link *link);
45-
int sas_discover_sata(struct domain_device *dev);
46-
int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
47-
struct domain_device *child, int phy_id);
4835

4936
extern const struct attribute_group sas_ata_sdev_attr_group;
5037

5138
#else
5239

53-
static inline void sas_ata_disabled_notice(void)
54-
{
55-
pr_notice_once("ATA device seen but CONFIG_SCSI_SAS_ATA=N\n");
56-
}
57-
5840
static inline bool dev_is_sata(struct domain_device *dev)
5941
{
6042
return false;
6143
}
62-
static inline int sas_ata_init(struct domain_device *dev)
63-
{
64-
return 0;
65-
}
66-
static inline void sas_ata_task_abort(struct sas_task *task)
67-
{
68-
}
69-
70-
static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
71-
{
72-
}
73-
74-
static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q)
75-
{
76-
}
7744

7845
static inline void sas_ata_schedule_reset(struct domain_device *dev)
7946
{
8047
}
8148

82-
static inline void sas_ata_wait_eh(struct domain_device *dev)
83-
{
84-
}
85-
86-
static inline void sas_probe_sata(struct asd_sas_port *port)
87-
{
88-
}
89-
90-
static inline void sas_suspend_sata(struct asd_sas_port *port)
91-
{
92-
}
93-
94-
static inline void sas_resume_sata(struct asd_sas_port *port)
95-
{
96-
}
97-
98-
static inline void sas_ata_end_eh(struct ata_port *ap)
99-
{
100-
}
101-
10249
static inline void sas_ata_device_link_abort(struct domain_device *dev,
10350
bool force_reset)
10451
{
@@ -115,19 +62,6 @@ static inline int smp_ata_check_ready_type(struct ata_link *link)
11562
return 0;
11663
}
11764

118-
static inline int sas_discover_sata(struct domain_device *dev)
119-
{
120-
sas_ata_disabled_notice();
121-
return -ENXIO;
122-
}
123-
124-
static inline int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
125-
struct domain_device *child, int phy_id)
126-
{
127-
sas_ata_disabled_notice();
128-
return -ENODEV;
129-
}
130-
13165
#define sas_ata_sdev_attr_group ((struct attribute_group) {})
13266

13367
#endif

0 commit comments

Comments
 (0)