Bug 210026 - sys/soundcard.h: drop obsolete INKERNEL check for hiding SEQ_* macros
Summary: sys/soundcard.h: drop obsolete INKERNEL check for hiding SEQ_* macros
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2016-06-04 16:20 UTC by Jan Beich
Modified: 2016-06-18 12:45 UTC (History)
1 user (show)

See Also:


Attachments
v0 (477 bytes, patch)
2016-06-04 16:20 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2016-06-04 16:20:57 UTC
Created attachment 171014 [details]
v0

After base r301074 the port fails to build as machine/param.h defines INKERNEL() which is used by sys/soundcard.h to hide SEQ_* macros. My guess, the check is an artifact before _KERNEL was consistently defined.

  midi.rawmidi.c:250:15: error: expected parameter declarator
  SEQ_DEFINEBUF(2048);
		^
  midi.rawmidi.c:250:15: error: expected ')'
  midi.rawmidi.c:250:14: note: to match this '('
  SEQ_DEFINEBUF(2048);
	       ^
  midi.rawmidi.c:250:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  SEQ_DEFINEBUF(2048);
  ^
  midi.rawmidi.c:251:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  SEQ_USE_EXTBUF();
  ^
  midi.rawmidi.c:255:6: error: use of undeclared identifier '_seqbufptr'; did you mean 'setbuffer'?
	  if (_seqbufptr) {
	      ^~~~~~~~~~
	      setbuffer
  /usr/include/stdio.h:411:7: note: 'setbuffer' declared here
  void     setbuffer(FILE *, char *, int);
	   ^
  midi.rawmidi.c:255:6: warning: address of function 'setbuffer' will always evaluate to 'true' [-Wpointer-bool-conversion]
	  if (_seqbufptr) {
	  ~~  ^~~~~~~~~~
  midi.rawmidi.c:255:6: note: prefix with the address-of operator to silence this warning
	  if (_seqbufptr) {
	      ^
	      &
  midi.rawmidi.c:256:21: error: use of undeclared identifier '_seqbuf'; did you mean 'setbuf'?
		  if (write(midifd, _seqbuf, _seqbufptr) == -1) {
				    ^~~~~~~
				    setbuf
  /usr/include/stdio.h:273:7: note: 'setbuf' declared here
  void     setbuf(FILE * __restrict, char * __restrict);
	   ^
  midi.rawmidi.c:256:30: error: use of undeclared identifier '_seqbufptr'; did you mean 'setbuffer'?
		  if (write(midifd, _seqbuf, _seqbufptr) == -1) {
					     ^~~~~~~~~~
					     setbuffer
  /usr/include/stdio.h:411:7: note: 'setbuffer' declared here
  void     setbuffer(FILE *, char *, int);
	   ^
  midi.rawmidi.c:261:2: error: use of undeclared identifier '_seqbufptr'
	  _seqbufptr = 0;
	  ^
  midi.rawmidi.c:294:3: warning: implicit declaration of function 'SEQ_MIDIOUT' is invalid in C99 [-Wimplicit-function-declaration]
		  SEQ_MIDIOUT(midi_subdev, *(d++));
		  ^

http://beefy3.nyi.freebsd.org/data/head-i386-default/p416265_s301181/logs/errors/xsystem35-1.7.3.p5_2.log
Comment 1 Jan Beich freebsd_committer freebsd_triage 2016-06-04 16:24:31 UTC
Err, I don't believe the port needs to be fixed.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-06-04 18:57:16 UTC
A commit references this bug:

Author: ed
Date: Sat Jun  4 18:57:01 UTC 2016
New revision: 301406
URL: https://svnweb.freebsd.org/changeset/base/301406

Log:
  Don't test for INKERNEL to check whether we're in kernel space.

  It turns out that <machine/param.h> actually defines a macro under this
  name, even when we're not in kernelspace. This causes us to suppress
  some macro definitions that are used by userspace apps.

  PR:		210026
  Reported by:	jbeich@
  MFC after:	2 weeks

Changes:
  head/sys/sys/soundcard.h
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-06-18 12:44:48 UTC
A commit references this bug:

Author: ed
Date: Sat Jun 18 12:44:14 UTC 2016
New revision: 302006
URL: https://svnweb.freebsd.org/changeset/base/302006

Log:
  MFC r301406:

    Don't test for INKERNEL to check whether we're in kernel space.

    It turns out that <machine/param.h> actually defines a macro under this
    name, even when we're not in kernelspace. This causes us to suppress
    some macro definitions that are used by userspace apps.

  PR:		210026
  Reported by:	jbeich@

Changes:
_U  stable/10/
  stable/10/sys/sys/soundcard.h