diff mbox

[06/15] libmultipath: Remove an unused function

Message ID 1fcae43b-f64e-7001-ef0d-68ec0585c81d@sandisk.com (mailing list archive)
State Not Applicable, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Bart Van Assche Oct. 21, 2016, 6:43 p.m. UTC
The function snprint_config() is not used. Hence remove it.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
---
 libmultipath/print.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Germano Percossi Oct. 24, 2016, 10:50 a.m. UTC | #1
Removing functions packaged in a library just because they are
not used in multipath does not seem fine, in general.
They could still be used by third party.

Germano

On 10/21/2016 07:43 PM, Bart Van Assche wrote:
> The function snprint_config() is not used. Hence remove it.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> ---
>  libmultipath/print.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/libmultipath/print.c b/libmultipath/print.c
> index 9aa41ad..09e4a2e 100644
> --- a/libmultipath/print.c
> +++ b/libmultipath/print.c
> @@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
>  	return fwd;
>  }
>  
> -extern int
> -snprint_config (char * buff, int len)
> -{
> -	return 0;
> -}
> -
>  /*
>   * stdout printing helpers
>   */
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Bart Van Assche Oct. 24, 2016, 2:26 p.m. UTC | #2
On 10/24/16 03:50, Germano Percossi wrote:
> On 10/21/2016 07:43 PM, Bart Van Assche wrote:
>> The function snprint_config() is not used. Hence remove it.
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
>> ---
>>  libmultipath/print.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/libmultipath/print.c b/libmultipath/print.c
>> index 9aa41ad..09e4a2e 100644
>> --- a/libmultipath/print.c
>> +++ b/libmultipath/print.c
>> @@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
>>  	return fwd;
>>  }
>>
>> -extern int
>> -snprint_config (char * buff, int len)
>> -{
>> -	return 0;
>> -}
>> -
>>  /*
>>   * stdout printing helpers
>>   */
>
 > Removing functions packaged in a library just because they are
 > not used in multipath does not seem fine, in general.
 > They could still be used by third party.

Hello Germano,

The snprint_config() function has never been declared in any 
multipath-tools header file so if someone would want to use this 
function without triggering a compiler warning they would have to add 
something like "extern int snprint_config (char * buff, int len)" to 
their source code. Because of this reason and also because of the empty 
implementation I think that is unlikely that any project is using this 
function.

Bart.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Germano Percossi Oct. 24, 2016, 2:55 p.m. UTC | #3
Sorry, my reply was meant for mpath_prin_pthread_fn patch but,
I guess, given the lack of a declaration in a header file,
your answer will be the same.

Germano

On 10/24/2016 03:26 PM, Bart Van Assche wrote:
> On 10/24/16 03:50, Germano Percossi wrote:
>> On 10/21/2016 07:43 PM, Bart Van Assche wrote:
>>> The function snprint_config() is not used. Hence remove it.
>>>
>>> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
>>> ---
>>>  libmultipath/print.c | 6 ------
>>>  1 file changed, 6 deletions(-)
>>>
>>> diff --git a/libmultipath/print.c b/libmultipath/print.c
>>> index 9aa41ad..09e4a2e 100644
>>> --- a/libmultipath/print.c
>>> +++ b/libmultipath/print.c
>>> @@ -1745,12 +1745,6 @@ snprint_devices (struct config *conf, char *
>>> buff, int len, struct vectors *vecs
>>>      return fwd;
>>>  }
>>>
>>> -extern int
>>> -snprint_config (char * buff, int len)
>>> -{
>>> -    return 0;
>>> -}
>>> -
>>>  /*
>>>   * stdout printing helpers
>>>   */
>>
>> Removing functions packaged in a library just because they are
>> not used in multipath does not seem fine, in general.
>> They could still be used by third party.
> 
> Hello Germano,
> 
> The snprint_config() function has never been declared in any
> multipath-tools header file so if someone would want to use this
> function without triggering a compiler warning they would have to add
> something like "extern int snprint_config (char * buff, int len)" to
> their source code. Because of this reason and also because of the empty
> implementation I think that is unlikely that any project is using this
> function.
> 
> Bart.
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Bart Van Assche Oct. 24, 2016, 4:02 p.m. UTC | #4
On 10/24/2016 07:55 AM, Germano Percossi wrote:
> Sorry, my reply was meant for mpath_prin_pthread_fn patch but,
> I guess, given the lack of a declaration in a header file,
> your answer will be the same.

Hello Germano,

Inspection of the git log -p output learned me that also 
mpath_prin_pthread_fn() was never declared in any multipath-tools header 
file.

Bart.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 9aa41ad..09e4a2e 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -1745,12 +1745,6 @@  snprint_devices (struct config *conf, char * buff, int len, struct vectors *vecs
 	return fwd;
 }
 
-extern int
-snprint_config (char * buff, int len)
-{
-	return 0;
-}
-
 /*
  * stdout printing helpers
  */