Commit 43a990765a9e874350bae1009366d00809dbc9d8

Authored by Arnd Bergmann
Committed by Takashi Iwai
1 parent 8e4921515c

sound: Remove OSSlib stuff from linux/soundcard.h

Removed OSSlib stuff from linux/soundcard.h to fix the warnings for
'make headers_check'.

This patch breaks building against OSSlib with the kernel headers
instead of its own headers. It should still work with any
version of the library from the 2003 onwards which provide
their own headers for the latest interface.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jaswinder Singh Rajput <jaswinder@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 23 additions and 51 deletions Side-by-side Diff

include/linux/soundcard.h
... ... @@ -1045,51 +1045,37 @@
1045 1045 */
1046 1046 #define LOCL_STARTAUDIO 1
1047 1047  
1048   -#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
  1048 +#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
1049 1049 /*
1050 1050 * Some convenience macros to simplify programming of the
1051 1051 * /dev/sequencer interface
1052 1052 *
1053   - * These macros define the API which should be used when possible.
  1053 + * This is a legacy interface for applications written against
  1054 + * the OSSlib-3.8 style interface. It is no longer possible
  1055 + * to actually link against OSSlib with this header, but we
  1056 + * still provide these macros for programs using them.
  1057 + *
  1058 + * If you want to use OSSlib, it is recommended that you get
  1059 + * the GPL version of OSS-4.x and build against that version
  1060 + * of the header.
  1061 + *
  1062 + * We redefine the extern keyword so that make headers_check
  1063 + * does not complain about SEQ_USE_EXTBUF.
1054 1064 */
1055 1065 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
1056 1066  
1057 1067 void seqbuf_dump(void); /* This function must be provided by programs */
1058 1068  
1059   -extern int OSS_init(int seqfd, int buflen);
1060   -extern void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen);
1061   -extern void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen);
1062   -extern void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen);
1063   -extern void OSS_patch_caching(int dev, int chn, int patch,
1064   - int fd, unsigned char *buf, int buflen);
1065   -extern void OSS_drum_caching(int dev, int chn, int patch,
1066   - int fd, unsigned char *buf, int buflen);
1067   -extern void OSS_write_patch(int fd, unsigned char *buf, int len);
1068   -extern int OSS_write_patch2(int fd, unsigned char *buf, int len);
1069   -
1070 1069 #define SEQ_PM_DEFINES int __foo_bar___
1071   -#ifdef OSSLIB
1072   -# define SEQ_USE_EXTBUF() \
1073   - extern unsigned char *_seqbuf; \
1074   - extern int _seqbuflen;extern int _seqbufptr
1075   -# define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
1076   -# define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
1077   -# define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
1078   -# define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
1079 1070  
1080   -# define SEQ_LOAD_GMINSTR(dev, instr) \
1081   - OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
1082   -# define SEQ_LOAD_GMDRUM(dev, drum) \
1083   - OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
1084   -#else /* !OSSLIB */
  1071 +#define SEQ_LOAD_GMINSTR(dev, instr)
  1072 +#define SEQ_LOAD_GMDRUM(dev, drum)
1085 1073  
1086   -# define SEQ_LOAD_GMINSTR(dev, instr)
1087   -# define SEQ_LOAD_GMDRUM(dev, drum)
  1074 +#define _SEQ_EXTERN extern
  1075 +#define SEQ_USE_EXTBUF() \
  1076 + _SEQ_EXTERN unsigned char _seqbuf[]; \
  1077 + _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
1088 1078  
1089   -# define SEQ_USE_EXTBUF() \
1090   - extern unsigned char _seqbuf[]; \
1091   - extern int _seqbuflen;extern int _seqbufptr
1092   -
1093 1079 #ifndef USE_SIMPLE_MACROS
1094 1080 /* Sample seqbuf_dump() implementation:
1095 1081 *
... ... @@ -1131,7 +1117,6 @@
1131 1117 */
1132 1118 #define _SEQ_NEEDBUF(len) /* empty */
1133 1119 #endif
1134   -#endif /* !OSSLIB */
1135 1120  
1136 1121 #define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
1137 1122 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1138 1123  
... ... @@ -1215,14 +1200,8 @@
1215 1200 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
1216 1201  
1217 1202 #define SEQ_SET_PATCH SEQ_PGM_CHANGE
1218   -#ifdef OSSLIB
1219   -# define SEQ_PGM_CHANGE(dev, chn, patch) \
1220   - {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
1221   - _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
1222   -#else
1223   -# define SEQ_PGM_CHANGE(dev, chn, patch) \
  1203 +#define SEQ_PGM_CHANGE(dev, chn, patch) \
1224 1204 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
1225   -#endif
1226 1205  
1227 1206 #define SEQ_CONTROL(dev, chn, controller, value) \
1228 1207 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
1229 1208  
1230 1209  
... ... @@ -1300,19 +1279,12 @@
1300 1279 /*
1301 1280 * Patch loading.
1302 1281 */
1303   -#ifdef OSSLIB
1304   -# define SEQ_WRPATCH(patchx, len) \
1305   - OSS_write_patch(seqfd, (char*)(patchx), len)
1306   -# define SEQ_WRPATCH2(patchx, len) \
1307   - OSS_write_patch2(seqfd, (char*)(patchx), len)
1308   -#else
1309   -# define SEQ_WRPATCH(patchx, len) \
  1282 +#define SEQ_WRPATCH(patchx, len) \
1310 1283 {if (_seqbufptr) SEQ_DUMPBUF();\
1311 1284 if (write(seqfd, (char*)(patchx), len)==-1) \
1312 1285 perror("Write patch: /dev/sequencer");}
1313   -# define SEQ_WRPATCH2(patchx, len) \
  1286 +#define SEQ_WRPATCH2(patchx, len) \
1314 1287 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
1315   -#endif
1316 1288  
1317 1289 #endif
1318 1290 #endif