From: Nicholas Mc Guire <der.herr@hofr.at>
To: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>,
Dan Carpenter <dan.carpenter@oracle.com>,
linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RFC arch/sh/kernel/traps_64.c - unclear if/else construct
Date: Tue, 3 Feb 2015 10:37:58 +0100 [thread overview]
Message-ID: <20150203093758.GA27963@opentech.at> (raw)
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
next reply other threads:[~2015-02-03 9:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 9:37 Nicholas Mc Guire [this message]
2015-02-16 21:24 ` RFC arch/sh/kernel/traps_64.c - unclear if/else construct (hpux compat layer) Helge Deller
2015-02-17 8:49 ` Paul Bolle
2015-02-17 15:15 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150203093758.GA27963@opentech.at \
--to=der.herr@hofr.at \
--cc=dan.carpenter@oracle.com \
--cc=deller@gmx.de \
--cc=jejb@parisc-linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®