* [PATCH][TRIVIAL] silence warning in reiserfs_ioctl
@ 2003-10-13 16:34 Rik van Riel
2003-10-17 14:01 ` James Bourne
0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2003-10-13 16:34 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Kernel Mailing List
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;
}
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][TRIVIAL] silence warning in reiserfs_ioctl
2003-10-13 16:34 [PATCH][TRIVIAL] silence warning in reiserfs_ioctl Rik van Riel
@ 2003-10-17 14:01 ` James Bourne
0 siblings, 0 replies; 2+ messages in thread
From: James Bourne @ 2003-10-17 14:01 UTC (permalink / raw)
To: Rik van Riel; +Cc: Marcelo Tosatti, Kernel Mailing List
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-10-17 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-13 16:34 [PATCH][TRIVIAL] silence warning in reiserfs_ioctl Rik van Riel
2003-10-17 14:01 ` James Bourne
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.