lkml.org 
[lkml]   [2015]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1 linux-next] affs: add default case in switch
Am 03.05.2015 um 20:15 schrieb Fabian Frederick:
>> If the code can be reached you need to take a proper action of not the
>> warning is bogus.
>
> As far as I understand, switch in affs_lookup() only updates inode number when
> it's a link so we can simply add default:break to silence gcc warning or replace
> by if().

Does the warning trigger with our default set of compiler warnings?
Not all gcc warnings are useful. :)

> affs_iget() switch on the other hand applies to any type of file.
> Maybe we could add default: BUG() to avoid working on bad inode ?

Or cancel the operation and return -EIO to userspace.

Thanks,
//richard


\
 
 \ /
  Last update: 2015-05-03 21:01    [W:0.056 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site