[3/6] ALSA: hda: intel-nhlt: remove useless OR operation
diff mbox series

Message ID 20190719170610.17610-4-pierre-louis.bossart@linux.intel.com
State New
Headers show
Series
  • ALSA/HDA: abort probe when DMICs are detected
Related show

Commit Message

Pierre-Louis Bossart July 19, 2019, 5:06 p.m. UTC
Each assignment is final so there's no point in doing an OR.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/hda/intel-nhlt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Takashi Iwai July 19, 2019, 6:09 p.m. UTC | #1
On Fri, 19 Jul 2019 19:06:07 +0200,
Pierre-Louis Bossart wrote:
> 
> Each assignment is final so there's no point in doing an OR.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Please fold into the patch 2.  There is no reason to split.


thanks,

Takashi

> ---
>  sound/hda/intel-nhlt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c
> index b9d00c1b25d5..7ba871e470f2 100644
> --- a/sound/hda/intel-nhlt.c
> +++ b/sound/hda/intel-nhlt.c
> @@ -73,13 +73,13 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
>  			switch (cfg->array_type) {
>  			case NHLT_MIC_ARRAY_2CH_SMALL:
>  			case NHLT_MIC_ARRAY_2CH_BIG:
> -				dmic_geo |= MIC_ARRAY_2CH;
> +				dmic_geo = MIC_ARRAY_2CH;
>  				break;
>  
>  			case NHLT_MIC_ARRAY_4CH_1ST_GEOM:
>  			case NHLT_MIC_ARRAY_4CH_L_SHAPED:
>  			case NHLT_MIC_ARRAY_4CH_2ND_GEOM:
> -				dmic_geo |= MIC_ARRAY_4CH;
> +				dmic_geo = MIC_ARRAY_4CH;
>  				break;
>  
>  			default:
> -- 
> 2.20.1
>
Pierre-Louis Bossart July 19, 2019, 6:20 p.m. UTC | #2
Thanks for the quick review Takashi, much appreciated.

On 7/19/19 1:09 PM, Takashi Iwai wrote:
> On Fri, 19 Jul 2019 19:06:07 +0200,
> Pierre-Louis Bossart wrote:
>>
>> Each assignment is final so there's no point in doing an OR.
>>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> Please fold into the patch 2.  There is no reason to split.

Sure. I just wanted to keep this separate since patch2 is mostly about 
moving code. No problem to squash it.

> 
> 
> thanks,
> 
> Takashi
> 
>> ---
>>   sound/hda/intel-nhlt.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c
>> index b9d00c1b25d5..7ba871e470f2 100644
>> --- a/sound/hda/intel-nhlt.c
>> +++ b/sound/hda/intel-nhlt.c
>> @@ -73,13 +73,13 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
>>   			switch (cfg->array_type) {
>>   			case NHLT_MIC_ARRAY_2CH_SMALL:
>>   			case NHLT_MIC_ARRAY_2CH_BIG:
>> -				dmic_geo |= MIC_ARRAY_2CH;
>> +				dmic_geo = MIC_ARRAY_2CH;
>>   				break;
>>   
>>   			case NHLT_MIC_ARRAY_4CH_1ST_GEOM:
>>   			case NHLT_MIC_ARRAY_4CH_L_SHAPED:
>>   			case NHLT_MIC_ARRAY_4CH_2ND_GEOM:
>> -				dmic_geo |= MIC_ARRAY_4CH;
>> +				dmic_geo = MIC_ARRAY_4CH;
>>   				break;
>>   
>>   			default:
>> -- 
>> 2.20.1
>>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Takashi Iwai July 19, 2019, 6:30 p.m. UTC | #3
On Fri, 19 Jul 2019 20:20:58 +0200,
Pierre-Louis Bossart wrote:
> 
> Thanks for the quick review Takashi, much appreciated.
> 
> On 7/19/19 1:09 PM, Takashi Iwai wrote:
> > On Fri, 19 Jul 2019 19:06:07 +0200,
> > Pierre-Louis Bossart wrote:
> >>
> >> Each assignment is final so there's no point in doing an OR.
> >>
> >> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >
> > Please fold into the patch 2.  There is no reason to split.
> 
> Sure. I just wanted to keep this separate since patch2 is mostly about
> moving code. No problem to squash it.

FWIW, if it's really a code movement, it'd make sense to split, yes.
But in this case, the patch 2 simply puts a new code.  The actual code
"move" happens in the patch 5.


thanks,

Takashi

Patch
diff mbox series

diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c
index b9d00c1b25d5..7ba871e470f2 100644
--- a/sound/hda/intel-nhlt.c
+++ b/sound/hda/intel-nhlt.c
@@ -73,13 +73,13 @@  int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
 			switch (cfg->array_type) {
 			case NHLT_MIC_ARRAY_2CH_SMALL:
 			case NHLT_MIC_ARRAY_2CH_BIG:
-				dmic_geo |= MIC_ARRAY_2CH;
+				dmic_geo = MIC_ARRAY_2CH;
 				break;
 
 			case NHLT_MIC_ARRAY_4CH_1ST_GEOM:
 			case NHLT_MIC_ARRAY_4CH_L_SHAPED:
 			case NHLT_MIC_ARRAY_4CH_2ND_GEOM:
-				dmic_geo |= MIC_ARRAY_4CH;
+				dmic_geo = MIC_ARRAY_4CH;
 				break;
 
 			default: