lkml.org 
[lkml]   [2003]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.095 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site