History

ALSA: ctl: remove dimen member from elem_info structure

The 'dimen' member of 'struct snd_ctl_elem_info' is designed to deliver information to use an array of value as multi-dimensional values. This feature is used just by echoaudio PCI driver, and fortunately it's not used by the other applications than 'echomixer' in alsa-tools. In a previous commit, usage of 'dimen' member is removed from echoaudio PCI driver. Nowadays no driver/application use the feature. This commit removes the member from structure.

Takashi Sakamoto committed 6 years ago

Commit ff163511 parent e67c3f02 files · +1 −37Browse files

Unified · Split

2 files
  1. include/uapi/sound/asound.h +1 −5
  2. sound/core/control.c +0 −32
include/uapi/sound/asound.h+1−5
@@ -1040,11 +1040,7 @@ struct snd_ctl_elem_info { · 1039 unmodified lines
10401040 } enumerated;
10411041 unsigned char reserved[128];
10421042 } value;
1043− union {
1044− unsigned short d[4]; /* dimensions */
1045− unsigned short *d_ptr; /* indirect - obsoleted */
1046− } dimen;
1047− unsigned char reserved[64-4*sizeof(unsigned short)];
1043+ unsigned char reserved[64];
10481044 };
10491045
10501046 struct snd_ctl_elem_value {
sound/core/control.c+0−32
@@ -758,36 +758,6 @@ static int snd_ctl_elem_list(struct snd_card *card, · 757 unmodified lines
758758 return err;
759759 }
760760
761−static bool validate_element_member_dimension(struct snd_ctl_elem_info *info)
762−{
763− unsigned int members;
764− unsigned int i;
765−
766− if (info->dimen.d[0] == 0)
767− return true;
768−
769− members = 1;
770− for (i = 0; i < ARRAY_SIZE(info->dimen.d); ++i) {
771− if (info->dimen.d[i] == 0)
772− break;
773− members *= info->dimen.d[i];
774−
775− /*
776− * info->count should be validated in advance, to guarantee
777− * calculation soundness.
778− */
779− if (members > info->count)
780− return false;
781− }
782−
783− for (++i; i < ARRAY_SIZE(info->dimen.d); ++i) {
784− if (info->dimen.d[i] > 0)
785− return false;
786− }
787−
788− return members == info->count;
789−}
790−
791761 static int snd_ctl_elem_info(struct snd_ctl_file *ctl,
792762 struct snd_ctl_elem_info *info)
793763 {
@@ -1280,8 +1250,6 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, · 486 unmodified lines
12801250 if (info->count < 1 ||
12811251 info->count > max_value_counts[info->type])
12821252 return -EINVAL;
1283− if (!validate_element_member_dimension(info))
1284− return -EINVAL;
12851253 private_size = value_sizes[info->type] * info->count;
12861254
12871255 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t