Messages in this thread | | | Date | Fri, 17 Oct 2003 08:01:26 -0600 (MDT) | From | James Bourne <> | Subject | Re: [PATCH][TRIVIAL] silence warning in reiserfs_ioctl |
| |
On Mon, 13 Oct 2003, Rik van Riel wrote:
> Gcc is afraid we might fall off the end of the function without returning. > > diff -urNp linux-5110/fs/reiserfs/ioctl.c linux-10010/fs/reiserfs/ioctl.c > --- linux-5110/fs/reiserfs/ioctl.c > +++ linux-10010/fs/reiserfs/ioctl.c > @@ -84,6 +84,7 @@ int reiserfs_ioctl (struct inode * inode > default: > return -ENOTTY; > } > + return 0; > }
Since the default (hit in case nothing else fits and where it would return) returns -ENOTTY, shouldn't the return be -ENOTTY?
The function could almost at that point remove the default: case and return -ENOTTY at the end of the function and still be correct...
Of course, it's just wrong to not have the default case, but just as a point..
Regards James
> > /* > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >
-- James Bourne | Email: jbourne@hardrock.org Unix Systems Administrator | WWW: http://www.hardrock.org Custom Unix Programming | Linux: The choice of a GNU generation ---------------------------------------------------------------------- "All you need's an occasional kick in the philosophy." Frank Herbert
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |