[PATCH v7 03/14] ASoC: Intel: catpt: Add IPC message handlers

Amadeusz Sławiński amadeuszx.slawinski at linux.intel.com
Mon Sep 21 15:58:33 CEST 2020


On 9/21/2020 2:59 PM, Andy Shevchenko wrote:
>> +struct catpt_set_volume_input {
>> +	u32 channel;
>> +	u32 target_volume;
>> +	u64 curve_duration;
>> +	enum catpt_audio_curve_type curve_type __aligned(4);
>> +} __packed;
> How this __packed changes anything? In general __packed doesn't make sense for
> in-kernel data structures. Otherwise you have to use proper (POD) types for
> data. Ditto for all similar cases.

All of __packed use in code is done on structures used to communicate 
with FW, which is binary interface, so it is not kernel only structure, 
as it is also FW one. While we can expect compiler to do the right 
thing, I consider it is better to be explicit about what kind of data we 
are handling, so there aren't any surprises.


More information about the Alsa-devel mailing list