lkml.org 
[lkml]   [2015]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRFC arch/sh/kernel/traps_64.c - unclear if/else construct

Hi !

scanning for if STATEMENT else STATEMENT triggered here - and it does look
like it needs a fix-up or at least some comments.

<snip?
int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
{
int fstype;
...
/* String could be altered by userspace after strlen_user() */
fsname[len - 1] = '\0';

printk(KERN_DEBUG "that is '%s' as (char *)\n", fsname);
if ( !strcmp(fsname, "hfs") ) {
fstype = 0;
} else {
fstype = 0;
}

kfree(fsname);

printk(KERN_DEBUG "returning fstype=%d\n", fstype);
return fstype; /* something other than default */
<snip>

The if-else here has no effect and the printk will not convey any information
as its always fstype==0, finally the return statement comment indicates that it
should not be the default...

Can't come up with a reasonable cleanup patch here - but this looks like it
needs a review.

thx!
hofrat


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