* [PATCH] Staging: lustre: linux-module: fix coding style issues
@ 2014-07-28 4:25 Jessica Yu
2014-07-28 13:33 ` [PATCH v2 0/4] Staging: lustre: linux-module: fix " Jessica Yu
0 siblings, 1 reply; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 4:25 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, Jessica Yu
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 0/4] Staging: lustre: linux-module: fix style issues
2014-07-28 4:25 [PATCH] Staging: lustre: linux-module: fix coding style issues Jessica Yu
@ 2014-07-28 13:33 ` Jessica Yu
2014-07-28 13:33 ` [PATCH v2 1/4] Staging: lustre: linux-module: fix pointer style issue Jessica Yu
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 13:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Jessica Yu
I revisited my original patch and realized that it should be split into
separate parts.
Jessica Yu (4):
Staging: lustre: linux-module: fix pointer style issue
Staging: lustre: linux-module: remove unnecessary spaces
Staging: lustre: linux-module: remove extraneous parens
Staging: lustre: linux-module: add const modifier to file_operations
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--
2.0.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/4] Staging: lustre: linux-module: fix pointer style issue
2014-07-28 13:33 ` [PATCH v2 0/4] Staging: lustre: linux-module: fix " Jessica Yu
@ 2014-07-28 13:33 ` Jessica Yu
2014-07-28 13:33 ` [PATCH v2 2/4] Staging: lustre: linux-module: remove unnecessary spaces Jessica Yu
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 13:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Jessica Yu
Fix pointer code style (foo * bar -> foo *bar)
Signed-off-by: Jessica Yu <jyu@cowsay.org>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 4 ++--
1 file changed, 2 insertions(+), 2 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..b0c00a9 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;
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/4] Staging: lustre: linux-module: remove unnecessary spaces
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 ` 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
3 siblings, 0 replies; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 13:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Jessica Yu
Remove extraneous space after open paren and before close paren.
Signed-off-by: Jessica Yu <jyu@cowsay.org>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index b0c00a9..abd7e6f 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -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);
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/4] Staging: lustre: linux-module: remove extraneous parens
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 ` Jessica Yu
2014-07-28 13:33 ` [PATCH v2 4/4] Staging: lustre: linux-module: add const modifier to file_operations Jessica Yu
3 siblings, 0 replies; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 13:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Jessica Yu
Remove unnecessary parens from return statements, return is not a function
Signed-off-by: Jessica Yu <jyu@cowsay.org>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index abd7e6f..745fe4c 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -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,7 +167,7 @@ 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 = {
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 4/4] Staging: lustre: linux-module: add const modifier to file_operations
2014-07-28 13:33 ` [PATCH v2 0/4] Staging: lustre: linux-module: fix " Jessica Yu
` (2 preceding siblings ...)
2014-07-28 13:33 ` [PATCH v2 3/4] Staging: lustre: linux-module: remove extraneous parens Jessica Yu
@ 2014-07-28 13:33 ` Jessica Yu
3 siblings, 0 replies; 6+ messages in thread
From: Jessica Yu @ 2014-07-28 13:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, devel, Jessica Yu
Add the const modifier to the file_operations struct, since it is
normally const.
Signed-off-by: Jessica Yu <jyu@cowsay.org>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 745fe4c..de3c199 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -170,7 +170,7 @@ static long libcfs_ioctl(struct file *file,
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-28 5:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 4:25 [PATCH] Staging: lustre: linux-module: fix coding style issues Jessica Yu
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
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.