public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Minor cleanups
@ 2023-09-12  7:47 Damien Le Moal
  2023-09-12  7:47 ` [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Damien Le Moal @ 2023-09-12  7:47 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen, John Garry

3 patches to cleanup libsas functions declarations. No functional
changes.

Damien Le Moal (3):
  scsi: libsas: Move local functions declarations to sas_internal.h
  scsi: libsas: Declare sas_set_phy_speed() static
  scsi: libsas: Declare sas_discover_end_dev() static

 drivers/scsi/libsas/sas_discover.c |  2 +-
 drivers/scsi/libsas/sas_init.c     |  4 ++--
 drivers/scsi/libsas/sas_internal.h | 11 +++++++++++
 include/scsi/libsas.h              | 15 ---------------
 4 files changed, 14 insertions(+), 18 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h
  2023-09-12  7:47 [PATCH 0/3] Minor cleanups Damien Le Moal
@ 2023-09-12  7:47 ` Damien Le Moal
  2023-09-12  8:19   ` John Garry
  2023-09-12  7:47 ` [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static Damien Le Moal
  2023-09-12  7:47 ` [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static Damien Le Moal
  2 siblings, 1 reply; 8+ messages in thread
From: Damien Le Moal @ 2023-09-12  7:47 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen, John Garry

Move the declarations of functions used only within libsas from
include/scsi/libsas.h to drivers/scsi/libsas/sas_internal.h

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/scsi/libsas/sas_internal.h | 11 +++++++++++
 include/scsi/libsas.h              | 12 ------------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h
index a6dc7dc07fce..e597c1620205 100644
--- a/drivers/scsi/libsas/sas_internal.h
+++ b/drivers/scsi/libsas/sas_internal.h
@@ -39,6 +39,17 @@ struct sas_phy_data {
 	struct sas_work enable_work;
 };
 
+void sas_hash_addr(u8 *hashed, const u8 *sas_addr);
+
+int sas_discover_root_expander(struct domain_device *dev);
+
+int sas_ex_revalidate_domain(struct domain_device *dev);
+void sas_unregister_domain_devices(struct asd_sas_port *port, int gone);
+void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port);
+void sas_discover_event(struct asd_sas_port *, enum discover_event ev);
+
+void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev);
+
 void sas_scsi_recover_host(struct Scsi_Host *shost);
 
 int  sas_register_phys(struct sas_ha_struct *sas_ha);
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 8a43534eea5c..87f194925b3c 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -404,8 +404,6 @@ cmd_to_domain_dev(struct scsi_cmnd *cmd)
 	return sdev_to_domain_dev(cmd->device);
 }
 
-void sas_hash_addr(u8 *hashed, const u8 *sas_addr);
-
 /* Before calling a notify event, LLDD should use this function
  * when the link is severed (possibly from its tasklet).
  * The idea is that the Class only reads those, while the LLDD,
@@ -699,18 +697,8 @@ extern struct scsi_transport_template *
 sas_domain_attach_transport(struct sas_domain_function_template *);
 extern struct device_attribute dev_attr_phy_event_threshold;
 
-int  sas_discover_root_expander(struct domain_device *);
-
-int  sas_ex_revalidate_domain(struct domain_device *);
-
-void sas_unregister_domain_devices(struct asd_sas_port *port, int gone);
-void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *);
-void sas_discover_event(struct asd_sas_port *, enum discover_event ev);
-
 int  sas_discover_end_dev(struct domain_device *);
 
-void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
-
 void sas_init_dev(struct domain_device *);
 
 void sas_task_abort(struct sas_task *);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static
  2023-09-12  7:47 [PATCH 0/3] Minor cleanups Damien Le Moal
  2023-09-12  7:47 ` [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h Damien Le Moal
@ 2023-09-12  7:47 ` Damien Le Moal
  2023-09-12  7:59   ` John Garry
  2023-09-12  7:47 ` [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static Damien Le Moal
  2 siblings, 1 reply; 8+ messages in thread
From: Damien Le Moal @ 2023-09-12  7:47 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen, John Garry

sas_set_phy_speed() is used only within sas_init.c. Declare this
function as static.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/scsi/libsas/sas_init.c | 4 ++--
 include/scsi/libsas.h          | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c
index 8586dc79f2a0..9c8cc723170d 100644
--- a/drivers/scsi/libsas/sas_init.c
+++ b/drivers/scsi/libsas/sas_init.c
@@ -315,8 +315,8 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset)
 }
 EXPORT_SYMBOL_GPL(sas_phy_reset);
 
-int sas_set_phy_speed(struct sas_phy *phy,
-		      struct sas_phy_linkrates *rates)
+static int sas_set_phy_speed(struct sas_phy *phy,
+			     struct sas_phy_linkrates *rates)
 {
 	int ret;
 
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 87f194925b3c..5ee86b225359 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -679,7 +679,6 @@ extern void sas_resume_ha(struct sas_ha_struct *sas_ha);
 extern void sas_resume_ha_no_sync(struct sas_ha_struct *sas_ha);
 extern void sas_suspend_ha(struct sas_ha_struct *sas_ha);
 
-int sas_set_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates);
 int sas_phy_reset(struct sas_phy *phy, int hard_reset);
 int sas_phy_enable(struct sas_phy *phy, int enable);
 extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static
  2023-09-12  7:47 [PATCH 0/3] Minor cleanups Damien Le Moal
  2023-09-12  7:47 ` [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h Damien Le Moal
  2023-09-12  7:47 ` [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static Damien Le Moal
@ 2023-09-12  7:47 ` Damien Le Moal
  2023-09-12  8:00   ` John Garry
  2 siblings, 1 reply; 8+ messages in thread
From: Damien Le Moal @ 2023-09-12  7:47 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen, John Garry

sas_discover_end_dev() is defined and used used only in sas_discover.c.
Define this function as static.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/scsi/libsas/sas_discover.c | 2 +-
 include/scsi/libsas.h              | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index ff7b63b10aeb..8fb7c41c0962 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -275,7 +275,7 @@ static void sas_resume_devices(struct work_struct *work)
  *
  * See comment in sas_discover_sata().
  */
-int sas_discover_end_dev(struct domain_device *dev)
+static int sas_discover_end_dev(struct domain_device *dev)
 {
 	return sas_notify_lldd_dev_found(dev);
 }
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 5ee86b225359..4ce4809aec42 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -696,8 +696,6 @@ extern struct scsi_transport_template *
 sas_domain_attach_transport(struct sas_domain_function_template *);
 extern struct device_attribute dev_attr_phy_event_threshold;
 
-int  sas_discover_end_dev(struct domain_device *);
-
 void sas_init_dev(struct domain_device *);
 
 void sas_task_abort(struct sas_task *);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static
  2023-09-12  7:47 ` [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static Damien Le Moal
@ 2023-09-12  7:59   ` John Garry
  0 siblings, 0 replies; 8+ messages in thread
From: John Garry @ 2023-09-12  7:59 UTC (permalink / raw)
  To: Damien Le Moal, linux-scsi, Martin K . Petersen

On 12/09/2023 08:47, Damien Le Moal wrote:
> sas_set_phy_speed() is used only within sas_init.c. Declare this
> function as static.
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>

> ---
>   drivers/scsi/libsas/sas_init.c | 4 ++--
>   include/scsi/libsas.h          | 1 -
>   2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c
> index 8586dc79f2a0..9c8cc723170d 100644
> --- a/drivers/scsi/libsas/sas_init.c
> +++ b/drivers/scsi/libsas/sas_init.c
> @@ -315,8 +315,8 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset)
>   }
>   EXPORT_SYMBOL_GPL(sas_phy_reset);
>   
> -int sas_set_phy_speed(struct sas_phy *phy,
> -		      struct sas_phy_linkrates *rates)
> +static int sas_set_phy_speed(struct sas_phy *phy,
> +			     struct sas_phy_linkrates *rates)
>   {
>   	int ret;
>   
> diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
> index 87f194925b3c..5ee86b225359 100644
> --- a/include/scsi/libsas.h
> +++ b/include/scsi/libsas.h
> @@ -679,7 +679,6 @@ extern void sas_resume_ha(struct sas_ha_struct *sas_ha);
>   extern void sas_resume_ha_no_sync(struct sas_ha_struct *sas_ha);
>   extern void sas_suspend_ha(struct sas_ha_struct *sas_ha);
>   
> -int sas_set_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates);
>   int sas_phy_reset(struct sas_phy *phy, int hard_reset);
>   int sas_phy_enable(struct sas_phy *phy, int enable);
>   extern int sas_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static
  2023-09-12  7:47 ` [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static Damien Le Moal
@ 2023-09-12  8:00   ` John Garry
  0 siblings, 0 replies; 8+ messages in thread
From: John Garry @ 2023-09-12  8:00 UTC (permalink / raw)
  To: Damien Le Moal, linux-scsi, Martin K . Petersen

On 12/09/2023 08:47, Damien Le Moal wrote:
> sas_discover_end_dev() is defined and used used only in sas_discover.c.
> Define this function as static.
> 
> Signed-off-by: Damien Le Moal<dlemoal@kernel.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h
  2023-09-12  7:47 ` [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h Damien Le Moal
@ 2023-09-12  8:19   ` John Garry
  2023-09-12  8:41     ` Damien Le Moal
  0 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2023-09-12  8:19 UTC (permalink / raw)
  To: Damien Le Moal, linux-scsi, Martin K . Petersen

On 12/09/2023 08:47, Damien Le Moal wrote:
> Move the declarations of functions used only within libsas from
> include/scsi/libsas.h to drivers/scsi/libsas/sas_internal.h
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>

>   
> -void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
> -
>   void sas_init_dev(struct domain_device *);

I think that this guy can also be relocated

>   
>   void sas_task_abort(struct sas_task *);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h
  2023-09-12  8:19   ` John Garry
@ 2023-09-12  8:41     ` Damien Le Moal
  0 siblings, 0 replies; 8+ messages in thread
From: Damien Le Moal @ 2023-09-12  8:41 UTC (permalink / raw)
  To: John Garry, linux-scsi, Martin K . Petersen

On 9/12/23 17:19, John Garry wrote:
> On 12/09/2023 08:47, Damien Le Moal wrote:
>> Move the declarations of functions used only within libsas from
>> include/scsi/libsas.h to drivers/scsi/libsas/sas_internal.h
>>
>> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> 
> Reviewed-by: John Garry <john.g.garry@oracle.com>
> 
>>   
>> -void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
>> -
>>   void sas_init_dev(struct domain_device *);
> 
> I think that this guy can also be relocated

ah! yes. My grep hit hisi_sas, but that was another function.
Adding it.

> 
>>   
>>   void sas_task_abort(struct sas_task *);
> 

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-12  8:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12  7:47 [PATCH 0/3] Minor cleanups Damien Le Moal
2023-09-12  7:47 ` [PATCH 1/3] scsi: libsas: Move local functions declarations to sas_internal.h Damien Le Moal
2023-09-12  8:19   ` John Garry
2023-09-12  8:41     ` Damien Le Moal
2023-09-12  7:47 ` [PATCH 2/3] scsi: libsas: Declare sas_set_phy_speed() static Damien Le Moal
2023-09-12  7:59   ` John Garry
2023-09-12  7:47 ` [PATCH 3/3] scsi: libsas: Declare sas_discover_end_dev() static Damien Le Moal
2023-09-12  8:00   ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox