diff mbox

media: pci: solo6x10: solo6x10-enc.c: Remove unused function

Message ID 1419184727-11224-1-git-send-email-rickard_strandqvist@spectrumdigital.se (mailing list archive)
State New, archived
Headers show

Commit Message

Rickard Strandqvist Dec. 21, 2014, 5:58 p.m. UTC
Remove the function solo_s_jpeg_qp() that is not used anywhere.

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/media/pci/solo6x10/solo6x10-enc.c |   35 -----------------------------
 drivers/media/pci/solo6x10/solo6x10.h     |    2 --
 2 files changed, 37 deletions(-)

Comments

Hans Verkuil Jan. 16, 2015, 10:42 a.m. UTC | #1
Ismael, Andrey,

Can you take a look at this? Shouldn't solo_s_jpeg_qp() be hooked up to something?

Regards,

	Hans

On 12/21/2014 06:58 PM, Rickard Strandqvist wrote:
> Remove the function solo_s_jpeg_qp() that is not used anywhere.
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/media/pci/solo6x10/solo6x10-enc.c |   35 -----------------------------
>  drivers/media/pci/solo6x10/solo6x10.h     |    2 --
>  2 files changed, 37 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-enc.c b/drivers/media/pci/solo6x10/solo6x10-enc.c
> index d19c0ae..6b589b8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-enc.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-enc.c
> @@ -175,41 +175,6 @@ out:
>  	return 0;
>  }
>  
> -/**
> - * Set channel Quality Profile (0-3).
> - */
> -void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
> -		    unsigned int qp)
> -{
> -	unsigned long flags;
> -	unsigned int idx, reg;
> -
> -	if ((ch > 31) || (qp > 3))
> -		return;
> -
> -	if (solo_dev->type == SOLO_DEV_6010)
> -		return;
> -
> -	if (ch < 16) {
> -		idx = 0;
> -		reg = SOLO_VE_JPEG_QP_CH_L;
> -	} else {
> -		ch -= 16;
> -		idx = 1;
> -		reg = SOLO_VE_JPEG_QP_CH_H;
> -	}
> -	ch *= 2;
> -
> -	spin_lock_irqsave(&solo_dev->jpeg_qp_lock, flags);
> -
> -	solo_dev->jpeg_qp[idx] &= ~(3 << ch);
> -	solo_dev->jpeg_qp[idx] |= (qp & 3) << ch;
> -
> -	solo_reg_write(solo_dev, reg, solo_dev->jpeg_qp[idx]);
> -
> -	spin_unlock_irqrestore(&solo_dev->jpeg_qp_lock, flags);
> -}
> -
>  int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch)
>  {
>  	int idx;
> diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
> index 72017b7..ad5afc6 100644
> --- a/drivers/media/pci/solo6x10/solo6x10.h
> +++ b/drivers/media/pci/solo6x10/solo6x10.h
> @@ -399,8 +399,6 @@ int solo_eeprom_write(struct solo_dev *solo_dev, int loc,
>  		      __be16 data);
>  
>  /* JPEG Qp functions */
> -void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
> -		    unsigned int qp);
>  int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch);
>  
>  #define CHK_FLAGS(v, flags) (((v) & (flags)) == (flags))
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil Jan. 16, 2015, 10:55 a.m. UTC | #2
(resent with correct email address for Ismael)

Ismael, Andrey,

Can you take a look at this? Shouldn't solo_s_jpeg_qp() be hooked up to something?

Regards,

	Hans

On 12/21/2014 06:58 PM, Rickard Strandqvist wrote:
> Remove the function solo_s_jpeg_qp() that is not used anywhere.
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/media/pci/solo6x10/solo6x10-enc.c |   35 -----------------------------
>  drivers/media/pci/solo6x10/solo6x10.h     |    2 --
>  2 files changed, 37 deletions(-)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10-enc.c b/drivers/media/pci/solo6x10/solo6x10-enc.c
> index d19c0ae..6b589b8 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-enc.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-enc.c
> @@ -175,41 +175,6 @@ out:
>  	return 0;
>  }
>  
> -/**
> - * Set channel Quality Profile (0-3).
> - */
> -void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
> -		    unsigned int qp)
> -{
> -	unsigned long flags;
> -	unsigned int idx, reg;
> -
> -	if ((ch > 31) || (qp > 3))
> -		return;
> -
> -	if (solo_dev->type == SOLO_DEV_6010)
> -		return;
> -
> -	if (ch < 16) {
> -		idx = 0;
> -		reg = SOLO_VE_JPEG_QP_CH_L;
> -	} else {
> -		ch -= 16;
> -		idx = 1;
> -		reg = SOLO_VE_JPEG_QP_CH_H;
> -	}
> -	ch *= 2;
> -
> -	spin_lock_irqsave(&solo_dev->jpeg_qp_lock, flags);
> -
> -	solo_dev->jpeg_qp[idx] &= ~(3 << ch);
> -	solo_dev->jpeg_qp[idx] |= (qp & 3) << ch;
> -
> -	solo_reg_write(solo_dev, reg, solo_dev->jpeg_qp[idx]);
> -
> -	spin_unlock_irqrestore(&solo_dev->jpeg_qp_lock, flags);
> -}
> -
>  int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch)
>  {
>  	int idx;
> diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
> index 72017b7..ad5afc6 100644
> --- a/drivers/media/pci/solo6x10/solo6x10.h
> +++ b/drivers/media/pci/solo6x10/solo6x10.h
> @@ -399,8 +399,6 @@ int solo_eeprom_write(struct solo_dev *solo_dev, int loc,
>  		      __be16 data);
>  
>  /* JPEG Qp functions */
> -void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
> -		    unsigned int qp);
>  int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch);
>  
>  #define CHK_FLAGS(v, flags) (((v) & (flags)) == (flags))
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ismael Luceno Jan. 17, 2015, 1:23 p.m. UTC | #3
On Fri, 16 Jan 2015 11:55:15 +0100
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> (resent with correct email address for Ismael)
> 
> Ismael, Andrey,
> 
> Can you take a look at this? Shouldn't solo_s_jpeg_qp() be hooked up
> to something?

The feature was never implemented, so yes, and we should keep it around.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rickard Strandqvist Jan. 17, 2015, 1:27 p.m. UTC | #4
2015-01-17 14:23 GMT+01:00 Ismael Luceno <ismael.luceno@gmail.com>:
> On Fri, 16 Jan 2015 11:55:15 +0100
> Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> (resent with correct email address for Ismael)
>>
>> Ismael, Andrey,
>>
>> Can you take a look at this? Shouldn't solo_s_jpeg_qp() be hooked up
>> to something?
>
> The feature was never implemented, so yes, and we should keep it around.


Hi

But maybe add a comment then?

Kind regards
Rickard Strandqvist
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/pci/solo6x10/solo6x10-enc.c b/drivers/media/pci/solo6x10/solo6x10-enc.c
index d19c0ae..6b589b8 100644
--- a/drivers/media/pci/solo6x10/solo6x10-enc.c
+++ b/drivers/media/pci/solo6x10/solo6x10-enc.c
@@ -175,41 +175,6 @@  out:
 	return 0;
 }
 
-/**
- * Set channel Quality Profile (0-3).
- */
-void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
-		    unsigned int qp)
-{
-	unsigned long flags;
-	unsigned int idx, reg;
-
-	if ((ch > 31) || (qp > 3))
-		return;
-
-	if (solo_dev->type == SOLO_DEV_6010)
-		return;
-
-	if (ch < 16) {
-		idx = 0;
-		reg = SOLO_VE_JPEG_QP_CH_L;
-	} else {
-		ch -= 16;
-		idx = 1;
-		reg = SOLO_VE_JPEG_QP_CH_H;
-	}
-	ch *= 2;
-
-	spin_lock_irqsave(&solo_dev->jpeg_qp_lock, flags);
-
-	solo_dev->jpeg_qp[idx] &= ~(3 << ch);
-	solo_dev->jpeg_qp[idx] |= (qp & 3) << ch;
-
-	solo_reg_write(solo_dev, reg, solo_dev->jpeg_qp[idx]);
-
-	spin_unlock_irqrestore(&solo_dev->jpeg_qp_lock, flags);
-}
-
 int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch)
 {
 	int idx;
diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
index 72017b7..ad5afc6 100644
--- a/drivers/media/pci/solo6x10/solo6x10.h
+++ b/drivers/media/pci/solo6x10/solo6x10.h
@@ -399,8 +399,6 @@  int solo_eeprom_write(struct solo_dev *solo_dev, int loc,
 		      __be16 data);
 
 /* JPEG Qp functions */
-void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
-		    unsigned int qp);
 int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch);
 
 #define CHK_FLAGS(v, flags) (((v) & (flags)) == (flags))