[alsa-devel] [PATCH v2 4/4] ASoC: acpi: remove hard-coded i2c-device name length

Vinod Koul vinod.koul at intel.com
Mon Jan 8 05:41:33 CET 2018


On Fri, Jan 05, 2018 at 02:55:36PM -0600, Pierre-Louis Bossart wrote:
> Remove hard-coded [16] array size, replace with clearer description and
> dependency on ACPI_ID_LEN
> No functionality change
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> ---
>  include/sound/soc-acpi.h                | 3 +++
>  sound/soc/intel/boards/bytcht_da7213.c  | 2 +-
>  sound/soc/intel/boards/bytcht_es8316.c  | 2 +-
>  sound/soc/intel/boards/bytcr_rt5640.c   | 2 +-
>  sound/soc/intel/boards/bytcr_rt5651.c   | 2 +-
>  sound/soc/intel/boards/cht_bsw_rt5645.c | 4 ++--
>  sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +-
>  7 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
> index d1aaf876cd26..703c78483113 100644
> --- a/include/sound/soc-acpi.h
> +++ b/include/sound/soc-acpi.h
> @@ -27,6 +27,9 @@ struct snd_soc_acpi_package_context {
>  	bool data_valid;
>  };
>  
> +/* codec name is used in DAIs is i2c-<HID>:00 with HID being 8 chars */
> +#define SND_SOC_ACPI_I2C_DEVICE_NAME_LEN (4 + ACPI_ID_LEN + 3 + 1)

nitpicking, thats a very long name :(

how about SND_ACPI_I2C_ID_LEN, we can drop SOC. And replace DEVICE_NAME with ID

-- 
~Vinod


More information about the Alsa-devel mailing list