mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sound: drivers: portman2x4.c:  Remove some unused functions
@ 2015-01-01 15:12 Rickard Strandqvist
  2015-01-02  8:17 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2015-01-01 15:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Rickard Strandqvist, alsa-devel, linux-kernel

Removes some functions that are not used anywhere:
portman_read_data() portman_read_command()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 sound/drivers/portman2x4.c |   10 ----------
 1 file changed, 10 deletions(-)

diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
index 78ccfa4..b5b6b4e 100644
--- a/sound/drivers/portman2x4.c
+++ b/sound/drivers/portman2x4.c
@@ -198,21 +198,11 @@ static inline void portman_write_command(struct portman *pm, u8 value)
 	parport_write_control(pm->pardev->port, value);
 }
 
-static inline u8 portman_read_command(struct portman *pm)
-{
-	return parport_read_control(pm->pardev->port);
-}
-
 static inline u8 portman_read_status(struct portman *pm)
 {
 	return parport_read_status(pm->pardev->port);
 }
 
-static inline u8 portman_read_data(struct portman *pm)
-{
-	return parport_read_data(pm->pardev->port);
-}
-
 static inline void portman_write_data(struct portman *pm, u8 value)
 {
 	parport_write_data(pm->pardev->port, value);
-- 
1.7.10.4


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

* Re: [PATCH] sound: drivers: portman2x4.c:  Remove some unused functions
  2015-01-01 15:12 [PATCH] sound: drivers: portman2x4.c: Remove some unused functions Rickard Strandqvist
@ 2015-01-02  8:17 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2015-01-02  8:17 UTC (permalink / raw)
  To: Rickard Strandqvist; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

At Thu,  1 Jan 2015 16:12:45 +0100,
Rickard Strandqvist wrote:
> 
> Removes some functions that are not used anywhere:
> portman_read_data() portman_read_command()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  sound/drivers/portman2x4.c |   10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
> index 78ccfa4..b5b6b4e 100644
> --- a/sound/drivers/portman2x4.c
> +++ b/sound/drivers/portman2x4.c
> @@ -198,21 +198,11 @@ static inline void portman_write_command(struct portman *pm, u8 value)
>  	parport_write_control(pm->pardev->port, value);
>  }
>  
> -static inline u8 portman_read_command(struct portman *pm)
> -{
> -	return parport_read_control(pm->pardev->port);
> -}
> -
>  static inline u8 portman_read_status(struct portman *pm)
>  {
>  	return parport_read_status(pm->pardev->port);
>  }
>  
> -static inline u8 portman_read_data(struct portman *pm)
> -{
> -	return parport_read_data(pm->pardev->port);
> -}
> -
>  static inline void portman_write_data(struct portman *pm, u8 value)
>  {
>  	parport_write_data(pm->pardev->port, value);

Rickard, your works are highly appreciated, but please think twice
before submitting patches: is it worth for the whole?

For example, in this case: the removals are static inline functions.
So there is no gain by removing this regarding the object size.  OTOH, 
they are obviously wrapper accessors, thus dropping blindly would
result in inconsistency.  That is, a reader may wonder later why some
are write only and some not.


thanks,

Takashi

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

end of thread, other threads:[~2015-01-02  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01 15:12 [PATCH] sound: drivers: portman2x4.c: Remove some unused functions Rickard Strandqvist
2015-01-02  8:17 ` Takashi Iwai

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

all inboxes | Powered by JetHome®