Skip to content

Commit a4e7dd3

Browse files
wangbaolin719arndb
authored andcommitted
ALSA: Avoid using timespec for struct snd_ctl_elem_value
The struct snd_ctl_elem_value will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Since there are no drivers will implemented the tstamp member of the struct snd_ctl_elem_value, and also the stucture size will not be changed if we change timespec to s64 for tstamp member of struct snd_ctl_elem_value. From Takashi's comments, "In the library, applications are not expected to access to this structure directly. The applications get opaque pointer to the structure and must use any control APIs to operate it. Actually the library produce no API to handle 'struct snd_ctl_elem_value.tstamp'. This means that we can drop this member from alsa-lib without decline of functionality." Thus we can simply remove the tstamp member to avoid using the type which is not year 2038 safe on 32bits system. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent a07804c commit a4e7dd3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎include/uapi/sound/asound.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,7 @@ struct snd_ctl_elem_value {
957957
} bytes;
958958
struct snd_aes_iec958 iec958;
959959
} value; /* RO */
960-
struct timespec tstamp;
961-
unsigned char reserved[128-sizeof(struct timespec)];
960+
unsigned char reserved[128];
962961
};
963962

964963
struct snd_ctl_tlv {

0 commit comments

Comments
 (0)