Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363113

[PATCH 02/29] staging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 02/29] staging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle
Date 2016-03-23 00:20 +0100
Message-ID <rfDKH-34K-25@gated-at.bofh.it> (permalink)
References <rfDAZ-310-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Liang Zhen <liang.zhen@intel.com>

Instead of just returning for each switch condition use a break.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lnet/libcfs/module.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c
index f9f9d59..3fe2810 100644
--- a/drivers/staging/lustre/lnet/libcfs/module.c
+++ b/drivers/staging/lustre/lnet/libcfs/module.c
@@ -116,7 +116,7 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
 			       void __user *arg, struct libcfs_ioctl_hdr *hdr)
 {
 	struct libcfs_ioctl_data *data = NULL;
-	int err = -EINVAL;
+	int err = 0;
 
 	/*
 	 * The libcfs_ioctl_data_adjust() function performs adjustment
@@ -134,7 +134,7 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
 	switch (cmd) {
 	case IOC_LIBCFS_CLEAR_DEBUG:
 		libcfs_debug_clear_buffer();
-		return 0;
+		break;
 	/*
 	 * case IOC_LIBCFS_PANIC:
 	 * Handled in arch/cfs_module.c
@@ -144,7 +144,7 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
 		    data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
 			return -EINVAL;
 		libcfs_debug_mark_buffer(data->ioc_inlbuf1);
-		return 0;
+		break;
 
 	default: {
 		struct libcfs_ioctl_handler *hand;
@@ -161,8 +161,7 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd,
 			}
 		}
 		up_read(&ioctl_list_sem);
-		break;
-	}
+		break; }
 	}
 
 	return err;
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/29] Bring libcfs ioctl handling up to date James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 29/29] staging: lustre: libcfs: return size_t for libcfs_ioctl_packlen James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 28/29] staging: lustre: libcfs: use BIT macro in linux-module.c James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 22/29] staging: lustre: libcfs: removal all userland only macros from libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 18/29] staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 24/29] staging: lustre: libcfs: move function declarations from libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 03/29] staging: lustre: libcfs: merge code from libcfs_ioctl into libcfs_ioctl_getdata James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 23/29] staging: lustre: libcfs: migrate inline functions to source file James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 19/29] staging:lustre: remove libcfs_psdev_[open|release] James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 26/29] staging: lustre: libcfs: add uapi headers to libcfs_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 14/29] staging: lustre: libcfs: remove libcfsutil.h in comment James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 25/29] staging: lustre: libcfs: make libcfs_ioctl.h readable James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 27/29] staging: lustre: libcfs: return proper bool values James Simmons <jsimmons@infradead.org> - 2016-03-23 00:10 +0100
  [PATCH 08/29] staging: lustre: libcfs: invert test condition for libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 13/29] staging: lustre: libcfs: change variable name James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 11/29] staging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 04/29] staging: lustre: libcfs: merge libcfs_ioctl_handle into libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 10/29] staging: lustre: libcfs: test if userland data is to small James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 01/29] staging: lustre: libcfs: replace LNET_MAX_IOCTL_BUF_LEN with something bigger James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 02/29] staging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 15/29] staging: lustre: libcfs: move libcfs_ioctl_handler stuff to libcfs.h James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 12/29] staging: lustre: simple cleanup in obd_ioctl_popdata James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 09/29] staging: lustre: libcfs: update error messages in linux-module.c James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100
  [PATCH 05/29] staging: lustre: libcfs: add debugging info for libcfs_ioctl James Simmons <jsimmons@infradead.org> - 2016-03-23 00:20 +0100

csiph-web