diff mbox series

[2/6] ufs: core: mark unexported functions as static

Message ID 20241120-topic-ufs-cleanup-v1-2-a5cef54b1cdc@linaro.org
State New
Headers show
Series ufs: core: initial cleanup and defines sync with Linux v6.12 | expand

Commit Message

Neil Armstrong Nov. 20, 2024, 9:22 a.m. UTC
Mark the remaining local functions as static to avoid build
warnings.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/ufs/ufs.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Neha Malcom Francis Dec. 6, 2024, 7:55 a.m. UTC | #1
On 20/11/24 14:52, Neil Armstrong wrote:
> Mark the remaining local functions as static to avoid build
> warnings.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>   drivers/ufs/ufs.c | 26 +++++++++++++-------------
>   1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
> index 31c2959aeb12931b2bbdf26b3c676ae1a7b0fd1a..8a6c9f1e40b058dfd29bc07d011d576cdfc504cb 100644
> --- a/drivers/ufs/ufs.c
> +++ b/drivers/ufs/ufs.c
> @@ -1035,8 +1035,8 @@ static inline void ufshcd_init_query(struct ufs_hba *hba,
>   /**
>    * ufshcd_query_flag() - API function for sending flag query requests
>    */
> -int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
> -		      enum flag_idn idn, bool *flag_res)
> +static int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
> +			     enum flag_idn idn, bool *flag_res)
>   {
>   	struct ufs_query_req *request = NULL;
>   	struct ufs_query_res *response = NULL;
> @@ -1171,9 +1171,9 @@ out:
>   /**
>    * ufshcd_query_descriptor_retry - API function for sending descriptor requests
>    */
> -int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
> -				  enum desc_idn idn, u8 index, u8 selector,
> -				  u8 *desc_buf, int *buf_len)
> +static int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
> +					 enum desc_idn idn, u8 index, u8 selector,
> +					 u8 *desc_buf, int *buf_len)
>   {
>   	int err;
>   	int retries;
> @@ -1265,8 +1265,8 @@ static void ufshcd_init_desc_sizes(struct ufs_hba *hba)
>    * ufshcd_map_desc_id_to_length - map descriptor IDN to its length
>    *
>    */
> -int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
> -				 int *desc_len)
> +static int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
> +					int *desc_len)

Isn't ufshcd_map_desc_id_to_length exported?

>   {
>   	switch (desc_id) {
>   	case QUERY_DESC_IDN_DEVICE:
> @@ -1309,9 +1309,9 @@ EXPORT_SYMBOL(ufshcd_map_desc_id_to_length);
>    * ufshcd_read_desc_param - read the specified descriptor parameter
>    *
>    */
> -int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
> -			   int desc_index, u8 param_offset, u8 *param_read_buf,
> -			   u8 param_size)
> +static int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
> +				  int desc_index, u8 param_offset,
> +				  u8 *param_read_buf, u8 param_size)
>   {
>   	int ret;
>   	u8 *desc_buf;
> @@ -1570,8 +1570,8 @@ static int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size)
>    * ufshcd_read_string_desc - read string descriptor
>    *
>    */
> -int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
> -			    u8 *buf, u32 size, bool ascii)
> +static int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
> +				   u8 *buf, u32 size, bool ascii)
>   {
>   	int err = 0;
>   
> @@ -1882,7 +1882,7 @@ static void ufshcd_def_desc_sizes(struct ufs_hba *hba)
>   	hba->desc_size.hlth_desc = QUERY_DESC_HEALTH_DEF_SIZE;
>   }
>   
> -int ufs_start(struct ufs_hba *hba)
> +static int ufs_start(struct ufs_hba *hba)
>   {
>   	struct ufs_dev_desc card = {0};
>   	int ret;
>
Neil Armstrong Dec. 6, 2024, 8:17 a.m. UTC | #2
On 06/12/2024 08:55, Neha Malcom Francis wrote:
> On 20/11/24 14:52, Neil Armstrong wrote:
>> Mark the remaining local functions as static to avoid build
>> warnings.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   drivers/ufs/ufs.c | 26 +++++++++++++-------------
>>   1 file changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
>> index 31c2959aeb12931b2bbdf26b3c676ae1a7b0fd1a..8a6c9f1e40b058dfd29bc07d011d576cdfc504cb 100644
>> --- a/drivers/ufs/ufs.c
>> +++ b/drivers/ufs/ufs.c
>> @@ -1035,8 +1035,8 @@ static inline void ufshcd_init_query(struct ufs_hba *hba,
>>   /**
>>    * ufshcd_query_flag() - API function for sending flag query requests
>>    */
>> -int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
>> -              enum flag_idn idn, bool *flag_res)
>> +static int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
>> +                 enum flag_idn idn, bool *flag_res)
>>   {
>>       struct ufs_query_req *request = NULL;
>>       struct ufs_query_res *response = NULL;
>> @@ -1171,9 +1171,9 @@ out:
>>   /**
>>    * ufshcd_query_descriptor_retry - API function for sending descriptor requests
>>    */
>> -int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
>> -                  enum desc_idn idn, u8 index, u8 selector,
>> -                  u8 *desc_buf, int *buf_len)
>> +static int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
>> +                     enum desc_idn idn, u8 index, u8 selector,
>> +                     u8 *desc_buf, int *buf_len)
>>   {
>>       int err;
>>       int retries;
>> @@ -1265,8 +1265,8 @@ static void ufshcd_init_desc_sizes(struct ufs_hba *hba)
>>    * ufshcd_map_desc_id_to_length - map descriptor IDN to its length
>>    *
>>    */
>> -int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
>> -                 int *desc_len)
>> +static int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
>> +                    int *desc_len)
> 
> Isn't ufshcd_map_desc_id_to_length exported?

Indeed while not defined in any header, it has an EXPORT_SYMBOL, but it's a no-op in uboot...

So i'll need to drop this export.

> 
>>   {
>>       switch (desc_id) {
>>       case QUERY_DESC_IDN_DEVICE:
>> @@ -1309,9 +1309,9 @@ EXPORT_SYMBOL(ufshcd_map_desc_id_to_length);
>>    * ufshcd_read_desc_param - read the specified descriptor parameter
>>    *
>>    */
>> -int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
>> -               int desc_index, u8 param_offset, u8 *param_read_buf,
>> -               u8 param_size)
>> +static int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
>> +                  int desc_index, u8 param_offset,
>> +                  u8 *param_read_buf, u8 param_size)
>>   {
>>       int ret;
>>       u8 *desc_buf;
>> @@ -1570,8 +1570,8 @@ static int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size)
>>    * ufshcd_read_string_desc - read string descriptor
>>    *
>>    */
>> -int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
>> -                u8 *buf, u32 size, bool ascii)
>> +static int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
>> +                   u8 *buf, u32 size, bool ascii)
>>   {
>>       int err = 0;
>> @@ -1882,7 +1882,7 @@ static void ufshcd_def_desc_sizes(struct ufs_hba *hba)
>>       hba->desc_size.hlth_desc = QUERY_DESC_HEALTH_DEF_SIZE;
>>   }
>> -int ufs_start(struct ufs_hba *hba)
>> +static int ufs_start(struct ufs_hba *hba)
>>   {
>>       struct ufs_dev_desc card = {0};
>>       int ret;
>>
>
diff mbox series

Patch

diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
index 31c2959aeb12931b2bbdf26b3c676ae1a7b0fd1a..8a6c9f1e40b058dfd29bc07d011d576cdfc504cb 100644
--- a/drivers/ufs/ufs.c
+++ b/drivers/ufs/ufs.c
@@ -1035,8 +1035,8 @@  static inline void ufshcd_init_query(struct ufs_hba *hba,
 /**
  * ufshcd_query_flag() - API function for sending flag query requests
  */
-int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
-		      enum flag_idn idn, bool *flag_res)
+static int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
+			     enum flag_idn idn, bool *flag_res)
 {
 	struct ufs_query_req *request = NULL;
 	struct ufs_query_res *response = NULL;
@@ -1171,9 +1171,9 @@  out:
 /**
  * ufshcd_query_descriptor_retry - API function for sending descriptor requests
  */
-int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
-				  enum desc_idn idn, u8 index, u8 selector,
-				  u8 *desc_buf, int *buf_len)
+static int ufshcd_query_descriptor_retry(struct ufs_hba *hba, enum query_opcode opcode,
+					 enum desc_idn idn, u8 index, u8 selector,
+					 u8 *desc_buf, int *buf_len)
 {
 	int err;
 	int retries;
@@ -1265,8 +1265,8 @@  static void ufshcd_init_desc_sizes(struct ufs_hba *hba)
  * ufshcd_map_desc_id_to_length - map descriptor IDN to its length
  *
  */
-int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
-				 int *desc_len)
+static int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
+					int *desc_len)
 {
 	switch (desc_id) {
 	case QUERY_DESC_IDN_DEVICE:
@@ -1309,9 +1309,9 @@  EXPORT_SYMBOL(ufshcd_map_desc_id_to_length);
  * ufshcd_read_desc_param - read the specified descriptor parameter
  *
  */
-int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
-			   int desc_index, u8 param_offset, u8 *param_read_buf,
-			   u8 param_size)
+static int ufshcd_read_desc_param(struct ufs_hba *hba, enum desc_idn desc_id,
+				  int desc_index, u8 param_offset,
+				  u8 *param_read_buf, u8 param_size)
 {
 	int ret;
 	u8 *desc_buf;
@@ -1570,8 +1570,8 @@  static int ufshcd_read_device_desc(struct ufs_hba *hba, u8 *buf, u32 size)
  * ufshcd_read_string_desc - read string descriptor
  *
  */
-int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
-			    u8 *buf, u32 size, bool ascii)
+static int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
+				   u8 *buf, u32 size, bool ascii)
 {
 	int err = 0;
 
@@ -1882,7 +1882,7 @@  static void ufshcd_def_desc_sizes(struct ufs_hba *hba)
 	hba->desc_size.hlth_desc = QUERY_DESC_HEALTH_DEF_SIZE;
 }
 
-int ufs_start(struct ufs_hba *hba)
+static int ufs_start(struct ufs_hba *hba)
 {
 	struct ufs_dev_desc card = {0};
 	int ret;