All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: arm: mach-msm: smd.c:  Remove some unused functions
@ 2014-12-07  1:12 ` Rickard Strandqvist
  0 siblings, 0 replies; 13+ messages in thread
From: Rickard Strandqvist @ 2014-12-07  1:12 UTC (permalink / raw)
  To: David Brown, Daniel Walker
  Cc: Rickard Strandqvist, Bryan Huntsman, Russell King, linux-arm-msm,
	linux-arm-kernel, linux-kernel

Removes some functions that are not used anywhere:
smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
 arch/arm/mach-msm/smd.c                  |  105 ------------------------------
 arch/arm/mach-msm/smd_private.h          |    2 -
 3 files changed, 116 deletions(-)

diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
index 029463e..48ddef98 100644
--- a/arch/arm/mach-msm/include/mach/msm_smd.h
+++ b/arch/arm/mach-msm/include/mach/msm_smd.h
@@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
 ** it will return the requested length written or an error.
 */
 int smd_write(smd_channel_t *ch, const void *data, int len);
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
 
 int smd_write_avail(smd_channel_t *ch);
 int smd_read_avail(smd_channel_t *ch);
@@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
 void smd_kick(smd_channel_t *ch);
 
 
-#if 0
-/* these are interruptable waits which will block you until the specified
-** number of bytes are readable or writable.
-*/
-int smd_wait_until_readable(smd_channel_t *ch, int bytes);
-int smd_wait_until_writable(smd_channel_t *ch, int bytes);
-#endif
-
 typedef enum {
 	SMD_PORT_DS = 0,
 	SMD_PORT_DIAG,
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index b1588a1..4bc1e71 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
 	return 0;
 }
 
-void smd_sleep_exit(void)
-{
-	unsigned long flags;
-	struct smd_channel *ch;
-	int need_int = 0;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	spin_unlock_irqrestore(&smd_lock, flags);
-	do_smd_probe();
-
-	if (need_int) {
-		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
-			pr_info("smd_sleep_exit need interrupt\n");
-		tasklet_schedule(&smd_fake_irq_tasklet);
-	}
-}
-
-
 void smd_kick(smd_channel_t *ch)
 {
 	unsigned long flags;
@@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
 	return ch->write(ch, data, len);
 }
 
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
-{
-	unsigned long flags;
-	int res;
-	spin_lock_irqsave(&smd_lock, flags);
-	res = ch->write(ch, data, len);
-	spin_unlock_irqrestore(&smd_lock, flags);
-	return res;
-}
-
 int smd_read_avail(smd_channel_t *ch)
 {
 	return ch->read_avail(ch);
@@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
 	return ch->write_avail(ch);
 }
 
-int smd_wait_until_readable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
-int smd_wait_until_writable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
 int smd_cur_packet_size(smd_channel_t *ch)
 {
 	return ch->current_packet;
@@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
 	return 0;
 }
 
-uint32_t smsm_get_state(enum smsm_state_item item)
-{
-	unsigned long flags;
-	uint32_t rv;
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	rv = readl(smd_info.state + item * 4);
-
-	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
-		handle_modem_crash();
-
-	spin_unlock_irqrestore(&smem_lock, flags);
-
-	return rv;
-}
-
-#ifdef CONFIG_ARCH_MSM_SCORPION
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	struct msm_dem_slave_data *ptr;
-
-	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       ptr->sleep_time, delay);
-	ptr->sleep_time = delay;
-	return 0;
-}
-
-#else
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	uint32_t *ptr;
-
-	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       *ptr, delay);
-	*ptr = delay;
-	return 0;
-}
-
-#endif
-
 int smd_core_init(void)
 {
 	int r;
diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
index 727bfe6..702f34e 100644
--- a/arch/arm/mach-msm/smd_private.h
+++ b/arch/arm/mach-msm/smd_private.h
@@ -148,8 +148,6 @@ enum smsm_state_item {
 
 void *smem_alloc(unsigned id, unsigned size);
 int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
-uint32_t smsm_get_state(enum smsm_state_item item);
-int smsm_set_sleep_duration(uint32_t delay);
 void smsm_print_sleep_info(void);
 
 #define SMEM_NUM_SMD_CHANNELS        64
-- 
1.7.10.4

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

* [PATCH] arch: arm: mach-msm: smd.c:  Remove some unused functions
@ 2014-12-07  1:12 ` Rickard Strandqvist
  0 siblings, 0 replies; 13+ messages in thread
From: Rickard Strandqvist @ 2014-12-07  1:12 UTC (permalink / raw)
  To: linux-arm-kernel

Removes some functions that are not used anywhere:
smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
 arch/arm/mach-msm/smd.c                  |  105 ------------------------------
 arch/arm/mach-msm/smd_private.h          |    2 -
 3 files changed, 116 deletions(-)

diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
index 029463e..48ddef98 100644
--- a/arch/arm/mach-msm/include/mach/msm_smd.h
+++ b/arch/arm/mach-msm/include/mach/msm_smd.h
@@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
 ** it will return the requested length written or an error.
 */
 int smd_write(smd_channel_t *ch, const void *data, int len);
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
 
 int smd_write_avail(smd_channel_t *ch);
 int smd_read_avail(smd_channel_t *ch);
@@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
 void smd_kick(smd_channel_t *ch);
 
 
-#if 0
-/* these are interruptable waits which will block you until the specified
-** number of bytes are readable or writable.
-*/
-int smd_wait_until_readable(smd_channel_t *ch, int bytes);
-int smd_wait_until_writable(smd_channel_t *ch, int bytes);
-#endif
-
 typedef enum {
 	SMD_PORT_DS = 0,
 	SMD_PORT_DIAG,
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index b1588a1..4bc1e71 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
 	return 0;
 }
 
-void smd_sleep_exit(void)
-{
-	unsigned long flags;
-	struct smd_channel *ch;
-	int need_int = 0;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	spin_unlock_irqrestore(&smd_lock, flags);
-	do_smd_probe();
-
-	if (need_int) {
-		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
-			pr_info("smd_sleep_exit need interrupt\n");
-		tasklet_schedule(&smd_fake_irq_tasklet);
-	}
-}
-
-
 void smd_kick(smd_channel_t *ch)
 {
 	unsigned long flags;
@@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
 	return ch->write(ch, data, len);
 }
 
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
-{
-	unsigned long flags;
-	int res;
-	spin_lock_irqsave(&smd_lock, flags);
-	res = ch->write(ch, data, len);
-	spin_unlock_irqrestore(&smd_lock, flags);
-	return res;
-}
-
 int smd_read_avail(smd_channel_t *ch)
 {
 	return ch->read_avail(ch);
@@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
 	return ch->write_avail(ch);
 }
 
-int smd_wait_until_readable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
-int smd_wait_until_writable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
 int smd_cur_packet_size(smd_channel_t *ch)
 {
 	return ch->current_packet;
@@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
 	return 0;
 }
 
-uint32_t smsm_get_state(enum smsm_state_item item)
-{
-	unsigned long flags;
-	uint32_t rv;
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	rv = readl(smd_info.state + item * 4);
-
-	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
-		handle_modem_crash();
-
-	spin_unlock_irqrestore(&smem_lock, flags);
-
-	return rv;
-}
-
-#ifdef CONFIG_ARCH_MSM_SCORPION
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	struct msm_dem_slave_data *ptr;
-
-	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       ptr->sleep_time, delay);
-	ptr->sleep_time = delay;
-	return 0;
-}
-
-#else
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	uint32_t *ptr;
-
-	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       *ptr, delay);
-	*ptr = delay;
-	return 0;
-}
-
-#endif
-
 int smd_core_init(void)
 {
 	int r;
diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
index 727bfe6..702f34e 100644
--- a/arch/arm/mach-msm/smd_private.h
+++ b/arch/arm/mach-msm/smd_private.h
@@ -148,8 +148,6 @@ enum smsm_state_item {
 
 void *smem_alloc(unsigned id, unsigned size);
 int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
-uint32_t smsm_get_state(enum smsm_state_item item);
-int smsm_set_sleep_duration(uint32_t delay);
 void smsm_print_sleep_info(void);
 
 #define SMEM_NUM_SMD_CHANNELS        64
-- 
1.7.10.4

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

* Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
  2014-12-07  1:12 ` Rickard Strandqvist
  (?)
@ 2014-12-09 14:46   ` dwalker
  -1 siblings, 0 replies; 13+ messages in thread
From: dwalker @ 2014-12-09 14:46 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Russell King, linux-arm-msm, linux-kernel, Bryan Huntsman,
	David Brown, linux-arm-kernel


Seems ok to me. These files, and functions, are also in drivers/staging/dream/
are you removing them there also ?


On Sun, Dec 07, 2014 at 02:12:20AM +0100, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
> smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
>  arch/arm/mach-msm/smd.c                  |  105 ------------------------------
>  arch/arm/mach-msm/smd_private.h          |    2 -
>  3 files changed, 116 deletions(-)
> 
> diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
> index 029463e..48ddef98 100644
> --- a/arch/arm/mach-msm/include/mach/msm_smd.h
> +++ b/arch/arm/mach-msm/include/mach/msm_smd.h
> @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
>  ** it will return the requested length written or an error.
>  */
>  int smd_write(smd_channel_t *ch, const void *data, int len);
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
>  
>  int smd_write_avail(smd_channel_t *ch);
>  int smd_read_avail(smd_channel_t *ch);
> @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
>  void smd_kick(smd_channel_t *ch);
>  
>  
> -#if 0
> -/* these are interruptable waits which will block you until the specified
> -** number of bytes are readable or writable.
> -*/
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes);
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes);
> -#endif
> -
>  typedef enum {
>  	SMD_PORT_DS = 0,
>  	SMD_PORT_DIAG,
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
> index b1588a1..4bc1e71 100644
> --- a/arch/arm/mach-msm/smd.c
> +++ b/arch/arm/mach-msm/smd.c
> @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
>  	return 0;
>  }
>  
> -void smd_sleep_exit(void)
> -{
> -	unsigned long flags;
> -	struct smd_channel *ch;
> -	int need_int = 0;
> -
> -	spin_lock_irqsave(&smd_lock, flags);
> -	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	do_smd_probe();
> -
> -	if (need_int) {
> -		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
> -			pr_info("smd_sleep_exit need interrupt\n");
> -		tasklet_schedule(&smd_fake_irq_tasklet);
> -	}
> -}
> -
> -
>  void smd_kick(smd_channel_t *ch)
>  {
>  	unsigned long flags;
> @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
>  	return ch->write(ch, data, len);
>  }
>  
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
> -{
> -	unsigned long flags;
> -	int res;
> -	spin_lock_irqsave(&smd_lock, flags);
> -	res = ch->write(ch, data, len);
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	return res;
> -}
> -
>  int smd_read_avail(smd_channel_t *ch)
>  {
>  	return ch->read_avail(ch);
> @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
>  	return ch->write_avail(ch);
>  }
>  
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
>  int smd_cur_packet_size(smd_channel_t *ch)
>  {
>  	return ch->current_packet;
> @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
>  	return 0;
>  }
>  
> -uint32_t smsm_get_state(enum smsm_state_item item)
> -{
> -	unsigned long flags;
> -	uint32_t rv;
> -
> -	spin_lock_irqsave(&smem_lock, flags);
> -
> -	rv = readl(smd_info.state + item * 4);
> -
> -	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
> -		handle_modem_crash();
> -
> -	spin_unlock_irqrestore(&smem_lock, flags);
> -
> -	return rv;
> -}
> -
> -#ifdef CONFIG_ARCH_MSM_SCORPION
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	struct msm_dem_slave_data *ptr;
> -
> -	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       ptr->sleep_time, delay);
> -	ptr->sleep_time = delay;
> -	return 0;
> -}
> -
> -#else
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	uint32_t *ptr;
> -
> -	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       *ptr, delay);
> -	*ptr = delay;
> -	return 0;
> -}
> -
> -#endif
> -
>  int smd_core_init(void)
>  {
>  	int r;
> diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
> index 727bfe6..702f34e 100644
> --- a/arch/arm/mach-msm/smd_private.h
> +++ b/arch/arm/mach-msm/smd_private.h
> @@ -148,8 +148,6 @@ enum smsm_state_item {
>  
>  void *smem_alloc(unsigned id, unsigned size);
>  int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
> -uint32_t smsm_get_state(enum smsm_state_item item);
> -int smsm_set_sleep_duration(uint32_t delay);
>  void smsm_print_sleep_info(void);
>  
>  #define SMEM_NUM_SMD_CHANNELS        64
> -- 
> 1.7.10.4

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

* Re: [PATCH] arch: arm: mach-msm: smd.c:  Remove some unused functions
@ 2014-12-09 14:46   ` dwalker
  0 siblings, 0 replies; 13+ messages in thread
From: dwalker @ 2014-12-09 14:46 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: David Brown, Bryan Huntsman, Russell King, linux-arm-msm,
	linux-arm-kernel, linux-kernel


Seems ok to me. These files, and functions, are also in drivers/staging/dream/
are you removing them there also ?


On Sun, Dec 07, 2014 at 02:12:20AM +0100, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
> smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
>  arch/arm/mach-msm/smd.c                  |  105 ------------------------------
>  arch/arm/mach-msm/smd_private.h          |    2 -
>  3 files changed, 116 deletions(-)
> 
> diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
> index 029463e..48ddef98 100644
> --- a/arch/arm/mach-msm/include/mach/msm_smd.h
> +++ b/arch/arm/mach-msm/include/mach/msm_smd.h
> @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
>  ** it will return the requested length written or an error.
>  */
>  int smd_write(smd_channel_t *ch, const void *data, int len);
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
>  
>  int smd_write_avail(smd_channel_t *ch);
>  int smd_read_avail(smd_channel_t *ch);
> @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
>  void smd_kick(smd_channel_t *ch);
>  
>  
> -#if 0
> -/* these are interruptable waits which will block you until the specified
> -** number of bytes are readable or writable.
> -*/
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes);
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes);
> -#endif
> -
>  typedef enum {
>  	SMD_PORT_DS = 0,
>  	SMD_PORT_DIAG,
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
> index b1588a1..4bc1e71 100644
> --- a/arch/arm/mach-msm/smd.c
> +++ b/arch/arm/mach-msm/smd.c
> @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
>  	return 0;
>  }
>  
> -void smd_sleep_exit(void)
> -{
> -	unsigned long flags;
> -	struct smd_channel *ch;
> -	int need_int = 0;
> -
> -	spin_lock_irqsave(&smd_lock, flags);
> -	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	do_smd_probe();
> -
> -	if (need_int) {
> -		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
> -			pr_info("smd_sleep_exit need interrupt\n");
> -		tasklet_schedule(&smd_fake_irq_tasklet);
> -	}
> -}
> -
> -
>  void smd_kick(smd_channel_t *ch)
>  {
>  	unsigned long flags;
> @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
>  	return ch->write(ch, data, len);
>  }
>  
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
> -{
> -	unsigned long flags;
> -	int res;
> -	spin_lock_irqsave(&smd_lock, flags);
> -	res = ch->write(ch, data, len);
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	return res;
> -}
> -
>  int smd_read_avail(smd_channel_t *ch)
>  {
>  	return ch->read_avail(ch);
> @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
>  	return ch->write_avail(ch);
>  }
>  
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
>  int smd_cur_packet_size(smd_channel_t *ch)
>  {
>  	return ch->current_packet;
> @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
>  	return 0;
>  }
>  
> -uint32_t smsm_get_state(enum smsm_state_item item)
> -{
> -	unsigned long flags;
> -	uint32_t rv;
> -
> -	spin_lock_irqsave(&smem_lock, flags);
> -
> -	rv = readl(smd_info.state + item * 4);
> -
> -	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
> -		handle_modem_crash();
> -
> -	spin_unlock_irqrestore(&smem_lock, flags);
> -
> -	return rv;
> -}
> -
> -#ifdef CONFIG_ARCH_MSM_SCORPION
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	struct msm_dem_slave_data *ptr;
> -
> -	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       ptr->sleep_time, delay);
> -	ptr->sleep_time = delay;
> -	return 0;
> -}
> -
> -#else
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	uint32_t *ptr;
> -
> -	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       *ptr, delay);
> -	*ptr = delay;
> -	return 0;
> -}
> -
> -#endif
> -
>  int smd_core_init(void)
>  {
>  	int r;
> diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
> index 727bfe6..702f34e 100644
> --- a/arch/arm/mach-msm/smd_private.h
> +++ b/arch/arm/mach-msm/smd_private.h
> @@ -148,8 +148,6 @@ enum smsm_state_item {
>  
>  void *smem_alloc(unsigned id, unsigned size);
>  int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
> -uint32_t smsm_get_state(enum smsm_state_item item);
> -int smsm_set_sleep_duration(uint32_t delay);
>  void smsm_print_sleep_info(void);
>  
>  #define SMEM_NUM_SMD_CHANNELS        64
> -- 
> 1.7.10.4

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

* [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
@ 2014-12-09 14:46   ` dwalker
  0 siblings, 0 replies; 13+ messages in thread
From: dwalker at fifo99.com @ 2014-12-09 14:46 UTC (permalink / raw)
  To: linux-arm-kernel


Seems ok to me. These files, and functions, are also in drivers/staging/dream/
are you removing them there also ?


On Sun, Dec 07, 2014 at 02:12:20AM +0100, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
> smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
>  arch/arm/mach-msm/smd.c                  |  105 ------------------------------
>  arch/arm/mach-msm/smd_private.h          |    2 -
>  3 files changed, 116 deletions(-)
> 
> diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
> index 029463e..48ddef98 100644
> --- a/arch/arm/mach-msm/include/mach/msm_smd.h
> +++ b/arch/arm/mach-msm/include/mach/msm_smd.h
> @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
>  ** it will return the requested length written or an error.
>  */
>  int smd_write(smd_channel_t *ch, const void *data, int len);
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
>  
>  int smd_write_avail(smd_channel_t *ch);
>  int smd_read_avail(smd_channel_t *ch);
> @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
>  void smd_kick(smd_channel_t *ch);
>  
>  
> -#if 0
> -/* these are interruptable waits which will block you until the specified
> -** number of bytes are readable or writable.
> -*/
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes);
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes);
> -#endif
> -
>  typedef enum {
>  	SMD_PORT_DS = 0,
>  	SMD_PORT_DIAG,
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
> index b1588a1..4bc1e71 100644
> --- a/arch/arm/mach-msm/smd.c
> +++ b/arch/arm/mach-msm/smd.c
> @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
>  	return 0;
>  }
>  
> -void smd_sleep_exit(void)
> -{
> -	unsigned long flags;
> -	struct smd_channel *ch;
> -	int need_int = 0;
> -
> -	spin_lock_irqsave(&smd_lock, flags);
> -	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
> -		if (smd_need_int(ch)) {
> -			need_int = 1;
> -			break;
> -		}
> -	}
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	do_smd_probe();
> -
> -	if (need_int) {
> -		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
> -			pr_info("smd_sleep_exit need interrupt\n");
> -		tasklet_schedule(&smd_fake_irq_tasklet);
> -	}
> -}
> -
> -
>  void smd_kick(smd_channel_t *ch)
>  {
>  	unsigned long flags;
> @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
>  	return ch->write(ch, data, len);
>  }
>  
> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
> -{
> -	unsigned long flags;
> -	int res;
> -	spin_lock_irqsave(&smd_lock, flags);
> -	res = ch->write(ch, data, len);
> -	spin_unlock_irqrestore(&smd_lock, flags);
> -	return res;
> -}
> -
>  int smd_read_avail(smd_channel_t *ch)
>  {
>  	return ch->read_avail(ch);
> @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
>  	return ch->write_avail(ch);
>  }
>  
> -int smd_wait_until_readable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
> -int smd_wait_until_writable(smd_channel_t *ch, int bytes)
> -{
> -	return -1;
> -}
> -
>  int smd_cur_packet_size(smd_channel_t *ch)
>  {
>  	return ch->current_packet;
> @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
>  	return 0;
>  }
>  
> -uint32_t smsm_get_state(enum smsm_state_item item)
> -{
> -	unsigned long flags;
> -	uint32_t rv;
> -
> -	spin_lock_irqsave(&smem_lock, flags);
> -
> -	rv = readl(smd_info.state + item * 4);
> -
> -	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
> -		handle_modem_crash();
> -
> -	spin_unlock_irqrestore(&smem_lock, flags);
> -
> -	return rv;
> -}
> -
> -#ifdef CONFIG_ARCH_MSM_SCORPION
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	struct msm_dem_slave_data *ptr;
> -
> -	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       ptr->sleep_time, delay);
> -	ptr->sleep_time = delay;
> -	return 0;
> -}
> -
> -#else
> -
> -int smsm_set_sleep_duration(uint32_t delay)
> -{
> -	uint32_t *ptr;
> -
> -	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
> -	if (ptr == NULL) {
> -		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
> -		return -EIO;
> -	}
> -	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
> -		pr_info("smsm_set_sleep_duration %d -> %d\n",
> -		       *ptr, delay);
> -	*ptr = delay;
> -	return 0;
> -}
> -
> -#endif
> -
>  int smd_core_init(void)
>  {
>  	int r;
> diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
> index 727bfe6..702f34e 100644
> --- a/arch/arm/mach-msm/smd_private.h
> +++ b/arch/arm/mach-msm/smd_private.h
> @@ -148,8 +148,6 @@ enum smsm_state_item {
>  
>  void *smem_alloc(unsigned id, unsigned size);
>  int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
> -uint32_t smsm_get_state(enum smsm_state_item item);
> -int smsm_set_sleep_duration(uint32_t delay);
>  void smsm_print_sleep_info(void);
>  
>  #define SMEM_NUM_SMD_CHANNELS        64
> -- 
> 1.7.10.4

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

* Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
  2014-12-09 14:46   ` dwalker
@ 2014-12-15 23:20     ` Rickard Strandqvist
  -1 siblings, 0 replies; 13+ messages in thread
From: Rickard Strandqvist @ 2014-12-15 23:20 UTC (permalink / raw)
  To: Daniel Walker
  Cc: David Brown, Bryan Huntsman, Russell King, linux-arm-msm,
	linux-arm-kernel, linux-kernel

Hi

My script looks for the same function name, so if they then would be
named exactly the same, they would come up.

But I can not even find drivers/staging/dream/   or is this really new code?


Kind regards
Rickard Strandqvist


2014-12-09 15:46 GMT+01:00  <dwalker@fifo99.com>:
>
> Seems ok to me. These files, and functions, are also in drivers/staging/dream/
> are you removing them there also ?
>
>
> On Sun, Dec 07, 2014 at 02:12:20AM +0100, Rickard Strandqvist wrote:
>> Removes some functions that are not used anywhere:
>> smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
>> smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
>>
>> This was partially found by using a static code analysis program called cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
>>  arch/arm/mach-msm/smd.c                  |  105 ------------------------------
>>  arch/arm/mach-msm/smd_private.h          |    2 -
>>  3 files changed, 116 deletions(-)
>>
>> diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
>> index 029463e..48ddef98 100644
>> --- a/arch/arm/mach-msm/include/mach/msm_smd.h
>> +++ b/arch/arm/mach-msm/include/mach/msm_smd.h
>> @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
>>  ** it will return the requested length written or an error.
>>  */
>>  int smd_write(smd_channel_t *ch, const void *data, int len);
>> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
>>
>>  int smd_write_avail(smd_channel_t *ch);
>>  int smd_read_avail(smd_channel_t *ch);
>> @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
>>  void smd_kick(smd_channel_t *ch);
>>
>>
>> -#if 0
>> -/* these are interruptable waits which will block you until the specified
>> -** number of bytes are readable or writable.
>> -*/
>> -int smd_wait_until_readable(smd_channel_t *ch, int bytes);
>> -int smd_wait_until_writable(smd_channel_t *ch, int bytes);
>> -#endif
>> -
>>  typedef enum {
>>       SMD_PORT_DS = 0,
>>       SMD_PORT_DIAG,
>> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
>> index b1588a1..4bc1e71 100644
>> --- a/arch/arm/mach-msm/smd.c
>> +++ b/arch/arm/mach-msm/smd.c
>> @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
>>       return 0;
>>  }
>>
>> -void smd_sleep_exit(void)
>> -{
>> -     unsigned long flags;
>> -     struct smd_channel *ch;
>> -     int need_int = 0;
>> -
>> -     spin_lock_irqsave(&smd_lock, flags);
>> -     list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
>> -             if (smd_need_int(ch)) {
>> -                     need_int = 1;
>> -                     break;
>> -             }
>> -     }
>> -     list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
>> -             if (smd_need_int(ch)) {
>> -                     need_int = 1;
>> -                     break;
>> -             }
>> -     }
>> -     spin_unlock_irqrestore(&smd_lock, flags);
>> -     do_smd_probe();
>> -
>> -     if (need_int) {
>> -             if (msm_smd_debug_mask & MSM_SMD_DEBUG)
>> -                     pr_info("smd_sleep_exit need interrupt\n");
>> -             tasklet_schedule(&smd_fake_irq_tasklet);
>> -     }
>> -}
>> -
>> -
>>  void smd_kick(smd_channel_t *ch)
>>  {
>>       unsigned long flags;
>> @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
>>       return ch->write(ch, data, len);
>>  }
>>
>> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
>> -{
>> -     unsigned long flags;
>> -     int res;
>> -     spin_lock_irqsave(&smd_lock, flags);
>> -     res = ch->write(ch, data, len);
>> -     spin_unlock_irqrestore(&smd_lock, flags);
>> -     return res;
>> -}
>> -
>>  int smd_read_avail(smd_channel_t *ch)
>>  {
>>       return ch->read_avail(ch);
>> @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
>>       return ch->write_avail(ch);
>>  }
>>
>> -int smd_wait_until_readable(smd_channel_t *ch, int bytes)
>> -{
>> -     return -1;
>> -}
>> -
>> -int smd_wait_until_writable(smd_channel_t *ch, int bytes)
>> -{
>> -     return -1;
>> -}
>> -
>>  int smd_cur_packet_size(smd_channel_t *ch)
>>  {
>>       return ch->current_packet;
>> @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
>>       return 0;
>>  }
>>
>> -uint32_t smsm_get_state(enum smsm_state_item item)
>> -{
>> -     unsigned long flags;
>> -     uint32_t rv;
>> -
>> -     spin_lock_irqsave(&smem_lock, flags);
>> -
>> -     rv = readl(smd_info.state + item * 4);
>> -
>> -     if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
>> -             handle_modem_crash();
>> -
>> -     spin_unlock_irqrestore(&smem_lock, flags);
>> -
>> -     return rv;
>> -}
>> -
>> -#ifdef CONFIG_ARCH_MSM_SCORPION
>> -
>> -int smsm_set_sleep_duration(uint32_t delay)
>> -{
>> -     struct msm_dem_slave_data *ptr;
>> -
>> -     ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
>> -     if (ptr == NULL) {
>> -             pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
>> -             return -EIO;
>> -     }
>> -     if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
>> -             pr_info("smsm_set_sleep_duration %d -> %d\n",
>> -                    ptr->sleep_time, delay);
>> -     ptr->sleep_time = delay;
>> -     return 0;
>> -}
>> -
>> -#else
>> -
>> -int smsm_set_sleep_duration(uint32_t delay)
>> -{
>> -     uint32_t *ptr;
>> -
>> -     ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
>> -     if (ptr == NULL) {
>> -             pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
>> -             return -EIO;
>> -     }
>> -     if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
>> -             pr_info("smsm_set_sleep_duration %d -> %d\n",
>> -                    *ptr, delay);
>> -     *ptr = delay;
>> -     return 0;
>> -}
>> -
>> -#endif
>> -
>>  int smd_core_init(void)
>>  {
>>       int r;
>> diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
>> index 727bfe6..702f34e 100644
>> --- a/arch/arm/mach-msm/smd_private.h
>> +++ b/arch/arm/mach-msm/smd_private.h
>> @@ -148,8 +148,6 @@ enum smsm_state_item {
>>
>>  void *smem_alloc(unsigned id, unsigned size);
>>  int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
>> -uint32_t smsm_get_state(enum smsm_state_item item);
>> -int smsm_set_sleep_duration(uint32_t delay);
>>  void smsm_print_sleep_info(void);
>>
>>  #define SMEM_NUM_SMD_CHANNELS        64
>> --
>> 1.7.10.4

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

* [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
@ 2014-12-15 23:20     ` Rickard Strandqvist
  0 siblings, 0 replies; 13+ messages in thread
From: Rickard Strandqvist @ 2014-12-15 23:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

My script looks for the same function name, so if they then would be
named exactly the same, they would come up.

But I can not even find drivers/staging/dream/   or is this really new code?


Kind regards
Rickard Strandqvist


2014-12-09 15:46 GMT+01:00  <dwalker@fifo99.com>:
>
> Seems ok to me. These files, and functions, are also in drivers/staging/dream/
> are you removing them there also ?
>
>
> On Sun, Dec 07, 2014 at 02:12:20AM +0100, Rickard Strandqvist wrote:
>> Removes some functions that are not used anywhere:
>> smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable()
>> smd_wait_until_readable() smd_write_atomic() smd_sleep_exit()
>>
>> This was partially found by using a static code analysis program called cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  arch/arm/mach-msm/include/mach/msm_smd.h |    9 ---
>>  arch/arm/mach-msm/smd.c                  |  105 ------------------------------
>>  arch/arm/mach-msm/smd_private.h          |    2 -
>>  3 files changed, 116 deletions(-)
>>
>> diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
>> index 029463e..48ddef98 100644
>> --- a/arch/arm/mach-msm/include/mach/msm_smd.h
>> +++ b/arch/arm/mach-msm/include/mach/msm_smd.h
>> @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len);
>>  ** it will return the requested length written or an error.
>>  */
>>  int smd_write(smd_channel_t *ch, const void *data, int len);
>> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
>>
>>  int smd_write_avail(smd_channel_t *ch);
>>  int smd_read_avail(smd_channel_t *ch);
>> @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch);
>>  void smd_kick(smd_channel_t *ch);
>>
>>
>> -#if 0
>> -/* these are interruptable waits which will block you until the specified
>> -** number of bytes are readable or writable.
>> -*/
>> -int smd_wait_until_readable(smd_channel_t *ch, int bytes);
>> -int smd_wait_until_writable(smd_channel_t *ch, int bytes);
>> -#endif
>> -
>>  typedef enum {
>>       SMD_PORT_DS = 0,
>>       SMD_PORT_DIAG,
>> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
>> index b1588a1..4bc1e71 100644
>> --- a/arch/arm/mach-msm/smd.c
>> +++ b/arch/arm/mach-msm/smd.c
>> @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch)
>>       return 0;
>>  }
>>
>> -void smd_sleep_exit(void)
>> -{
>> -     unsigned long flags;
>> -     struct smd_channel *ch;
>> -     int need_int = 0;
>> -
>> -     spin_lock_irqsave(&smd_lock, flags);
>> -     list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
>> -             if (smd_need_int(ch)) {
>> -                     need_int = 1;
>> -                     break;
>> -             }
>> -     }
>> -     list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
>> -             if (smd_need_int(ch)) {
>> -                     need_int = 1;
>> -                     break;
>> -             }
>> -     }
>> -     spin_unlock_irqrestore(&smd_lock, flags);
>> -     do_smd_probe();
>> -
>> -     if (need_int) {
>> -             if (msm_smd_debug_mask & MSM_SMD_DEBUG)
>> -                     pr_info("smd_sleep_exit need interrupt\n");
>> -             tasklet_schedule(&smd_fake_irq_tasklet);
>> -     }
>> -}
>> -
>> -
>>  void smd_kick(smd_channel_t *ch)
>>  {
>>       unsigned long flags;
>> @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len)
>>       return ch->write(ch, data, len);
>>  }
>>
>> -int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
>> -{
>> -     unsigned long flags;
>> -     int res;
>> -     spin_lock_irqsave(&smd_lock, flags);
>> -     res = ch->write(ch, data, len);
>> -     spin_unlock_irqrestore(&smd_lock, flags);
>> -     return res;
>> -}
>> -
>>  int smd_read_avail(smd_channel_t *ch)
>>  {
>>       return ch->read_avail(ch);
>> @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch)
>>       return ch->write_avail(ch);
>>  }
>>
>> -int smd_wait_until_readable(smd_channel_t *ch, int bytes)
>> -{
>> -     return -1;
>> -}
>> -
>> -int smd_wait_until_writable(smd_channel_t *ch, int bytes)
>> -{
>> -     return -1;
>> -}
>> -
>>  int smd_cur_packet_size(smd_channel_t *ch)
>>  {
>>       return ch->current_packet;
>> @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item,
>>       return 0;
>>  }
>>
>> -uint32_t smsm_get_state(enum smsm_state_item item)
>> -{
>> -     unsigned long flags;
>> -     uint32_t rv;
>> -
>> -     spin_lock_irqsave(&smem_lock, flags);
>> -
>> -     rv = readl(smd_info.state + item * 4);
>> -
>> -     if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
>> -             handle_modem_crash();
>> -
>> -     spin_unlock_irqrestore(&smem_lock, flags);
>> -
>> -     return rv;
>> -}
>> -
>> -#ifdef CONFIG_ARCH_MSM_SCORPION
>> -
>> -int smsm_set_sleep_duration(uint32_t delay)
>> -{
>> -     struct msm_dem_slave_data *ptr;
>> -
>> -     ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
>> -     if (ptr == NULL) {
>> -             pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
>> -             return -EIO;
>> -     }
>> -     if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
>> -             pr_info("smsm_set_sleep_duration %d -> %d\n",
>> -                    ptr->sleep_time, delay);
>> -     ptr->sleep_time = delay;
>> -     return 0;
>> -}
>> -
>> -#else
>> -
>> -int smsm_set_sleep_duration(uint32_t delay)
>> -{
>> -     uint32_t *ptr;
>> -
>> -     ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
>> -     if (ptr == NULL) {
>> -             pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
>> -             return -EIO;
>> -     }
>> -     if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
>> -             pr_info("smsm_set_sleep_duration %d -> %d\n",
>> -                    *ptr, delay);
>> -     *ptr = delay;
>> -     return 0;
>> -}
>> -
>> -#endif
>> -
>>  int smd_core_init(void)
>>  {
>>       int r;
>> diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
>> index 727bfe6..702f34e 100644
>> --- a/arch/arm/mach-msm/smd_private.h
>> +++ b/arch/arm/mach-msm/smd_private.h
>> @@ -148,8 +148,6 @@ enum smsm_state_item {
>>
>>  void *smem_alloc(unsigned id, unsigned size);
>>  int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
>> -uint32_t smsm_get_state(enum smsm_state_item item);
>> -int smsm_set_sleep_duration(uint32_t delay);
>>  void smsm_print_sleep_info(void);
>>
>>  #define SMEM_NUM_SMD_CHANNELS        64
>> --
>> 1.7.10.4

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

* Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
  2014-12-15 23:20     ` Rickard Strandqvist
@ 2014-12-18 22:01       ` dwalker at fifo99.com
  -1 siblings, 0 replies; 13+ messages in thread
From: dwalker @ 2014-12-18 22:01 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: David Brown, Bryan Huntsman, Russell King, linux-arm-msm,
	linux-arm-kernel, linux-kernel

On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> Hi
> 
> My script looks for the same function name, so if they then would be
> named exactly the same, they would come up.
> 
> But I can not even find drivers/staging/dream/   or is this really new code?

Maybe it was deleted already ..

Daniel

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

* [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
@ 2014-12-18 22:01       ` dwalker at fifo99.com
  0 siblings, 0 replies; 13+ messages in thread
From: dwalker at fifo99.com @ 2014-12-18 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> Hi
> 
> My script looks for the same function name, so if they then would be
> named exactly the same, they would come up.
> 
> But I can not even find drivers/staging/dream/   or is this really new code?

Maybe it was deleted already ..

Daniel

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

* Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
  2014-12-18 22:01       ` dwalker at fifo99.com
@ 2014-12-18 22:35         ` Arnd Bergmann
  -1 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2014-12-18 22:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: dwalker, Rickard Strandqvist, Russell King, linux-arm-msm,
	linux-kernel, Bryan Huntsman, David Brown

On Thursday 18 December 2014 22:01:28 dwalker@fifo99.com wrote:
> On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> > Hi
> > 
> > My script looks for the same function name, so if they then would be
> > named exactly the same, they would come up.
> > 
> > But I can not even find drivers/staging/dream/   or is this really new code?
> 
> Maybe it was deleted already ..

It's been gone for over four years, after nobody worked on cleaning it up
for a while before that:

commit 3414df8ca38b203c8a5ad8efc32d4a3836a0596d
Author: Greg Kroah-Hartman <gregkh@suse.de>
Date:   Fri Oct 29 12:42:18 2010 -0700

    Staging: dream: remove dream driver and arch from tree
    
    This code is stalled, with no one working on it anymore, and the main
    msm code is now going through the proper channels to get merged
    correctly.
    
    So remove it as it contains a number of kernel information leaks and it
    is doubtful if it even still builds anymore.
    
    Acked-by: Pavel Machek <pavel@ucw.cz>
    Acked-by: Bryan Huntsman <bryanh@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


	Arnd

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

* [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
@ 2014-12-18 22:35         ` Arnd Bergmann
  0 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2014-12-18 22:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 18 December 2014 22:01:28 dwalker at fifo99.com wrote:
> On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> > Hi
> > 
> > My script looks for the same function name, so if they then would be
> > named exactly the same, they would come up.
> > 
> > But I can not even find drivers/staging/dream/   or is this really new code?
> 
> Maybe it was deleted already ..

It's been gone for over four years, after nobody worked on cleaning it up
for a while before that:

commit 3414df8ca38b203c8a5ad8efc32d4a3836a0596d
Author: Greg Kroah-Hartman <gregkh@suse.de>
Date:   Fri Oct 29 12:42:18 2010 -0700

    Staging: dream: remove dream driver and arch from tree
    
    This code is stalled, with no one working on it anymore, and the main
    msm code is now going through the proper channels to get merged
    correctly.
    
    So remove it as it contains a number of kernel information leaks and it
    is doubtful if it even still builds anymore.
    
    Acked-by: Pavel Machek <pavel@ucw.cz>
    Acked-by: Bryan Huntsman <bryanh@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


	Arnd

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

* Re: ***UNCHECKED*** Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
  2014-12-18 22:35         ` Arnd Bergmann
@ 2014-12-20 22:46           ` dwalker at fifo99.com
  -1 siblings, 0 replies; 13+ messages in thread
From: dwalker @ 2014-12-20 22:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, Rickard Strandqvist, Russell King,
	linux-arm-msm, linux-kernel, Bryan Huntsman, David Brown

On Thu, Dec 18, 2014 at 11:35:04PM +0100, Arnd Bergmann wrote:
> On Thursday 18 December 2014 22:01:28 dwalker@fifo99.com wrote:
> > On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> > > Hi
> > > 
> > > My script looks for the same function name, so if they then would be
> > > named exactly the same, they would come up.
> > > 
> > > But I can not even find drivers/staging/dream/   or is this really new code?
> > 
> > Maybe it was deleted already ..
> 
> It's been gone for over four years, after nobody worked on cleaning it up
> for a while before that:
> 
> commit 3414df8ca38b203c8a5ad8efc32d4a3836a0596d
> Author: Greg Kroah-Hartman <gregkh@suse.de>
> Date:   Fri Oct 29 12:42:18 2010 -0700
> 
>     Staging: dream: remove dream driver and arch from tree
>     
>     This code is stalled, with no one working on it anymore, and the main
>     msm code is now going through the proper channels to get merged
>     correctly.
>     
>     So remove it as it contains a number of kernel information leaks and it
>     is doubtful if it even still builds anymore.
>     
>     Acked-by: Pavel Machek <pavel@ucw.cz>
>     Acked-by: Bryan Huntsman <bryanh@codeaurora.org>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


Yeah, somehow still ended up in my 3.18 tree. Must have been a "git reset".

Daniel

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

* ***UNCHECKED*** Re: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions
@ 2014-12-20 22:46           ` dwalker at fifo99.com
  0 siblings, 0 replies; 13+ messages in thread
From: dwalker at fifo99.com @ 2014-12-20 22:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 18, 2014 at 11:35:04PM +0100, Arnd Bergmann wrote:
> On Thursday 18 December 2014 22:01:28 dwalker at fifo99.com wrote:
> > On Tue, Dec 16, 2014 at 12:20:43AM +0100, Rickard Strandqvist wrote:
> > > Hi
> > > 
> > > My script looks for the same function name, so if they then would be
> > > named exactly the same, they would come up.
> > > 
> > > But I can not even find drivers/staging/dream/   or is this really new code?
> > 
> > Maybe it was deleted already ..
> 
> It's been gone for over four years, after nobody worked on cleaning it up
> for a while before that:
> 
> commit 3414df8ca38b203c8a5ad8efc32d4a3836a0596d
> Author: Greg Kroah-Hartman <gregkh@suse.de>
> Date:   Fri Oct 29 12:42:18 2010 -0700
> 
>     Staging: dream: remove dream driver and arch from tree
>     
>     This code is stalled, with no one working on it anymore, and the main
>     msm code is now going through the proper channels to get merged
>     correctly.
>     
>     So remove it as it contains a number of kernel information leaks and it
>     is doubtful if it even still builds anymore.
>     
>     Acked-by: Pavel Machek <pavel@ucw.cz>
>     Acked-by: Bryan Huntsman <bryanh@codeaurora.org>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


Yeah, somehow still ended up in my 3.18 tree. Must have been a "git reset".

Daniel

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

end of thread, other threads:[~2014-12-20 22:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-07  1:12 [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions Rickard Strandqvist
2014-12-07  1:12 ` Rickard Strandqvist
2014-12-09 14:46 ` dwalker
2014-12-09 14:46   ` dwalker at fifo99.com
2014-12-09 14:46   ` dwalker
2014-12-15 23:20   ` Rickard Strandqvist
2014-12-15 23:20     ` Rickard Strandqvist
2014-12-18 22:01     ` dwalker
2014-12-18 22:01       ` dwalker at fifo99.com
2014-12-18 22:35       ` Arnd Bergmann
2014-12-18 22:35         ` Arnd Bergmann
2014-12-20 22:46         ` ***UNCHECKED*** " dwalker
2014-12-20 22:46           ` dwalker at fifo99.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.