diff mbox series

[v1] ASoC: Intel: Skylake: Print constant literals from format specifier

Message ID 20190621113116.47525-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit ff30779bd50eb823e2e75cfc7cc8a3373bfa3fd9
Headers show
Series [v1] ASoC: Intel: Skylake: Print constant literals from format specifier | expand

Commit Message

Andy Shevchenko June 21, 2019, 11:31 a.m. UTC
Instead of using two additional "%s" specifiers, put the constant string
literals directly to the format specifier.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/intel/skylake/skl-sst.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andy Shevchenko Aug. 13, 2019, 2:42 p.m. UTC | #1
On Fri, Jun 21, 2019 at 02:31:16PM +0300, Andy Shevchenko wrote:
> Instead of using two additional "%s" specifiers, put the constant string
> literals directly to the format specifier.
> 

Pierre, does it look good to you?

> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Vinod Koul <vkoul@kernel.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/intel/skylake/skl-sst.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
> index 13c636dece56..f3e1399450db 100644
> --- a/sound/soc/intel/skylake/skl-sst.c
> +++ b/sound/soc/intel/skylake/skl-sst.c
> @@ -421,8 +421,7 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid)
>  	int ret = 0;
>  	char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
>  
> -	snprintf(mod_name, sizeof(mod_name), "%s%pUL%s",
> -					     "intel/dsp_fw_", guid, ".bin");
> +	snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", guid);
>  
>  	module_entry = skl_module_get_from_id(ctx, mod_id);
>  	if (module_entry == NULL) {
> -- 
> 2.20.1
>
Pierre-Louis Bossart Aug. 13, 2019, 2:52 p.m. UTC | #2
On 8/13/19 9:42 AM, Andy Shevchenko wrote:
> On Fri, Jun 21, 2019 at 02:31:16PM +0300, Andy Shevchenko wrote:
>> Instead of using two additional "%s" specifiers, put the constant string
>> literals directly to the format specifier.
>>
> 
> Pierre, does it look good to you?

LGTM but Cezary should chime in for changes to the Skylake driver.

> 
>> Cc: Liam Girdwood <lgirdwood@gmail.com>
>> Cc: Mark Brown <broonie@kernel.org>
>> Cc: Vinod Koul <vkoul@kernel.org>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>>   sound/soc/intel/skylake/skl-sst.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
>> index 13c636dece56..f3e1399450db 100644
>> --- a/sound/soc/intel/skylake/skl-sst.c
>> +++ b/sound/soc/intel/skylake/skl-sst.c
>> @@ -421,8 +421,7 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid)
>>   	int ret = 0;
>>   	char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
>>   
>> -	snprintf(mod_name, sizeof(mod_name), "%s%pUL%s",
>> -					     "intel/dsp_fw_", guid, ".bin");
>> +	snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", guid);
>>   
>>   	module_entry = skl_module_get_from_id(ctx, mod_id);
>>   	if (module_entry == NULL) {
>> -- 
>> 2.20.1
>>
>
Cezary Rojewski Aug. 13, 2019, 3:15 p.m. UTC | #3
On 2019-08-13 16:52, Pierre-Louis Bossart wrote:
> On 8/13/19 9:42 AM, Andy Shevchenko wrote:
>> On Fri, Jun 21, 2019 at 02:31:16PM +0300, Andy Shevchenko wrote:
>>> Instead of using two additional "%s" specifiers, put the constant string
>>> literals directly to the format specifier.
>>>
>>
>> Pierre, does it look good to you?
> 
> LGTM but Cezary should chime in for changes to the Skylake driver.

Seems this one escaped my eye. Looks good to me too.

>>> Cc: Liam Girdwood <lgirdwood@gmail.com>
>>> Cc: Mark Brown <broonie@kernel.org>
>>> Cc: Vinod Koul <vkoul@kernel.org>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> ---
>>>   sound/soc/intel/skylake/skl-sst.c | 3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/sound/soc/intel/skylake/skl-sst.c 
>>> b/sound/soc/intel/skylake/skl-sst.c
>>> index 13c636dece56..f3e1399450db 100644
>>> --- a/sound/soc/intel/skylake/skl-sst.c
>>> +++ b/sound/soc/intel/skylake/skl-sst.c
>>> @@ -421,8 +421,7 @@ static int skl_load_module(struct sst_dsp *ctx, 
>>> u16 mod_id, u8 *guid)
>>>       int ret = 0;
>>>       char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
>>> -    snprintf(mod_name, sizeof(mod_name), "%s%pUL%s",
>>> -                         "intel/dsp_fw_", guid, ".bin");
>>> +    snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", 
>>> guid);
>>>       module_entry = skl_module_get_from_id(ctx, mod_id);
>>>       if (module_entry == NULL) {
>>> -- 
>>> 2.20.1
>>>
>>
>
diff mbox series

Patch

diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 13c636dece56..f3e1399450db 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -421,8 +421,7 @@  static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid)
 	int ret = 0;
 	char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
 
-	snprintf(mod_name, sizeof(mod_name), "%s%pUL%s",
-					     "intel/dsp_fw_", guid, ".bin");
+	snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", guid);
 
 	module_entry = skl_module_get_from_id(ctx, mod_id);
 	if (module_entry == NULL) {