alsa/0070-control-Remove-access-to-the-deprecated-dimen-fields.patch
Takashi Iwai 0fcb2a0c4b Accepting request 774837 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes:
  ucm-parser fixes and enhancements, configure script cleanup,
  fixes of 5.6 kernel ABI, O_CLOEXEC flag fix:
  0064-ucm-parser-cosmetic-fixes-in-the-comments.patch
  0065-configure.ac-remove-an-unnecessary-libtool-fix.patch
  0066-ucm-parser-use-correct-filename-in-parser_master_fil.patch
  0067-ucm-the-ucm2-subdirectory-is-driver-name-based.patch
  0068-ucm-implement-RenameDevice-and-RemoveDevice-verb-man.patch
  0069-ucm-fill-missing-device-entries-conflicting-supporte.patch
  0070-control-Remove-access-to-the-deprecated-dimen-fields.patch
  0071-topology-Drop-SNDRV_CTL_ELEM_ACCESS_TIMESTAMP-access.patch
  0072-uapi-Sync-with-5.6-kernel-ABI.patch
  0073-ucm-parser-add-error-message-to-verb_dev_list_add.patch
  0074-do-not-set-close-on-exec-flag-on-descriptor-if-it-wa.patch

OBS-URL: https://build.opensuse.org/request/show/774837
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=267
2020-02-17 11:44:38 +00:00

111 lines
3.7 KiB
Diff

From 43e137c06451bbdd7998ec5bef20ef82d9f4e5a7 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 10 Feb 2020 12:47:19 +0100
Subject: [PATCH 70/74] control: Remove access to the deprecated dimen fields
The dimen fields of control element has been deprecated, and it's
finally dropped in kernel 5.6 ABI definition. Remove the
corresponding accesses in alsa-lib code.
As of this patch, it's disabled via ifdef, just to be sure. The
disabled code should be removed in a later stage as a cleanup.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/control.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/control/control.c b/src/control/control.c
index 33650155cac7..27f421350fb7 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -303,6 +303,7 @@ int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info)
return ctl->ops->element_info(ctl, info);
}
+#if 0 /* deprecated */
static bool validate_element_member_dimension(snd_ctl_elem_info_t *info)
{
unsigned int members;
@@ -328,6 +329,9 @@ static bool validate_element_member_dimension(snd_ctl_elem_info_t *info)
return members == info->count;
}
+#else /* deprecated */
+#define validate_element_member_dimension(info) true
+#endif /* deprecated */
/**
* \brief Create and add some user-defined control elements of integer type.
@@ -2510,11 +2514,12 @@ const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj)
* #snd_ctl_elem_info_get_dimensions is deprecated without any replacement.
*/
#ifndef DOXYGEN
-EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj)
+EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj ATTRIBUTE_UNUSED)
#else
int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj)
#endif
{
+#if 0 /* deprecated */
int i;
assert(obj);
@@ -2522,6 +2527,9 @@ int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj)
if (obj->dimen.d[i])
break;
return i + 1;
+#else
+ return -EINVAL;
+#endif
}
use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3);
@@ -2535,15 +2543,19 @@ use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info
* #snd_ctl_elem_info_get_dimension is deprecated without any replacement.
*/
#ifndef DOXYGEN
-EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj, unsigned int idx)
+EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj ATTRIBUTE_UNUSED, unsigned int idx ATTRIBUTE_UNUSED)
#else
int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx)
#endif
{
+#if 0 /* deprecated */
assert(obj);
if (idx > 3)
return 0;
return obj->dimen.d[idx];
+#else /* deprecated */
+ return -EINVAL;
+#endif /* deprecated */
}
use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_get_dimension, ALSA_0.9.3);
@@ -2565,9 +2577,10 @@ use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_
* \deprecated Since 1.1.5
* #snd_ctl_elem_info_set_dimension is deprecated without any replacement.
*/
-int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
- const int dimension[4])
+int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info ATTRIBUTE_UNUSED,
+ const int dimension[4] ATTRIBUTE_UNUSED)
{
+#if 0 /* deprecated */
unsigned int i;
if (info == NULL)
@@ -2581,6 +2594,9 @@ int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
}
return 0;
+#else /* deprecated */
+ return -EINVAL;
+#endif /* deprecated */
}
/**
--
2.16.4