diff mbox

ASoC: Intel: Skylake: Fix a couple signedness bugs

Message ID 20151212123815.GA21408@mwanda (mailing list archive)
State Accepted
Commit db4e561378b539230feb4db5e7d5d548c2db2cd4
Headers show

Commit Message

Dan Carpenter Dec. 12, 2015, 12:38 p.m. UTC
These need to be unsigned because they hold negative error codes.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Vinod Koul Dec. 16, 2015, 2:44 p.m. UTC | #1
On Sat, Dec 12, 2015 at 03:38:15PM +0300, Dan Carpenter wrote:
> These need to be unsigned because they hold negative error codes.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Vinod Koul <vinod.koul@intel.com>

> 
> diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
> index 8cd5cdb..e26f474 100644
> --- a/sound/soc/intel/skylake/skl-sst.c
> +++ b/sound/soc/intel/skylake/skl-sst.c
> @@ -208,7 +208,7 @@ static unsigned int skl_get_errorcode(struct sst_dsp *ctx)
>   * since get/set_module are called from DAPM context,
>   * we don't need lock for usage count
>   */
> -static unsigned int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
> +static int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
>  {
>  	struct skl_module_table *module;
>  
> @@ -220,7 +220,7 @@ static unsigned int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
>  	return -EINVAL;
>  }
>  
> -static unsigned int skl_put_module(struct sst_dsp *ctx, u16 mod_id)
> +static int skl_put_module(struct sst_dsp *ctx, u16 mod_id)
>  {
>  	struct skl_module_table *module;
>  
> @@ -340,7 +340,7 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, char *guid)
>  
>  static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id)
>  {
> -	unsigned int usage_cnt;
> +	int usage_cnt;
>  	struct skl_sst *skl = ctx->thread_context;
>  	int ret = 0;
>  
>
Dan Carpenter Dec. 16, 2015, 2:55 p.m. UTC | #2
On Wed, Dec 16, 2015 at 08:14:00PM +0530, Vinod Koul wrote:
> On Sat, Dec 12, 2015 at 03:38:15PM +0300, Dan Carpenter wrote:
> > These need to be unsigned because they hold negative error codes.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Acked-by: Vinod Koul <vinod.koul@intel.com>

Sorry, I sent a v2 of this with "be unsigned" changed to "be signed" in
the changelog, but I messed up the In-Reply-To header so it was a new
thread.

regards,
dan carpenter
Vinod Koul Dec. 16, 2015, 3:59 p.m. UTC | #3
On Wed, Dec 16, 2015 at 05:55:18PM +0300, Dan Carpenter wrote:
> On Wed, Dec 16, 2015 at 08:14:00PM +0530, Vinod Koul wrote:
> > On Sat, Dec 12, 2015 at 03:38:15PM +0300, Dan Carpenter wrote:
> > > These need to be unsigned because they hold negative error codes.
> > > 
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Acked-by: Vinod Koul <vinod.koul@intel.com>
> 
> Sorry, I sent a v2 of this with "be unsigned" changed to "be signed" in
> the changelog, but I messed up the In-Reply-To header so it was a new
> thread.

No issues, Acked v2 now :)
diff mbox

Patch

diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 8cd5cdb..e26f474 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -208,7 +208,7 @@  static unsigned int skl_get_errorcode(struct sst_dsp *ctx)
  * since get/set_module are called from DAPM context,
  * we don't need lock for usage count
  */
-static unsigned int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
+static int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
 {
 	struct skl_module_table *module;
 
@@ -220,7 +220,7 @@  static unsigned int skl_get_module(struct sst_dsp *ctx, u16 mod_id)
 	return -EINVAL;
 }
 
-static unsigned int skl_put_module(struct sst_dsp *ctx, u16 mod_id)
+static int skl_put_module(struct sst_dsp *ctx, u16 mod_id)
 {
 	struct skl_module_table *module;
 
@@ -340,7 +340,7 @@  static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, char *guid)
 
 static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id)
 {
-	unsigned int usage_cnt;
+	int usage_cnt;
 	struct skl_sst *skl = ctx->thread_context;
 	int ret = 0;