linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] devpts_fs.h fails with "error: parameter name omitted"
@ 2004-02-24  2:16 Ian Wienand
  2004-02-24  2:24 ` viro
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Wienand @ 2004-02-24  2:16 UTC (permalink / raw)
  To: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 783 bytes --]

Hi,

The change

http://linux.bkbits.net:8080/linux-2.5/cset@1.1595.1.6

caused my test build [1] to die with 

In file included from drivers/char/tty_io.c:79:
include/linux/devpts_fs.h: In function `devpts_pty_new':
include/linux/devpts_fs.h:27: error: parameter name omitted
include/linux/devpts_fs.h: In function `devpts_get_tty':
include/linux/devpts_fs.h:28: error: parameter name omitted
include/linux/devpts_fs.h: In function `devpts_pty_kill':
include/linux/devpts_fs.h:29: error: parameter name omitted
make[2]: *** [drivers/char/tty_io.o] Error 1

suggested patch attached.

Thanks,

-i
ianw@gelato.unsw.edu.au
http://www.gelato.unsw.edu.au

[1] http://www.gelato.unsw.edu.au/kerncomp/results//2004-02-23-16-00/config-2.6.1-simulator-log.html#build

[-- Attachment #1.2: devpts_fs.h.patch --]
[-- Type: text/plain, Size: 1076 bytes --]

===== include/linux/devpts_fs.h 1.3 vs edited =====
--- 1.3/include/linux/devpts_fs.h	Mon Feb 23 16:24:03 2004
+++ edited/include/linux/devpts_fs.h	Tue Feb 24 13:04:26 2004
@@ -17,16 +17,16 @@
 
 #if CONFIG_UNIX98_PTYS
 
-int devpts_pty_new(struct tty_struct *); /* mknod in devpts */
-struct tty_struct *devpts_get_tty(int);	 /* get tty structure */
-void devpts_pty_kill(int);		 /* unlink */
+int devpts_pty_new(struct tty_struct *tty);      /* mknod in devpts */
+struct tty_struct *devpts_get_tty(int number);	 /* get tty structure */
+void devpts_pty_kill(int number);		 /* unlink */
 
 #else
 
 /* Dummy stubs in the no-pty case */
-static inline int devpts_pty_new(struct tty_struct *) { return -EINVAL; }
-static inline struct tty_struct *devpts_get_tty(int)  { return NULL; }
-static inline void devpts_pty_kill(int) { }
+static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; }
+static inline struct tty_struct *devpts_get_tty(int number) { return NULL; }
+static inline void devpts_pty_kill(int number) { }
 
 #endif
 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devpts_fs.h fails with "error: parameter name omitted"
  2004-02-24  2:16 [PATCH] devpts_fs.h fails with "error: parameter name omitted" Ian Wienand
@ 2004-02-24  2:24 ` viro
  2004-02-24  2:49   ` Ian Wienand
  0 siblings, 1 reply; 5+ messages in thread
From: viro @ 2004-02-24  2:24 UTC (permalink / raw)
  To: Ian Wienand; +Cc: linux-kernel

On Tue, Feb 24, 2004 at 01:16:51PM +1100, Ian Wienand wrote:

> -int devpts_pty_new(struct tty_struct *); /* mknod in devpts */
> -struct tty_struct *devpts_get_tty(int);	 /* get tty structure */
> -void devpts_pty_kill(int);		 /* unlink */
> +int devpts_pty_new(struct tty_struct *tty);      /* mknod in devpts */
> +struct tty_struct *devpts_get_tty(int number);	 /* get tty structure */
> +void devpts_pty_kill(int number);		 /* unlink */

  
>  /* Dummy stubs in the no-pty case */
> -static inline int devpts_pty_new(struct tty_struct *) { return -EINVAL; }
> -static inline struct tty_struct *devpts_get_tty(int)  { return NULL; }
> -static inline void devpts_pty_kill(int) { }
> +static inline int devpts_pty_new(struct tty_struct *tty) { return -EINVAL; }
> +static inline struct tty_struct *devpts_get_tty(int number) { return NULL; }
> +static inline void devpts_pty_kill(int number) { }

That part makes sense.  Previous one doesn't.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devpts_fs.h fails with "error: parameter name omitted"
  2004-02-24  2:24 ` viro
@ 2004-02-24  2:49   ` Ian Wienand
  2004-02-24  3:00     ` viro
  2004-02-24  4:31     ` H. Peter Anvin
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Wienand @ 2004-02-24  2:49 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

On Tue, Feb 24, 2004 at 02:24:24AM +0000, viro@parcelfarce.linux.theplanet.co.uk wrote:
> That part makes sense.  Previous one doesn't.

Is that by convention or is leaving out the parameter name in the
prototype standardised somewhere?  

(just curious because Documentation/CodingStyle doesn't mention it)

-i

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devpts_fs.h fails with "error: parameter name omitted"
  2004-02-24  2:49   ` Ian Wienand
@ 2004-02-24  3:00     ` viro
  2004-02-24  4:31     ` H. Peter Anvin
  1 sibling, 0 replies; 5+ messages in thread
From: viro @ 2004-02-24  3:00 UTC (permalink / raw)
  To: Ian Wienand; +Cc: linux-kernel

On Tue, Feb 24, 2004 at 01:49:42PM +1100, Ian Wienand wrote:
> On Tue, Feb 24, 2004 at 02:24:24AM +0000, viro@parcelfarce.linux.theplanet.co.uk wrote:
> > That part makes sense.  Previous one doesn't.
> 
> Is that by convention or is leaving out the parameter name in the
> prototype standardised somewhere?  

It's valid C and it's pretty common style.  Both that and leaving the
names in prototype can be found in the kernel and CodingStyle is OK
with either variant.  Which makes the change gratitious.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devpts_fs.h fails with "error: parameter name omitted"
  2004-02-24  2:49   ` Ian Wienand
  2004-02-24  3:00     ` viro
@ 2004-02-24  4:31     ` H. Peter Anvin
  1 sibling, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2004-02-24  4:31 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20040224024942.GG1200@cse.unsw.EDU.AU>
By author:    Ian Wienand <ianw@gelato.unsw.edu.au>
In newsgroup: linux.dev.kernel
> 
> On Tue, Feb 24, 2004 at 02:24:24AM +0000, viro@parcelfarce.linux.theplanet.co.uk wrote:
> > That part makes sense.  Previous one doesn't.
> 
> Is that by convention or is leaving out the parameter name in the
> prototype standardised somewhere?  
> 

It's commonly done to make code less macro-sensitive.

Personally I wish that standard C allowed it for definitions as well, rather than
having to type (void)foo; to keep it from complaining about unused parameters.

	-hpa

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-24  4:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-24  2:16 [PATCH] devpts_fs.h fails with "error: parameter name omitted" Ian Wienand
2004-02-24  2:24 ` viro
2004-02-24  2:49   ` Ian Wienand
2004-02-24  3:00     ` viro
2004-02-24  4:31     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).