From: Jessica Yu <jyu@cowsay.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Jessica Yu <jyu@cowsay.org>
Subject: [PATCH] Staging: lustre: linux-module: fix coding style issues
Date: Sun, 27 Jul 2014 21:25:42 -0700 [thread overview]
Message-ID: <1406521542-25363-1-git-send-email-jyu@cowsay.org> (raw)
Fixed some coding style issues:
- Removed spaces after open parenthesis and before close parenthesis
- Removed parentheses in some return statements, since return is not a
function
- Fixed a warning regarding the file_operations struct; it is
normally const
- Fixed pointer style issues (foo * bar -> foo *bar)
Signed-off-by: Jessica Yu <jyu@cowsay.org>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index ccadf65..de3c199 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -99,7 +99,7 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)
extern struct cfs_psdev_ops libcfs_psdev_ops;
static int
-libcfs_psdev_open(struct inode * inode, struct file * file)
+libcfs_psdev_open(struct inode *inode, struct file *file)
{
struct libcfs_device_userstate **pdu = NULL;
int rc = 0;
@@ -116,7 +116,7 @@ libcfs_psdev_open(struct inode * inode, struct file * file)
/* called when closing /dev/device */
static int
-libcfs_psdev_release(struct inode * inode, struct file * file)
+libcfs_psdev_release(struct inode *inode, struct file *file)
{
struct libcfs_device_userstate *pdu;
int rc = 0;
@@ -140,9 +140,9 @@ static long libcfs_ioctl(struct file *file,
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- if ( _IOC_TYPE(cmd) != IOC_LIBCFS_TYPE ||
+ if (_IOC_TYPE(cmd) != IOC_LIBCFS_TYPE ||
_IOC_NR(cmd) < IOC_LIBCFS_MIN_NR ||
- _IOC_NR(cmd) > IOC_LIBCFS_MAX_NR ) {
+ _IOC_NR(cmd) > IOC_LIBCFS_MAX_NR) {
CDEBUG(D_IOCTL, "invalid ioctl ( type %d, nr %d, size %d )\n",
_IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
return (-EINVAL);
@@ -154,7 +154,7 @@ static long libcfs_ioctl(struct file *file,
if (!capable(CFS_CAP_SYS_BOOT))
return (-EPERM);
panic("debugctl-invoked panic");
- return (0);
+ return 0;
case IOC_LIBCFS_MEMHOG:
if (!capable(CFS_CAP_SYS_ADMIN))
return -EPERM;
@@ -167,10 +167,10 @@ static long libcfs_ioctl(struct file *file,
rc = libcfs_psdev_ops.p_ioctl(&pfile, cmd, (void *)arg);
else
rc = -EPERM;
- return (rc);
+ return rc;
}
-static struct file_operations libcfs_fops = {
+static const struct file_operations libcfs_fops = {
.unlocked_ioctl = libcfs_ioctl,
.open = libcfs_psdev_open,
.release = libcfs_psdev_release,
--
2.0.1
next reply other threads:[~2014-07-27 20:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 4:25 Jessica Yu [this message]
2014-07-28 13:33 ` [PATCH v2 0/4] Staging: lustre: linux-module: fix " Jessica Yu
2014-07-28 13:33 ` [PATCH v2 1/4] Staging: lustre: linux-module: fix pointer style issue Jessica Yu
2014-07-28 13:33 ` [PATCH v2 2/4] Staging: lustre: linux-module: remove unnecessary spaces Jessica Yu
2014-07-28 13:33 ` [PATCH v2 3/4] Staging: lustre: linux-module: remove extraneous parens Jessica Yu
2014-07-28 13:33 ` [PATCH v2 4/4] Staging: lustre: linux-module: add const modifier to file_operations Jessica Yu
-- strict thread matches above, loose matches on Subject: below --
2014-07-28 4:23 [PATCH] Staging: lustre: linux-module: fix coding style issues Jessica Yu
2014-07-28 3:53 Jessica Yu
2014-07-27 20:01 ` Greg Kroah-Hartman
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=1406521542-25363-1-git-send-email-jyu@cowsay.org \
--to=jyu@cowsay.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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®