linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bogus Warning in ppp_generic.c
@ 2003-05-09  8:24 Norbert Wolff
  2003-05-09  8:32 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Norbert Wolff @ 2003-05-09  8:24 UTC (permalink / raw)
  To: lkml

Hi !

If devfs is not configured, devfs_mk_cdev returns 0.
The ppp_generic-Driver reports a bogus Warning in this case.
Fix below.

Regards,

	Norbert	


--- ppp_generic.c.orig	2003-05-09 09:16:56.%N +0200
+++ ppp_generic.c	2003-05-09 10:09:19.%N +0200
@@ -784,10 +784,13 @@ int __init ppp_init(void)
 
 	printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
 	err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
+
+#ifdef CONFIG_DEVFS_FS
 	if (!err) {
 		err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0),
 				S_IFCHR|S_IRUSR|S_IWUSR, "ppp");
 	}
+#endif
 
 	if (!err)
 		printk(KERN_ERR "failed to register PPP device (%d)\n", err);


--
 Norbert Wolff
 OpenPGP-Key:
   http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF13BD6F6

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

* Re: Bogus Warning in ppp_generic.c
  2003-05-09  8:24 Bogus Warning in ppp_generic.c Norbert Wolff
@ 2003-05-09  8:32 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2003-05-09  8:32 UTC (permalink / raw)
  To: Norbert Wolff; +Cc: lkml

On Fri, May 09, 2003 at 10:24:01AM +0200, Norbert Wolff wrote:
>  	printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
>  	err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
> +
> +#ifdef CONFIG_DEVFS_FS
>  	if (!err) {
>  		err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0),
>  				S_IFCHR|S_IRUSR|S_IWUSR, "ppp");
>  	}
> +#endif
>  
>  	if (!err)
>  		printk(KERN_ERR "failed to register PPP device (%d)\n", err);

Wrong fix :)  the error check is just reveresed, devfs_mk_cdev also returns
0 if CONFIG_DEVFS_FS is set and it succeded.

Btw, almost any occurance of #ifdef CONFIG_DEVFS_FS is a bug.


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

end of thread, other threads:[~2003-05-09  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09  8:24 Bogus Warning in ppp_generic.c Norbert Wolff
2003-05-09  8:32 ` Christoph Hellwig

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).