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


Groups > linux.kernel > #1335014 > unrolled thread

[PATCH 00/45] Lustre cleanups

Started bygreen@linuxhacker.ru
First post2016-02-16 06:50 +0100
Last post2016-02-16 07:10 +0100
Articles 20 on this page of 36 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/45] Lustre cleanups green@linuxhacker.ru - 2016-02-16 06:50 +0100
    [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> green@linuxhacker.ru - 2016-02-16 06:50 +0100
      Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with  pr_<level> Joe Perches <joe@perches.com> - 2016-02-16 07:00 +0100
        Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> Oleg Drokin <green@linuxhacker.ru> - 2016-02-16 17:20 +0100
          Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with  pr_<level> Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-20 23:40 +0100
    [PATCH 41/45] staging/lustre/libcfs: Get rid of multiple assignments green@linuxhacker.ru - 2016-02-16 06:50 +0100
    [PATCH 45/45] staging/lustre: Convert cfs_str2num_check to use kstrtoul green@linuxhacker.ru - 2016-02-16 06:50 +0100
    [PATCH 44/45] staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul green@linuxhacker.ru - 2016-02-16 06:50 +0100
    [PATCH 34/45] staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function green@linuxhacker.ru - 2016-02-16 06:50 +0100
    [PATCH 32/45] staging/lustre/libcfs: Remove stray spaces after function name green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 39/45] staging/lustre: Update cfs_cpu_notify switch statement with a comment green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 38/45] staging/lustre/libcfs: Remove empty lines after/before braces green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 40/45] staging/lustre: Get rid of cfs_trace_buf_type_t typedef green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 37/45] staging/lustre/libcfs: Remove useless returns in void functions green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 19/45] staging/lustre/lclient: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 31/45] staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 22/45] staging/lustre/mgc: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 27/45] staging/lustre: Remove the "write to FSF to get a copy of GPL" wording green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 20/45] staging/lustre/include: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 29/45] staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 15/45] staging/lustre/ldlm: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 33/45] staging/lustre/libcfs: Shortened too long lines green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 16/45] staging/lustre/lmv: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 18/45] staging/lustre/fld: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 21/45] staging/lustre/mdc: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 30/45] staging/lustre/libcfs: style change to add missing spaces for operations green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 28/45] staging/lustre/libcfs: Cleanup: parenthesis alignment adjustments green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 42/45] staging/lustre: Remove space after cast in cfs_crypto_hash_final() green@linuxhacker.ru - 2016-02-16 07:00 +0100
    [PATCH 07/45] staging/lustre: Remove unused osc_on_mdt function green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 06/45] staging/lustre: Remove unused function oti_init green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 10/45] staging/lustre: Remove commented out lock_lock_multi_match green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 09/45] staging/lustre: Remove server code from class_get_type() green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 11/45] staging/lustre/osc: Remove commented out osc_page_protected() green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 04/45] staging/lustre/llite: Get rid of /proc references in comments green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 05/45] staging/lustre/lov: Get rid of /proc references in comments green@linuxhacker.ru - 2016-02-16 07:10 +0100
    [PATCH 02/45] staging/lustre/obdclass: Get rid of /proc references in comments. green@linuxhacker.ru - 2016-02-16 07:10 +0100

Page 1 of 2  [1] 2  Next page →


#1335014 — [PATCH 00/45] Lustre cleanups

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 00/45] Lustre cleanups
Message-ID<r2GGm-3pA-3@gated-at.bofh.it>
From: Oleg Drokin <green@linuxhacker.ru>

Majority of this patch is Lustre code style cleanups.
NULL comparison style is adjusted for the whole lustre tree
(but not lnet not to interfere with James patches in flight).

Some server-only code was removed in the process.

lustre/libcfs in addition was processed to remove as many checkpatch
warnings as was possible. Assuming this is the end result we
want I will process the rest of the Lustre tree in the similar way next.

Remaining warnings from checkpatch are either due to bugs/problems
in checkpatch (reported) or otherwise do not make sense.
Amongst these are the long printed strings - I know we could do an
exception for that, but this is pending renaming some of our debug
printing primitives, so I guess they just stay as is.

Please consider.

Here's the full list of remaining warnings in
drivers/staging/lustre/lustre/libcfs for those curious:

WARNING: line over 80 characters
#456: FILE: drivers/staging/lustre/lustre/libcfs/debug.c:427:
+			CWARN("You are trying to use a numerical value for the mask - this will be deprecated in a future release.\n");

ERROR: that open brace { should be on the previous line
#2102: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1362:
+cfs_hash_for_each_enter(struct cfs_hash *hs)
+{

ERROR: that open brace { should be on the previous line
#2129: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1389:
+cfs_hash_for_each_exit(struct cfs_hash *hs)
+{

ERROR: that open brace { should be on the previous line
#2160: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1420:
+cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
+			void *data, int remove_safe)
+{

ERROR: that open brace { should be on the previous line
#2254: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1514:
+cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
+		       void *data)
+{

ERROR: that open brace { should be on the previous line
#2304: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1564:
+cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
+			void *data)
+{

ERROR: that open brace { should be on the previous line
#2370: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1630:
+cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
+			 void *data)
+{

ERROR: that open brace { should be on the previous line
#2402: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1662:
+cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
+			void *data)
+{

ERROR: that open brace { should be on the previous line
#2459: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1719:
+cfs_hash_for_each_key(struct cfs_hash *hs, const void *key,
+		      cfs_hash_for_each_cb_t func, void *data)
+{

CHECK: spinlock_t definition without comment
#3125: FILE: drivers/staging/lustre/lustre/libcfs/libcfs_lock.c:55:
+	spinlock_t		*lock;

WARNING: line over 80 characters
#4342: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:317:
+			CDEBUG(D_INFO, "Try to unset cpu %d which is not in CPT-table %p\n",

WARNING: line over 80 characters
#4392: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:367:
+		CDEBUG(D_INFO, "No online CPU is found in the CPU mask for CPU partition %d\n",

WARNING: line over 80 characters
#4588: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:563:
+		CERROR("No online CPU found in CPU partition %d, did someone do CPU hotplug on system? You might need to reload Lustre modules to keep system working well.\n",

WARNING: line over 80 characters
#4748: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:723:
+		CWARN("CPU partition number %d is larger than suggested value (%d), your system may have performance issue or run out of memory while under pressure\n",

WARNING: line over 80 characters
#4753: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:728:
+		CERROR("CPU number %d is not multiple of cpu_npartition %d, please try different cpu_npartitions value or set pattern string by cpu_pattern=STRING\n",

WARNING: line over 80 characters
#4803: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:778:
+		CERROR("Expect %d(%d) CPU partitions but got %d(%d), CPU hotplug/unplug while setting?\n",

WARNING: line over 80 characters
#4814: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c:789:
+	CERROR("Failed to setup CPU-partition-table with %d CPU-partitions, online HW nodes: %d, HW cpus: %d.\n",

WARNING: char * array declaration might be better as static const
#5734: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:76:
+	char *envp[] = {

WARNING: line over 80 characters
#5748: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:90:
+		CERROR("Error %d invoking LNET debug log upcall %s %s; check /sys/kernel/debug/lnet/debug_log_upcall\n",

WARNING: char * array declaration might be better as static const
#5760: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:102:
+	char *envp[] = {

WARNING: line over 80 characters
#5774: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:116:
+		CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; check /sys/kernel/debug/lnet/upcall\n",

WARNING: memory barrier without comment
#5837: FILE: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:179:
+	mb();

CHECK: Alignment should match open parenthesis
#6672: FILE: drivers/staging/lustre/lustre/libcfs/module.c:148:
+					err = libcfs_ioctl_popdata(arg,
+							data, sizeof(*data));

WARNING: line over 80 characters
#7369: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.c:49:
+union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS] __cacheline_aligned;

WARNING: memory barrier without comment
#7839: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.c:519:
+	mb();

CHECK: extern prototypes should be avoided in .h files
#8710: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.h:187:
+extern union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS];

ERROR: Macros with complex values should be enclosed in parentheses
#8712: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.h:189:
+#define cfs_tcd_for_each(tcd, i, j)				       \
+	for (i = 0; cfs_trace_data[i]; i++)				\
+		for (j = 0, ((tcd) = &(*cfs_trace_data[i])[j].tcd);	\
+		     j < num_possible_cpus();				 \
+		     j++, (tcd) = &(*cfs_trace_data[i])[j].tcd)

CHECK: Concatenated strings should use spaces between elements
#8774: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.h:251:
+		cfs_trace_assertion_failed("ASSERTION("#cond") failed", \

CHECK: Alignment should match open parenthesis
#9075: FILE: drivers/staging/lustre/lustre/libcfs/workitem.c:280:
+		rc = wait_event_interruptible_exclusive(sched->ws_waitq,
+						!cfs_wi_sched_cansleep(sched));


Oleg Drokin (45):
  staging/lustre/ptlrpc: Get rid of /proc references in comments
  staging/lustre/obdclass: Get rid of /proc references in comments.
  staging/lustre/libcfs: Get rid of /proc references in comments
  staging/lustre/llite: Get rid of /proc references in comments
  staging/lustre/lov: Get rid of /proc references in comments
  staging/lustre: Remove unused function oti_init
  staging/lustre: Remove unused osc_on_mdt function
  staging/lustre: Remove server code from client_obd_setup()
  staging/lustre: Remove server code from class_get_type()
  staging/lustre: Remove commented out lock_lock_multi_match
  staging/lustre/osc: Remove commented out osc_page_protected()
  staging/lustre/libcfs: Adjust NULL comparison codestyle
  staging/lustre/lov: Adjust NULL comparison codestyle
  staging/lustre/llite: Adjust NULL comparison codestyle
  staging/lustre/ldlm: Adjust NULL comparison codestyle
  staging/lustre/lmv: Adjust NULL comparison codestyle
  staging/lustre/fid: Adjust NULL comparison codestyle
  staging/lustre/fld: Adjust NULL comparison codestyle
  staging/lustre/lclient: Adjust NULL comparison codestyle
  staging/lustre/include: Adjust NULL comparison codestyle
  staging/lustre/mdc: Adjust NULL comparison codestyle
  staging/lustre/mgc: Adjust NULL comparison codestyle
  staging/lustre/obdclass: Adjust NULL comparison codestyle
  staging/lustre/obdecho: Adjust NULL comparison codestyle
  staging/lustre/osc: Adjust NULL comparison codestyle
  staging/lustre/ptlrpc: Adjust NULL comparison codestyle
  staging/lustre: Remove the "write to FSF to get a copy of GPL" wording
  staging/lustre/libcfs: Cleanup: parenthesis alignment adjustments
  staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable
  staging/lustre/libcfs: style change to add missing spaces for
    operations
  staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define
  staging/lustre/libcfs: Remove stray spaces after function name
  staging/lustre/libcfs: Shortened too long lines
  staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function
  staging/lustre/libcfs: Move private tracefile structs out of header
  staging/lustre/libcfs: Update comments style to match kernel
  staging/lustre/libcfs: Remove useless returns in void functions
  staging/lustre/libcfs: Remove empty lines after/before braces
  staging/lustre: Update cfs_cpu_notify switch statement with a comment
  staging/lustre: Get rid of cfs_trace_buf_type_t typedef
  staging/lustre/libcfs: Get rid of multiple assignments
  staging/lustre: Remove space after cast in cfs_crypto_hash_final()
  staging/lustre/libcfs: Replace use of printk with pr_<level>
  staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul
  staging/lustre: Convert cfs_str2num_check to use kstrtoul

 .../staging/lustre/include/linux/lnet/lnetctl.h    |   4 -
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    |   4 -
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |   3 -
 .../lustre/lnet/klnds/socklnd/socklnd_modparams.c  |   3 -
 .../lustre/lnet/klnds/socklnd/socklnd_proto.c      |   3 -
 drivers/staging/lustre/lnet/lnet/router.c          |   4 -
 drivers/staging/lustre/lnet/lnet/router_proc.c     |   4 -
 drivers/staging/lustre/lustre/fid/fid_request.c    |  14 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c      |  14 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c      |  10 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   |   2 +-
 drivers/staging/lustre/lustre/fld/fld_request.c    |  32 ++-
 drivers/staging/lustre/lustre/fld/lproc_fld.c      |  11 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |   8 +-
 drivers/staging/lustre/lustre/include/lclient.h    |   4 +-
 drivers/staging/lustre/lustre/include/linux/obd.h  |   6 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |   8 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |   6 +-
 drivers/staging/lustre/lustre/include/lu_ref.h     |   4 -
 .../lustre/lustre/include/lustre/lustre_idl.h      |   6 +-
 drivers/staging/lustre/lustre/include/lustre_cfg.h |   5 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  18 +-
 .../staging/lustre/lustre/include/lustre_export.h  |  11 --
 drivers/staging/lustre/lustre/include/lustre_lib.h |   8 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |  12 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |  10 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |  15 +-
 drivers/staging/lustre/lustre/include/obd.h        |  43 +----
 drivers/staging/lustre/lustre/include/obd_class.h  |  49 +++--
 .../staging/lustre/lustre/include/obd_support.h    |   1 -
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c |  32 +--
 drivers/staging/lustre/lustre/ldlm/interval_tree.c |   2 -
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |   9 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |  13 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c      |  60 +-----
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     |  65 +++----
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |  45 +++--
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c     |  17 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  65 +++----
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  25 ++-
 drivers/staging/lustre/lustre/libcfs/debug.c       |  31 ++-
 drivers/staging/lustre/lustre/libcfs/fail.c        |   3 +-
 drivers/staging/lustre/lustre/libcfs/hash.c        | 141 +++++++-------
 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c  |  11 +-
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c |  10 +-
 drivers/staging/lustre/lustre/libcfs/libcfs_mem.c  |  14 +-
 .../staging/lustre/lustre/libcfs/libcfs_string.c   |  54 +++---
 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c |  75 ++++----
 .../lustre/lustre/libcfs/linux/linux-crypto.c      |  27 ++-
 .../lustre/lustre/libcfs/linux/linux-curproc.c     |   7 +-
 .../lustre/lustre/libcfs/linux/linux-debug.c       |  23 +--
 .../staging/lustre/lustre/libcfs/linux/linux-mem.c |   2 +-
 .../lustre/lustre/libcfs/linux/linux-module.c      |  10 +-
 .../lustre/lustre/libcfs/linux/linux-tracefile.c   |  36 ++--
 drivers/staging/lustre/lustre/libcfs/module.c      |  28 ++-
 drivers/staging/lustre/lustre/libcfs/prng.c        |  13 +-
 drivers/staging/lustre/lustre/libcfs/tracefile.c   | 214 ++++++++++++---------
 drivers/staging/lustre/lustre/libcfs/tracefile.h   |  87 ++-------
 drivers/staging/lustre/lustre/libcfs/workitem.c    |  41 ++--
 drivers/staging/lustre/lustre/llite/dcache.c       |  10 +-
 drivers/staging/lustre/lustre/llite/dir.c          |  23 +--
 drivers/staging/lustre/lustre/llite/file.c         | 115 ++++++-----
 drivers/staging/lustre/lustre/llite/llite_close.c  |  14 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  25 ++-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  61 +++---
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  14 +-
 drivers/staging/lustre/lustre/llite/llite_rmtacl.c |  10 +-
 drivers/staging/lustre/lustre/llite/lloop.c        |  17 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  14 +-
 drivers/staging/lustre/lustre/llite/namei.c        |  53 ++---
 drivers/staging/lustre/lustre/llite/rw.c           |  23 ++-
 drivers/staging/lustre/lustre/llite/rw26.c         |  16 +-
 drivers/staging/lustre/lustre/llite/statahead.c    |  40 ++--
 drivers/staging/lustre/lustre/llite/super25.c      |  10 +-
 drivers/staging/lustre/lustre/llite/symlink.c      |   3 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |  16 +-
 drivers/staging/lustre/lustre/llite/vvp_io.c       |  14 +-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |   5 +-
 drivers/staging/lustre/lustre/llite/vvp_page.c     |  22 +--
 drivers/staging/lustre/lustre/llite/xattr.c        |  21 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  16 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c     |  11 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   6 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c        | 115 +++++------
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c      |   4 +-
 .../staging/lustre/lustre/lov/lov_cl_internal.h    |   6 +-
 drivers/staging/lustre/lustre/lov/lov_dev.c        |  40 ++--
 drivers/staging/lustre/lustre/lov/lov_ea.c         |   4 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   1 -
 drivers/staging/lustre/lustre/lov/lov_io.c         |  30 ++-
 drivers/staging/lustre/lustre/lov/lov_lock.c       |  88 +++------
 drivers/staging/lustre/lustre/lov/lov_obd.c        |  44 ++---
 drivers/staging/lustre/lustre/lov/lov_object.c     |  51 +++--
 drivers/staging/lustre/lustre/lov/lov_offset.c     |   5 -
 drivers/staging/lustre/lustre/lov/lov_pack.c       |   8 +-
 drivers/staging/lustre/lustre/lov/lov_page.c       |   6 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c       |  24 +--
 drivers/staging/lustre/lustre/lov/lov_request.c    |  30 ++-
 drivers/staging/lustre/lustre/lov/lovsub_dev.c     |   5 +-
 drivers/staging/lustre/lustre/lov/lovsub_lock.c    |   4 +-
 drivers/staging/lustre/lustre/lov/lovsub_object.c  |   4 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c      |  18 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        |  12 +-
 drivers/staging/lustre/lustre/mdc/mdc_locks.c      |  47 ++---
 drivers/staging/lustre/lustre/mdc/mdc_reint.c      |  24 +--
 drivers/staging/lustre/lustre/mdc/mdc_request.c    | 116 ++++++-----
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |  41 ++--
 drivers/staging/lustre/lustre/obdclass/acl.c       |  10 +-
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |  83 ++++----
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  47 +++--
 drivers/staging/lustre/lustre/obdclass/cl_object.c |  40 ++--
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  97 +++++-----
 drivers/staging/lustre/lustre/obdclass/class_obd.c |   8 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    |  38 ++--
 .../lustre/lustre/obdclass/linux/linux-module.c    |   5 +-
 drivers/staging/lustre/lustre/obdclass/llog.c      |  18 +-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  |   2 +-
 drivers/staging/lustre/lustre/obdclass/llog_obd.c  |   7 +-
 .../lustre/lustre/obdclass/lprocfs_counters.c      |   4 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        |  64 +++---
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  94 +++++----
 .../lustre/lustre/obdclass/lustre_handles.c        |  12 +-
 .../staging/lustre/lustre/obdclass/lustre_peer.c   |   4 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |  12 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  37 ++--
 .../staging/lustre/lustre/obdecho/echo_client.c    |  61 +++---
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |   4 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c      | 120 ++++++------
 .../staging/lustre/lustre/osc/osc_cl_internal.h    |   4 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c        |   6 +-
 drivers/staging/lustre/lustre/osc/osc_io.c         |  19 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c       |  61 +++---
 drivers/staging/lustre/lustre/osc/osc_object.c     |   4 +-
 drivers/staging/lustre/lustre/osc/osc_page.c       | 121 ++----------
 drivers/staging/lustre/lustre/osc/osc_quota.c      |  16 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    | 130 ++++++-------
 drivers/staging/lustre/lustre/ptlrpc/client.c      |  75 +++-----
 drivers/staging/lustre/lustre/ptlrpc/connection.c  |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/events.c      |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c      |   9 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c      |  26 ++-
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |  20 +-
 drivers/staging/lustre/lustre/ptlrpc/llog_net.c    |   2 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |  31 ++-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c      |  30 ++-
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |  88 ++++-----
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |  10 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    |  14 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |   5 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |  16 +-
 drivers/staging/lustre/lustre/ptlrpc/recover.c     |   8 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c         |  54 +++---
 drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c    |  14 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_config.c  |  24 +--
 drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c   |   6 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c    |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec_plain.c   |  16 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     |  76 ++++----
 158 files changed, 1937 insertions(+), 2491 deletions(-)

-- 
2.1.0

[toc] | [next] | [standalone]


#1335015 — [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>
Message-ID<r2GGn-3pA-33@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

This pacifies checkpatch amongst other things, also is shorter to write
and avoiding calls to printk_ratelimit() is also good.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 .../lustre/lustre/libcfs/linux/linux-tracefile.c   | 10 ++--
 drivers/staging/lustre/lustre/libcfs/tracefile.c   | 53 +++++++++-------------
 2 files changed, 27 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index 809ea50..5aba132 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -89,7 +89,7 @@ int cfs_tracefile_init_arch(void)
 
 out:
 	cfs_tracefile_fini_arch();
-	printk(KERN_ERR "lnet: Not enough memory\n");
+	pr_err("lnet: Not enough memory\n");
 	return -ENOMEM;
 }
 
@@ -244,11 +244,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
 	}
 
 	if ((mask & D_CONSOLE) != 0) {
-		printk("%s%s: %.*s", ptype, prefix, len, buf);
+		pr_err("%s%s: %.*s", ptype, prefix, len, buf);
 	} else {
-		printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
-		       hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
-		       fn, len, buf);
+		pr_warn("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
+			hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
+			fn, len, buf);
 	}
 }
 
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index 53c1dd6..7df8f0a 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -194,11 +194,9 @@ cfs_trace_get_tage_try(struct cfs_trace_cpu_data *tcd, unsigned long len)
 		} else {
 			tage = cfs_tage_alloc(GFP_ATOMIC);
 			if (unlikely(!tage)) {
-				if ((!memory_pressure_get() ||
-				     in_interrupt()) && printk_ratelimit())
-					printk(KERN_WARNING
-					       "cannot allocate a tage (%ld)\n",
-					       tcd->tcd_cur_pages);
+				if ((!memory_pressure_get() || in_interrupt()))
+					pr_warn_ratelimited("cannot allocate a tage (%ld)\n",
+							    tcd->tcd_cur_pages);
 				return NULL;
 			}
 		}
@@ -233,9 +231,8 @@ static void cfs_tcd_shrink(struct cfs_trace_cpu_data *tcd)
 	 * from here: this will lead to infinite recursion.
 	 */
 
-	if (printk_ratelimit())
-		printk(KERN_WARNING "debug daemon buffer overflowed; discarding 10%% of pages (%d of %ld)\n",
-		       pgcount + 1, tcd->tcd_cur_pages);
+	pr_warn_ratelimited("debug daemon buffer overflowed; discarding 10%% of pages (%d of %ld)\n",
+			    pgcount + 1, tcd->tcd_cur_pages);
 
 	INIT_LIST_HEAD(&pc.pc_pages);
 
@@ -362,8 +359,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
 
 		max_nob = PAGE_CACHE_SIZE - tage->used - known_size;
 		if (max_nob <= 0) {
-			printk(KERN_EMERG "negative max_nob: %d\n",
-			       max_nob);
+			pr_emerg("negative max_nob: %d\n", max_nob);
 			mask |= D_ERROR;
 			cfs_trace_put_tcd(tcd);
 			tcd = NULL;
@@ -393,8 +389,8 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
 	}
 
 	if (*(string_buf + needed - 1) != '\n')
-		printk(KERN_INFO "format at %s:%d:%s doesn't end in newline\n",
-		       file, msgdata->msg_line, msgdata->msg_fn);
+		pr_info("format at %s:%d:%s doesn't end in newline\n",
+			file, msgdata->msg_line, msgdata->msg_fn);
 
 	header.ph_len = known_size + needed;
 	debug_buf = (char *)page_address(tage->page) + tage->used;
@@ -743,8 +739,8 @@ int cfs_tracefile_dump_all_pages(char *filename)
 		kunmap(tage->page);
 
 		if (rc != (int)tage->used) {
-			printk(KERN_WARNING "wanted to write %u but wrote %d\n",
-			       tage->used, rc);
+			pr_warn("wanted to write %u but wrote %d\n",
+				tage->used, rc);
 			put_pages_back(&pc);
 			__LASSERT(list_empty(&pc.pc_pages));
 			break;
@@ -895,10 +891,8 @@ int cfs_trace_daemon_command(char *str)
 	} else {
 		strcpy(cfs_tracefile, str);
 
-		printk(KERN_INFO
-		       "Lustre: debug daemon will attempt to start writing to %s (%lukB max)\n",
-		       cfs_tracefile,
-		       (long)(cfs_tracefile_size >> 10));
+		pr_info("Lustre: debug daemon will attempt to start writing to %s (%lukB max)\n",
+			cfs_tracefile, (long)(cfs_tracefile_size >> 10));
 
 		cfs_trace_start_thread();
 	}
@@ -934,16 +928,14 @@ int cfs_trace_set_debug_mb(int mb)
 	struct cfs_trace_cpu_data *tcd;
 
 	if (mb < num_possible_cpus()) {
-		printk(KERN_WARNING
-		       "Lustre: %d MB is too small for debug buffer size, setting it to %d MB.\n",
-		       mb, num_possible_cpus());
+		pr_warn("Lustre: %d MB is too small for debug buffer size, setting it to %d MB.\n",
+			mb, num_possible_cpus());
 		mb = num_possible_cpus();
 	}
 
 	if (mb > limit) {
-		printk(KERN_WARNING
-		       "Lustre: %d MB is too large for debug buffer size, setting it to %d MB.\n",
-		       mb, limit);
+		pr_warn("Lustre: %d MB is too large for debug buffer size, setting it to %d MB.\n",
+			mb, limit);
 		mb = limit;
 	}
 
@@ -1012,8 +1004,8 @@ static int tracefiled(void *arg)
 			if (IS_ERR(filp)) {
 				rc = PTR_ERR(filp);
 				filp = NULL;
-				printk(KERN_WARNING "couldn't open %s: %d\n",
-				       cfs_tracefile, rc);
+				pr_warn("couldn't open %s: %d\n",
+					cfs_tracefile, rc);
 			}
 		}
 		cfs_tracefile_read_unlock();
@@ -1041,8 +1033,8 @@ static int tracefiled(void *arg)
 			kunmap(tage->page);
 
 			if (rc != (int)tage->used) {
-				printk(KERN_WARNING "wanted to write %u but wrote %d\n",
-				       tage->used, rc);
+				pr_warn("wanted to write %u but wrote %d\n",
+					tage->used, rc);
 				put_pages_back(&pc);
 				__LASSERT(list_empty(&pc.pc_pages));
 				break;
@@ -1055,7 +1047,7 @@ static int tracefiled(void *arg)
 		if (!list_empty(&pc.pc_pages)) {
 			int i;
 
-			printk(KERN_ALERT "Lustre: trace pages aren't empty\n");
+			pr_alert("Lustre: trace pages aren't empty\n");
 			pr_err("total cpus(%d): ", num_possible_cpus());
 			for (i = 0; i < num_possible_cpus(); i++)
 				if (cpu_online(i))
@@ -1123,8 +1115,7 @@ void cfs_trace_stop_thread(void)
 
 	mutex_lock(&cfs_trace_thread_mutex);
 	if (thread_running) {
-		printk(KERN_INFO
-		       "Lustre: shutting down debug daemon thread...\n");
+		pr_info("Lustre: shutting down debug daemon thread...\n");
 		atomic_set(&tctl->tctl_shutdown, 1);
 		wait_for_completion(&tctl->tctl_stop);
 		thread_running = 0;
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335024 — Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>

FromJoe Perches <joe@perches.com>
Date2016-02-16 07:00 +0100
SubjectRe: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>
Message-ID<r2GQ3-3tt-17@gated-at.bofh.it>
In reply to#1335015
On Tue, 2016-02-16 at 00:47 -0500, green@linuxhacker.ru wrote:
> From: Oleg Drokin <green@linuxhacker.ru>
> 
> This pacifies checkpatch amongst other things, also is shorter to write
> and avoiding calls to printk_ratelimit() is also good.
[]
> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
[]
> @@ -244,11 +244,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
>  	}
>  
>  	if ((mask & D_CONSOLE) != 0) {
> -		printk("%s%s: %.*s", ptype, prefix, len, buf);
> +		pr_err("%s%s: %.*s", ptype, prefix, len, buf);
>  	} else {
> -		printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
> -		       hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
> -		       fn, len, buf);
> +		pr_warn("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
> +			hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
> +			fn, len, buf);
>  	}
>  }

This breaks the currently correct output.

ptype is already a KERN_<LEVEL>

	char *prefix = "Lustre", *ptype = NULL;

	if ((mask & D_EMERG) != 0) {
		prefix = dbghdr_to_err_string(hdr);
		ptype = KERN_EMERG;
	} else if ((mask & D_ERROR) != 0) {
		prefix = dbghdr_to_err_string(hdr);
		ptype = KERN_ERR;
	} else if ((mask & D_WARNING) != 0) {
		prefix = dbghdr_to_info_string(hdr);
		ptype = KERN_WARNING;
	} else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) {
		prefix = dbghdr_to_info_string(hdr);
		ptype = KERN_INFO;
	}

[toc] | [prev] | [next] | [standalone]


#1335606 — Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>

FromOleg Drokin <green@linuxhacker.ru>
Date2016-02-16 17:20 +0100
SubjectRe: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>
Message-ID<r2Qw3-1LV-33@gated-at.bofh.it>
In reply to#1335024
On Feb 16, 2016, at 12:55 AM, Joe Perches wrote:

> On Tue, 2016-02-16 at 00:47 -0500, green@linuxhacker.ru wrote:
>> From: Oleg Drokin <green@linuxhacker.ru>
>> 
>> This pacifies checkpatch amongst other things, also is shorter to write
>> and avoiding calls to printk_ratelimit() is also good.
> []
>> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> []
>> @@ -244,11 +244,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
>>  	}
>>  
>>  	if ((mask & D_CONSOLE) != 0) {
>> -		printk("%s%s: %.*s", ptype, prefix, len, buf);
>> +		pr_err("%s%s: %.*s", ptype, prefix, len, buf);
>>  	} else {
>> -		printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
>> -		       hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
>> -		       fn, len, buf);
>> +		pr_warn("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
>> +			hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
>> +			fn, len, buf);
>>  	}
>>  }
> 
> This breaks the currently correct output.

Hm, you are right. Thanks!
I guess this patch just needs some redoing.

Greg, if you can skip this patch but still apply the rest of the series, that would be great.
I just tested that the whole thing builds and runs fine with this patch omitted.

Bye,
    Oleg

[toc] | [prev] | [next] | [standalone]


#1338810 — Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-20 23:40 +0100
SubjectRe: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level>
Message-ID<r4olY-4qz-13@gated-at.bofh.it>
In reply to#1335606
On Tue, Feb 16, 2016 at 11:12:14AM -0500, Oleg Drokin wrote:
> 
> On Feb 16, 2016, at 12:55 AM, Joe Perches wrote:
> 
> > On Tue, 2016-02-16 at 00:47 -0500, green@linuxhacker.ru wrote:
> >> From: Oleg Drokin <green@linuxhacker.ru>
> >> 
> >> This pacifies checkpatch amongst other things, also is shorter to write
> >> and avoiding calls to printk_ratelimit() is also good.
> > []
> >> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> > []
> >> @@ -244,11 +244,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
> >>  	}
> >>  
> >>  	if ((mask & D_CONSOLE) != 0) {
> >> -		printk("%s%s: %.*s", ptype, prefix, len, buf);
> >> +		pr_err("%s%s: %.*s", ptype, prefix, len, buf);
> >>  	} else {
> >> -		printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
> >> -		       hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
> >> -		       fn, len, buf);
> >> +		pr_warn("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
> >> +			hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
> >> +			fn, len, buf);
> >>  	}
> >>  }
> > 
> > This breaks the currently correct output.
> 
> Hm, you are right. Thanks!
> I guess this patch just needs some redoing.
> 
> Greg, if you can skip this patch but still apply the rest of the series, that would be great.
> I just tested that the whole thing builds and runs fine with this patch omitted.

Ok, now skipped, thanks.

greg k-h

[toc] | [prev] | [next] | [standalone]


#1335016 — [PATCH 41/45] staging/lustre/libcfs: Get rid of multiple assignments

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 41/45] staging/lustre/libcfs: Get rid of multiple assignments
Message-ID<r2GGn-3pA-37@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

They make checkpatch unhappy, and I guess overall might confuse
people too.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/libcfs_mem.c    | 7 ++++---
 drivers/staging/lustre/lustre/libcfs/libcfs_string.c | 6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
index 7396d66..c5a6951 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
@@ -82,9 +82,10 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size)
 	if (!arr)
 		return NULL;
 
-	arr->va_size	= size = L1_CACHE_ALIGN(size);
-	arr->va_count	= count;
-	arr->va_cptab	= cptab;
+	size = L1_CACHE_ALIGN(size);
+	arr->va_size = size;
+	arr->va_count = count;
+	arr->va_cptab = cptab;
 
 	for (i = 0; i < count; i++) {
 		LIBCFS_CPT_ALLOC(arr->va_ptrs[i], cptab, i, size);
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 4a2c83b..09ab0e4 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -337,8 +337,10 @@ cfs_range_expr_print(char *buffer, int count, struct cfs_range_expr *expr,
 	char s[] = "[";
 	char e[] = "]";
 
-	if (bracketed)
-		s[0] = e[0] = '\0';
+	if (bracketed) {
+		s[0] = '\0';
+		e[0] = '\0';
+	}
 
 	if (expr->re_lo == expr->re_hi)
 		i = scnprintf(buffer, count, "%u", expr->re_lo);
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335017 — [PATCH 45/45] staging/lustre: Convert cfs_str2num_check to use kstrtoul

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 45/45] staging/lustre: Convert cfs_str2num_check to use kstrtoul
Message-ID<r2GGn-3pA-43@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

simple_strtoul is obsolete

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/libcfs_string.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 09ab0e4..9dca666 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -229,18 +229,13 @@ int
 cfs_str2num_check(char *str, int nob, unsigned *num,
 		  unsigned min, unsigned max)
 {
-	char	*endp;
+	int rc;
 
 	str = cfs_trimwhite(str);
-	*num = simple_strtoul(str, &endp, 0);
-	if (endp == str)
+	rc = kstrtouint(str, 10, num);
+	if (rc)
 		return 0;
 
-	for (; endp < str + nob; endp++) {
-		if (!isspace(*endp))
-			return 0;
-	}
-
 	return (*num >= min && *num <= max);
 }
 EXPORT_SYMBOL(cfs_str2num_check);
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335018 — [PATCH 44/45] staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 44/45] staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul
Message-ID<r2GGn-3pA-35@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

simple_strtoul is obsolete

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/tracefile.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index 7df8f0a..510673d 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -878,12 +878,15 @@ int cfs_trace_daemon_command(char *str)
 		memset(cfs_tracefile, 0, sizeof(cfs_tracefile));
 
 	} else if (strncmp(str, "size=", 5) == 0) {
-		cfs_tracefile_size = simple_strtoul(str + 5, NULL, 0);
-		if (cfs_tracefile_size < 10 || cfs_tracefile_size > 20480)
-			cfs_tracefile_size = CFS_TRACEFILE_SIZE;
-		else
-			cfs_tracefile_size <<= 20;
-
+		unsigned long tmp;
+
+		rc = kstrtoul(str + 5, 10, &tmp);
+		if (!rc) {
+			if (tmp < 10 || tmp > 20480)
+				cfs_tracefile_size = CFS_TRACEFILE_SIZE;
+			else
+				cfs_tracefile_size = tmp << 20;
+		}
 	} else if (strlen(str) >= sizeof(cfs_tracefile)) {
 		rc = -ENAMETOOLONG;
 	} else if (str[0] != '/') {
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335019 — [PATCH 34/45] staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function

Fromgreen@linuxhacker.ru
Date2016-02-16 06:50 +0100
Subject[PATCH 34/45] staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function
Message-ID<r2GGn-3pA-39@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Does not appear to be used anywhere.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 10 ----------
 drivers/staging/lustre/lustre/libcfs/tracefile.h             |  3 ---
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index 5e3c400..6cff79d 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -176,16 +176,6 @@ void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
 		spin_unlock(&tcd->tcd_lock);
 }
 
-int cfs_tcd_owns_tage(struct cfs_trace_cpu_data *tcd,
-		      struct cfs_trace_page *tage)
-{
-	/*
-	 * XXX nikita: do NOT call portals_debug_msg() (CDEBUG/ENTRY/EXIT)
-	 * from here: this will lead to infinite recursion.
-	 */
-	return tcd->tcd_cpu == tage->cpu;
-}
-
 void
 cfs_set_ptldebug_header(struct ptldebug_header *header,
 			struct libcfs_debug_msg_data *msgdata,
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 2285744..0995da1 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -289,9 +289,6 @@ static inline void cfs_trace_put_tcd(struct cfs_trace_cpu_data *tcd)
 int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, gfp_t gfp,
 			   struct list_head *stock);
 
-int cfs_tcd_owns_tage(struct cfs_trace_cpu_data *tcd,
-		      struct cfs_trace_page *tage);
-
 void cfs_trace_assertion_failed(const char *str,
 				struct libcfs_debug_msg_data *m);
 
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335021 — [PATCH 32/45] staging/lustre/libcfs: Remove stray spaces after function name

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 32/45] staging/lustre/libcfs: Remove stray spaces after function name
Message-ID<r2GQ2-3tt-1@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Problem highlighted by checkpatch.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c | 2 +-
 drivers/staging/lustre/lustre/libcfs/tracefile.c         | 2 +-
 drivers/staging/lustre/lustre/libcfs/tracefile.h         | 3 +--
 drivers/staging/lustre/lustre/libcfs/workitem.c          | 9 ++++-----
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
index 04203b3..3f3c2d9 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
@@ -142,7 +142,7 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata)
 	argv[4] = buf;
 	argv[5] = NULL;
 
-	libcfs_run_upcall (argv);
+	libcfs_run_upcall(argv);
 }
 EXPORT_SYMBOL(libcfs_run_lbug_upcall);
 
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index 967f8d7..d9bb2b5 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -378,7 +378,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
 	__LASSERT(debug_buf == string_buf);
 
 	tage->used += needed;
-	__LASSERT (tage->used <= PAGE_CACHE_SIZE);
+	__LASSERT(tage->used <= PAGE_CACHE_SIZE);
 
 console:
 	if ((mask & libcfs_printk) == 0) {
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 92a00ed..2285744 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -279,8 +279,7 @@ cfs_trace_get_tcd(void)
 	return tcd;
 }
 
-static inline void
-cfs_trace_put_tcd (struct cfs_trace_cpu_data *tcd)
+static inline void cfs_trace_put_tcd(struct cfs_trace_cpu_data *tcd)
 {
 	cfs_trace_unlock_tcd(tcd, 0);
 
diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c
index 24400df..9d80cfb 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -163,7 +163,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 		wi->wi_scheduled = 0;
 	}
 
-	LASSERT (list_empty(&wi->wi_list));
+	LASSERT(list_empty(&wi->wi_list));
 
 	spin_unlock(&sched->ws_lock);
 	return rc;
@@ -186,7 +186,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 	spin_lock(&sched->ws_lock);
 
 	if (!wi->wi_scheduled) {
-		LASSERT (list_empty(&wi->wi_list));
+		LASSERT(list_empty(&wi->wi_list));
 
 		wi->wi_scheduled = 1;
 		sched->ws_nscheduled++;
@@ -198,14 +198,13 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 		}
 	}
 
-	LASSERT (!list_empty(&wi->wi_list));
+	LASSERT(!list_empty(&wi->wi_list));
 	spin_unlock(&sched->ws_lock);
 	return;
 }
 EXPORT_SYMBOL(cfs_wi_schedule);
 
-static int
-cfs_wi_scheduler (void *arg)
+static int cfs_wi_scheduler(void *arg)
 {
 	struct cfs_wi_sched	*sched = (struct cfs_wi_sched *)arg;
 
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335022 — [PATCH 39/45] staging/lustre: Update cfs_cpu_notify switch statement with a comment

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 39/45] staging/lustre: Update cfs_cpu_notify switch statement with a comment
Message-ID<r2GQ2-3tt-7@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

We do really mean to fall through to that default case statement from
all previous ones, so add a comment to unconfuse verious tools

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index 6c3e448..7318b77 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -939,6 +939,7 @@ cfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 		spin_lock(&cpt_data.cpt_lock);
 		cpt_data.cpt_version++;
 		spin_unlock(&cpt_data.cpt_lock);
+		/* Fall through */
 	default:
 		if (action != CPU_DEAD && action != CPU_DEAD_FROZEN) {
 			CDEBUG(D_INFO, "CPU changed [cpu %u action %lx]\n",
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335023 — [PATCH 38/45] staging/lustre/libcfs: Remove empty lines after/before braces

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 38/45] staging/lustre/libcfs: Remove empty lines after/before braces
Message-ID<r2GQ3-3tt-9@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

No need for an empty line after opening curvy brace and no need
for an empty line before the closing one too.
Remove them.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c    | 2 --
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 1 -
 drivers/staging/lustre/lustre/libcfs/module.c                | 1 -
 drivers/staging/lustre/lustre/libcfs/tracefile.c             | 4 ----
 4 files changed, 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
index 140134d..b0b1244 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
@@ -125,7 +125,6 @@ struct cfs_crypto_hash_desc *
 	cfs_crypto_hash_init(unsigned char alg_id,
 			     unsigned char *key, unsigned int key_len)
 {
-
 	struct  hash_desc       *hdesc;
 	int		     err;
 	const struct cfs_crypto_hash_type       *type;
@@ -212,7 +211,6 @@ static void cfs_crypto_performance_test(unsigned char alg_id,
 					     hash, &hash_len);
 		if (err)
 			break;
-
 	}
 	end = jiffies;
 
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index f0880a0..eccf048 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -65,7 +65,6 @@ int cfs_tracefile_init_arch(void)
 				num_possible_cpus(), GFP_KERNEL);
 		if (!cfs_trace_data[i])
 			goto out;
-
 	}
 
 	/* arch related info initialized */
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index b8b69bb..ea3dc9b 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -549,7 +549,6 @@ void lustre_insert_debugfs(struct ctl_table *table,
 	for (; symlinks && symlinks->name; symlinks++)
 		debugfs_create_symlink(symlinks->name, lnet_debugfs_root,
 				       symlinks->target);
-
 }
 EXPORT_SYMBOL_GPL(lustre_insert_debugfs);
 
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index b3abec6..53c1dd6 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -598,7 +598,6 @@ static void put_pages_back_on_all_cpus(struct page_collection *pc)
 
 			list_for_each_entry_safe(tage, tmp, &pc->pc_pages,
 						 linkage) {
-
 				__LASSERT_TAGE_INVARIANT(tage);
 
 				if (tage->cpu != cpu || tage->type != i)
@@ -629,7 +628,6 @@ static void put_pages_on_tcd_daemon_list(struct page_collection *pc,
 	struct cfs_trace_page *tmp;
 
 	list_for_each_entry_safe(tage, tmp, &pc->pc_pages, linkage) {
-
 		__LASSERT_TAGE_INVARIANT(tage);
 
 		if (tage->cpu != tcd->tcd_cpu || tage->type != tcd->tcd_type)
@@ -737,7 +735,6 @@ int cfs_tracefile_dump_all_pages(char *filename)
 	 */
 	MMSPACE_OPEN;
 	list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) {
-
 		__LASSERT_TAGE_INVARIANT(tage);
 
 		buf = kmap(tage->page);
@@ -775,7 +772,6 @@ void cfs_trace_flush_pages(void)
 	pc.pc_want_daemon_pages = 1;
 	collect_pages(&pc);
 	list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) {
-
 		__LASSERT_TAGE_INVARIANT(tage);
 
 		list_del(&tage->linkage);
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335028 — [PATCH 40/45] staging/lustre: Get rid of cfs_trace_buf_type_t typedef

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 40/45] staging/lustre: Get rid of cfs_trace_buf_type_t typedef
Message-ID<r2GQ3-3tt-19@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Replace it with enum cfs_trace_buf_type

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 2 +-
 drivers/staging/lustre/lustre/libcfs/tracefile.h             | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index eccf048..809ea50 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -130,7 +130,7 @@ void cfs_tracefile_write_unlock(void)
 	up_write(&cfs_tracefile_sem);
 }
 
-cfs_trace_buf_type_t cfs_trace_buf_idx_get(void)
+enum cfs_trace_buf_type cfs_trace_buf_idx_get(void)
 {
 	if (in_irq())
 		return CFS_TCD_TYPE_IRQ;
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index dffe07f..4c77f90 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -39,12 +39,12 @@
 
 #include "../../include/linux/libcfs/libcfs.h"
 
-typedef enum {
+enum cfs_trace_buf_type {
 	CFS_TCD_TYPE_PROC = 0,
 	CFS_TCD_TYPE_SOFTIRQ,
 	CFS_TCD_TYPE_IRQ,
 	CFS_TCD_TYPE_MAX
-} cfs_trace_buf_type_t;
+};
 
 /* trace file lock routines */
 
@@ -208,7 +208,7 @@ int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 
 extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
-cfs_trace_buf_type_t cfs_trace_buf_idx_get(void);
+enum cfs_trace_buf_type cfs_trace_buf_idx_get(void);
 
 static inline char *
 cfs_trace_get_console_buffer(void)
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335029 — [PATCH 37/45] staging/lustre/libcfs: Remove useless returns in void functions

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 37/45] staging/lustre/libcfs: Remove useless returns in void functions
Message-ID<r2GQ3-3tt-23@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Return at the end of a void function does not serve any particular
purpose and makes checkpatch unhappy, so eliminate them.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c       | 2 --
 drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c    | 2 --
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 2 --
 drivers/staging/lustre/lustre/libcfs/workitem.c              | 3 ---
 4 files changed, 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index 8d6a4ee..6c3e448 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -354,8 +354,6 @@ cfs_cpt_unset_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 
 	if (i >= nr_cpu_ids)
 		node_clear(node, *cptab->ctb_nodemask);
-
-	return;
 }
 EXPORT_SYMBOL(cfs_cpt_unset_cpu);
 
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
index 44d1ad6..140134d 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto.c
@@ -286,6 +286,4 @@ void cfs_crypto_unregister(void)
 {
 	if (adler32 == 0)
 		cfs_crypto_adler32_unregister();
-
-	return;
 }
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index c50e24f..f0880a0 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -198,7 +198,6 @@ cfs_set_ptldebug_header(struct ptldebug_header *header,
 	header->ph_pid = current->pid;
 	header->ph_line_num = msgdata->msg_line;
 	header->ph_extern_pid = 0;
-	return;
 }
 
 static char *
@@ -252,7 +251,6 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
 		       hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num,
 		       fn, len, buf);
 	}
-	return;
 }
 
 int cfs_trace_max_debug_mb(void)
diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c
index 08c5b19..136bc13 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -131,8 +131,6 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 
 	wi->wi_scheduled = 1; /* LBUG future schedule attempts */
 	spin_unlock(&sched->ws_lock);
-
-	return;
 }
 EXPORT_SYMBOL(cfs_wi_exit);
 
@@ -203,7 +201,6 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
 
 	LASSERT(!list_empty(&wi->wi_list));
 	spin_unlock(&sched->ws_lock);
-	return;
 }
 EXPORT_SYMBOL(cfs_wi_schedule);
 
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335030 — [PATCH 19/45] staging/lustre/lclient: Adjust NULL comparison codestyle

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 19/45] staging/lustre/lclient: Adjust NULL comparison codestyle
Message-ID<r2GQ3-3tt-25@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index 4dfeb4e..efa6e2e 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -117,7 +117,7 @@ void *ccc_key_init(const struct lu_context *ctx, struct lu_context_key *key)
 	struct ccc_thread_info *info;
 
 	info = kmem_cache_alloc(ccc_thread_kmem, GFP_NOFS | __GFP_ZERO);
-	if (info == NULL)
+	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
 }
@@ -136,7 +136,7 @@ void *ccc_session_key_init(const struct lu_context *ctx,
 	struct ccc_session *session;
 
 	session = kmem_cache_alloc(ccc_session_kmem, GFP_NOFS | __GFP_ZERO);
-	if (session == NULL)
+	if (!session)
 		session = ERR_PTR(-ENOMEM);
 	return session;
 }
@@ -173,7 +173,7 @@ int ccc_device_init(const struct lu_env *env, struct lu_device *d,
 	vdv = lu2ccc_dev(d);
 	vdv->cdv_next = lu2cl_dev(next);
 
-	LASSERT(d->ld_site != NULL && next->ld_type != NULL);
+	LASSERT(d->ld_site && next->ld_type);
 	next->ld_site = d->ld_site;
 	rc = next->ld_type->ldt_ops->ldto_device_init(
 			env, next, next->ld_type->ldt_name, NULL);
@@ -211,12 +211,12 @@ struct lu_device *ccc_device_alloc(const struct lu_env *env,
 	vdv->cdv_cl.cd_ops = clops;
 
 	site = kzalloc(sizeof(*site), GFP_NOFS);
-	if (site != NULL) {
+	if (site) {
 		rc = cl_site_init(site, &vdv->cdv_cl);
 		if (rc == 0)
 			rc = lu_site_init_finish(&site->cs_lu);
 		else {
-			LASSERT(lud->ld_site == NULL);
+			LASSERT(!lud->ld_site);
 			CERROR("Cannot init lu_site, rc %d.\n", rc);
 			kfree(site);
 		}
@@ -236,7 +236,7 @@ struct lu_device *ccc_device_free(const struct lu_env *env,
 	struct cl_site    *site = lu2cl_site(d->ld_site);
 	struct lu_device  *next = cl2lu_dev(vdv->cdv_next);
 
-	if (d->ld_site != NULL) {
+	if (d->ld_site) {
 		cl_site_fini(site);
 		kfree(site);
 	}
@@ -252,7 +252,7 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
 	int result;
 
 	vrq = kmem_cache_alloc(ccc_req_kmem, GFP_NOFS | __GFP_ZERO);
-	if (vrq != NULL) {
+	if (vrq) {
 		cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops);
 		result = 0;
 	} else
@@ -304,7 +304,7 @@ out_kmem:
 
 void ccc_global_fini(struct lu_device_type *device_type)
 {
-	if (ccc_inode_fini_env != NULL) {
+	if (ccc_inode_fini_env) {
 		cl_env_put(ccc_inode_fini_env, &dummy_refcheck);
 		ccc_inode_fini_env = NULL;
 	}
@@ -328,7 +328,7 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env,
 	struct lu_object  *obj;
 
 	vob = kmem_cache_alloc(ccc_object_kmem, GFP_NOFS | __GFP_ZERO);
-	if (vob != NULL) {
+	if (vob) {
 		struct cl_object_header *hdr;
 
 		obj = ccc2lu(vob);
@@ -365,7 +365,7 @@ int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
 
 	under = &dev->cdv_next->cd_lu_dev;
 	below = under->ld_ops->ldo_object_alloc(env, obj->lo_header, under);
-	if (below != NULL) {
+	if (below) {
 		const struct cl_object_conf *cconf;
 
 		cconf = lu2cl_conf(conf);
@@ -397,7 +397,7 @@ int ccc_lock_init(const struct lu_env *env,
 	CLOBINVRNT(env, obj, ccc_object_invariant(obj));
 
 	clk = kmem_cache_alloc(ccc_lock_kmem, GFP_NOFS | __GFP_ZERO);
-	if (clk != NULL) {
+	if (clk) {
 		cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops);
 		result = 0;
 	} else
@@ -660,7 +660,7 @@ void ccc_io_update_iov(const struct lu_env *env,
 {
 	size_t size = io->u.ci_rw.crw_count;
 
-	if (!cl_is_normalio(env, io) || cio->cui_iter == NULL)
+	if (!cl_is_normalio(env, io) || !cio->cui_iter)
 		return;
 
 	iov_iter_truncate(cio->cui_iter, size);
@@ -749,7 +749,7 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
 			 */
 			ccc_object_size_unlock(obj);
 			result = cl_glimpse_lock(env, io, inode, obj, 0);
-			if (result == 0 && exceed != NULL) {
+			if (result == 0 && exceed) {
 				/* If objective page index exceed end-of-file
 				 * page index, return directly. Do not expect
 				 * kernel will check such case correctly.
@@ -1022,7 +1022,7 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
 	fid  = &lli->lli_fid;
 	LASSERT(fid_is_sane(fid));
 
-	if (lli->lli_clob == NULL) {
+	if (!lli->lli_clob) {
 		/* clob is slave of inode, empty lli_clob means for new inode,
 		 * there is no clob in cache with the given fid, so it is
 		 * unnecessary to perform lookup-alloc-lookup-insert, just
@@ -1098,7 +1098,7 @@ void cl_inode_fini(struct inode *inode)
 	int refcheck;
 	int emergency;
 
-	if (clob != NULL) {
+	if (clob) {
 		void		    *cookie;
 
 		cookie = cl_env_reenter();
@@ -1106,7 +1106,7 @@ void cl_inode_fini(struct inode *inode)
 		emergency = IS_ERR(env);
 		if (emergency) {
 			mutex_lock(&ccc_inode_fini_guard);
-			LASSERT(ccc_inode_fini_env != NULL);
+			LASSERT(ccc_inode_fini_env);
 			cl_env_implant(ccc_inode_fini_env, &refcheck);
 			env = ccc_inode_fini_env;
 		}
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335031 — [PATCH 31/45] staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 31/45] staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define
Message-ID<r2GQ3-3tt-27@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Avoid using leading spaces that make checkpatch unhappy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/tracefile.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 67a701f..92a00ed 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -191,9 +191,9 @@ extern union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS];
 		     j++, (tcd) = &(*cfs_trace_data[i])[j].tcd)
 
 #define cfs_tcd_for_each_type_lock(tcd, i, cpu)			   \
-    for (i = 0; cfs_trace_data[i] &&				      \
-	 (tcd = &(*cfs_trace_data[i])[cpu].tcd) &&			\
-	 cfs_trace_lock_tcd(tcd, 1); cfs_trace_unlock_tcd(tcd, 1), i++)
+	for (i = 0; cfs_trace_data[i] &&				\
+	     (tcd = &(*cfs_trace_data[i])[cpu].tcd) &&			\
+	     cfs_trace_lock_tcd(tcd, 1); cfs_trace_unlock_tcd(tcd, 1), i++)
 
 /* XXX nikita: this declaration is internal to tracefile.c and should probably
  * be moved there */
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335032 — [PATCH 22/45] staging/lustre/mgc: Adjust NULL comparison codestyle

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 22/45] staging/lustre/mgc: Adjust NULL comparison codestyle
Message-ID<r2GQ3-3tt-29@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 41 ++++++++++++-------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index ab4800c..bd34ab3 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -162,7 +162,7 @@ struct config_llog_data *config_log_find(char *logname,
 	struct config_llog_data *found = NULL;
 	void *instance;
 
-	LASSERT(logname != NULL);
+	LASSERT(logname);
 
 	instance = cfg ? cfg->cfg_instance : NULL;
 	spin_lock(&config_list_lock);
@@ -300,7 +300,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
 	 * <fsname>-sptlrpc. multiple regular logs may share one sptlrpc log.
 	 */
 	ptr = strrchr(logname, '-');
-	if (ptr == NULL || ptr - logname > 8) {
+	if (!ptr || ptr - logname > 8) {
 		CERROR("logname %s is too long\n", logname);
 		return -EINVAL;
 	}
@@ -309,7 +309,7 @@ static int config_log_add(struct obd_device *obd, char *logname,
 	strcpy(seclogname + (ptr - logname), "-sptlrpc");
 
 	sptlrpc_cld = config_log_find(seclogname, NULL);
-	if (sptlrpc_cld == NULL) {
+	if (!sptlrpc_cld) {
 		sptlrpc_cld = do_config_log_add(obd, seclogname,
 						CONFIG_T_SPTLRPC, NULL, NULL);
 		if (IS_ERR(sptlrpc_cld)) {
@@ -376,7 +376,7 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
 	int rc = 0;
 
 	cld = config_log_find(logname, cfg);
-	if (cld == NULL)
+	if (!cld)
 		return -ENOENT;
 
 	mutex_lock(&cld->cld_lock);
@@ -455,7 +455,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 
 	spin_lock(&config_list_lock);
 	list_for_each_entry(cld, &config_llog_list, cld_list_chain) {
-		if (cld->cld_recover == NULL)
+		if (!cld->cld_recover)
 			continue;
 		seq_printf(m,  "    - { client: %s, nidtbl_version: %u }\n",
 			       cld->cld_logname,
@@ -883,7 +883,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
 	req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
 					&RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION,
 					LDLM_ENQUEUE);
-	if (req == NULL)
+	if (!req)
 		return -ENOMEM;
 
 	req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0);
@@ -921,7 +921,7 @@ static int mgc_target_register(struct obd_export *exp,
 	req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
 					&RQF_MGS_TARGET_REG, LUSTRE_MGS_VERSION,
 					MGS_TARGET_REG);
-	if (req == NULL)
+	if (!req)
 		return -ENOMEM;
 
 	req_mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
@@ -1109,7 +1109,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 	int   rc  = 0;
 	int   off = 0;
 
-	LASSERT(cfg->cfg_instance != NULL);
+	LASSERT(cfg->cfg_instance);
 	LASSERT(cfg->cfg_sb == cfg->cfg_instance);
 
 	inst = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
@@ -1195,7 +1195,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 		/* lustre-OST0001-osc-<instance #> */
 		strcpy(obdname, cld->cld_logname);
 		cname = strrchr(obdname, '-');
-		if (cname == NULL) {
+		if (!cname) {
 			CERROR("mgc %s: invalid logname %s\n",
 			       mgc->obd_name, obdname);
 			break;
@@ -1212,7 +1212,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 
 		/* find the obd by obdname */
 		obd = class_name2obd(obdname);
-		if (obd == NULL) {
+		if (!obd) {
 			CDEBUG(D_INFO, "mgc %s: cannot find obdname %s\n",
 			       mgc->obd_name, obdname);
 			rc = 0;
@@ -1227,7 +1227,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 		uuid = buf + pos;
 
 		down_read(&obd->u.cli.cl_sem);
-		if (obd->u.cli.cl_import == NULL) {
+		if (!obd->u.cli.cl_import) {
 			/* client does not connect to the OST yet */
 			up_read(&obd->u.cli.cl_sem);
 			rc = 0;
@@ -1257,7 +1257,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 
 		rc = -ENOMEM;
 		lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
-		if (lcfg == NULL) {
+		if (!lcfg) {
 			CERROR("mgc: cannot allocate memory\n");
 			break;
 		}
@@ -1309,14 +1309,14 @@ static int mgc_process_recover_log(struct obd_device *obd,
 		nrpages = CONFIG_READ_NRPAGES_INIT;
 
 	pages = kcalloc(nrpages, sizeof(*pages), GFP_KERNEL);
-	if (pages == NULL) {
+	if (!pages) {
 		rc = -ENOMEM;
 		goto out;
 	}
 
 	for (i = 0; i < nrpages; i++) {
 		pages[i] = alloc_page(GFP_KERNEL);
-		if (pages[i] == NULL) {
+		if (!pages[i]) {
 			rc = -ENOMEM;
 			goto out;
 		}
@@ -1327,7 +1327,7 @@ again:
 	LASSERT(mutex_is_locked(&cld->cld_lock));
 	req = ptlrpc_request_alloc(class_exp2cliimp(cld->cld_mgcexp),
 				   &RQF_MGS_CONFIG_READ);
-	if (req == NULL) {
+	if (!req) {
 		rc = -ENOMEM;
 		goto out;
 	}
@@ -1338,7 +1338,6 @@ again:
 
 	/* pack request */
 	body = req_capsule_client_get(&req->rq_pill, &RMF_MGS_CONFIG_BODY);
-	LASSERT(body != NULL);
 	LASSERT(sizeof(body->mcb_name) > strlen(cld->cld_logname));
 	if (strlcpy(body->mcb_name, cld->cld_logname, sizeof(body->mcb_name))
 	    >= sizeof(body->mcb_name)) {
@@ -1353,7 +1352,7 @@ again:
 	/* allocate bulk transfer descriptor */
 	desc = ptlrpc_prep_bulk_imp(req, nrpages, 1, BULK_PUT_SINK,
 				    MGS_BULK_PORTAL);
-	if (desc == NULL) {
+	if (!desc) {
 		rc = -ENOMEM;
 		goto out;
 	}
@@ -1434,7 +1433,7 @@ out:
 
 	if (pages) {
 		for (i = 0; i < nrpages; i++) {
-			if (pages[i] == NULL)
+			if (!pages[i])
 				break;
 			__free_page(pages[i]);
 		}
@@ -1635,7 +1634,7 @@ static int mgc_process_config(struct obd_device *obd, u32 len, void *buf)
 		if (rc)
 			break;
 		cld = config_log_find(logname, cfg);
-		if (cld == NULL) {
+		if (!cld) {
 			rc = -ENOENT;
 			break;
 		}
@@ -1646,7 +1645,7 @@ static int mgc_process_config(struct obd_device *obd, u32 len, void *buf)
 		cld->cld_cfg.cfg_flags |= CFG_F_COMPAT146;
 
 		rc = mgc_process_log(obd, cld);
-		if (rc == 0 && cld->cld_recover != NULL) {
+		if (rc == 0 && cld->cld_recover) {
 			if (OCD_HAS_FLAG(&obd->u.cli.cl_import->
 					 imp_connect_data, IMP_RECOV)) {
 				rc = mgc_process_log(obd, cld->cld_recover);
@@ -1660,7 +1659,7 @@ static int mgc_process_config(struct obd_device *obd, u32 len, void *buf)
 				CERROR("Cannot process recover llog %d\n", rc);
 		}
 
-		if (rc == 0 && cld->cld_params != NULL) {
+		if (rc == 0 && cld->cld_params) {
 			rc = mgc_process_log(obd, cld->cld_params);
 			if (rc == -ENOENT) {
 				CDEBUG(D_MGC,
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335033 — [PATCH 27/45] staging/lustre: Remove the "write to FSF to get a copy of GPL" wording

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 27/45] staging/lustre: Remove the "write to FSF to get a copy of GPL" wording
Message-ID<r2GQ3-3tt-31@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Checkpatch highlighted that some of our Lustre files carry this
extra paragraph and indeed it does seem somewhat redundant, so remove it.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/include/linux/lnet/lnetctl.h           | 4 ----
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h           | 4 ----
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c        | 3 ---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c | 3 ---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c     | 3 ---
 drivers/staging/lustre/lnet/lnet/router.c                     | 4 ----
 drivers/staging/lustre/lnet/lnet/router_proc.c                | 4 ----
 drivers/staging/lustre/lustre/include/lu_ref.h                | 4 ----
 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c             | 5 -----
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c            | 5 -----
 drivers/staging/lustre/lustre/libcfs/libcfs_mem.c             | 5 -----
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c        | 5 -----
 drivers/staging/lustre/lustre/ptlrpc/nrs.c                    | 4 ----
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c               | 4 ----
 14 files changed, 57 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
index bdd69b2..4b64f62 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
@@ -10,10 +10,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
  * header for lnet ioctl
  */
 #ifndef _LNETCTL_H_
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index a4117ad..a176544 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -19,10 +19,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #ifndef _SOCKLND_SOCKLND_H_
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 02da02d..efb7169 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -19,9 +19,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include "socklnd.h"
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c
index 77ce597..6329cbe 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c
@@ -14,9 +14,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include "socklnd.h"
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
index 70910ed..976a072 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
@@ -19,9 +19,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include "socklnd.h"
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c
index 735a8f2..83ed123 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -15,10 +15,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index a7aaf0c..01dd900 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -15,10 +15,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Portals; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/drivers/staging/lustre/lustre/include/lu_ref.h b/drivers/staging/lustre/lustre/include/lu_ref.h
index 97cd157..f7dfd83 100644
--- a/drivers/staging/lustre/lustre/include/lu_ref.h
+++ b/drivers/staging/lustre/lustre/include/lu_ref.h
@@ -17,10 +17,6 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with Lustre; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
  */
 
 #ifndef __LUSTRE_LU_REF_H
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
index 9137df9..33352af 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
index 2d08ba6..9c64bfd 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
index e0a8783..7396d66 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index 41b9512..7fb277a 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -13,11 +13,6 @@
  * General Public License version 2 for more details (a copy is included
  * in the LICENSE file that accompanied this code).
  *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
index ed40be6..d603a57 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
@@ -13,10 +13,6 @@
  * GNU General Public License version 2 for more details.  A copy is
  * included in the COPYING file that accompanied this code.
 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
  * GPL HEADER END
  */
 /*
diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
index 77894f8..0d8da35 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
@@ -13,10 +13,6 @@
  * GNU General Public License version 2 for more details.  A copy is
  * included in the COPYING file that accompanied this code.
 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
  * GPL HEADER END
  */
 /*
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335034 — [PATCH 20/45] staging/lustre/include: Adjust NULL comparison codestyle

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 20/45] staging/lustre/include: Adjust NULL comparison codestyle
Message-ID<r2GQ3-3tt-33@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/include/cl_object.h  |  6 +--
 drivers/staging/lustre/lustre/include/lclient.h    |  4 +-
 drivers/staging/lustre/lustre/include/linux/obd.h  |  6 +--
 .../staging/lustre/lustre/include/lprocfs_status.h |  6 +--
 drivers/staging/lustre/lustre/include/lu_object.h  |  6 +--
 .../lustre/lustre/include/lustre/lustre_idl.h      |  6 +--
 drivers/staging/lustre/lustre/include/lustre_cfg.h |  5 +--
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 16 +++----
 .../staging/lustre/lustre/include/lustre_export.h  | 11 -----
 drivers/staging/lustre/lustre/include/lustre_lib.h |  8 ++--
 drivers/staging/lustre/lustre/include/lustre_log.h | 12 +++---
 drivers/staging/lustre/lustre/include/lustre_mdc.h | 10 ++---
 drivers/staging/lustre/lustre/include/lustre_net.h | 13 +++---
 drivers/staging/lustre/lustre/include/obd.h        |  7 ++--
 drivers/staging/lustre/lustre/include/obd_class.h  | 49 +++++++++++-----------
 .../staging/lustre/lustre/include/obd_support.h    |  1 -
 16 files changed, 72 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h
index c8f4569..373e772 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -2653,7 +2653,7 @@ static inline int lu_device_is_cl(const struct lu_device *d)
 
 static inline struct cl_device *lu2cl_dev(const struct lu_device *d)
 {
-	LASSERT(d == NULL || IS_ERR(d) || lu_device_is_cl(d));
+	LASSERT(!d || IS_ERR(d) || lu_device_is_cl(d));
 	return container_of0(d, struct cl_device, cd_lu_dev);
 }
 
@@ -2664,7 +2664,7 @@ static inline struct lu_device *cl2lu_dev(struct cl_device *d)
 
 static inline struct cl_object *lu2cl(const struct lu_object *o)
 {
-	LASSERT(o == NULL || IS_ERR(o) || lu_device_is_cl(o->lo_dev));
+	LASSERT(!o || IS_ERR(o) || lu_device_is_cl(o->lo_dev));
 	return container_of0(o, struct cl_object, co_lu);
 }
 
@@ -2681,7 +2681,7 @@ static inline struct cl_object *cl_object_next(const struct cl_object *obj)
 
 static inline struct cl_device *cl_object_device(const struct cl_object *o)
 {
-	LASSERT(o == NULL || IS_ERR(o) || lu_device_is_cl(o->co_lu.lo_dev));
+	LASSERT(!o || IS_ERR(o) || lu_device_is_cl(o->co_lu.lo_dev));
 	return container_of0(o->co_lu.lo_dev, struct cl_device, cd_lu_dev);
 }
 
diff --git a/drivers/staging/lustre/lustre/include/lclient.h b/drivers/staging/lustre/lustre/include/lclient.h
index 36e7a67..7f0a045 100644
--- a/drivers/staging/lustre/lustre/include/lclient.h
+++ b/drivers/staging/lustre/lustre/include/lclient.h
@@ -127,7 +127,7 @@ static inline struct ccc_thread_info *ccc_env_info(const struct lu_env *env)
 	struct ccc_thread_info      *info;
 
 	info = lu_context_key_get(&env->le_ctx, &ccc_key);
-	LASSERT(info != NULL);
+	LASSERT(info);
 	return info;
 }
 
@@ -156,7 +156,7 @@ static inline struct ccc_session *ccc_env_session(const struct lu_env *env)
 	struct ccc_session *ses;
 
 	ses = lu_context_key_get(env->le_ses, &ccc_session_key);
-	LASSERT(ses != NULL);
+	LASSERT(ses);
 	return ses;
 }
 
diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h b/drivers/staging/lustre/lustre/include/linux/obd.h
index 468bc28..240947b 100644
--- a/drivers/staging/lustre/lustre/include/linux/obd.h
+++ b/drivers/staging/lustre/lustre/include/linux/obd.h
@@ -73,7 +73,7 @@ static inline void __client_obd_list_lock(client_obd_lock_t *lock,
 
 	while (1) {
 		if (spin_trylock(&lock->lock)) {
-			LASSERT(lock->task == NULL);
+			LASSERT(!lock->task);
 			lock->task = current;
 			lock->func = func;
 			lock->line = line;
@@ -85,7 +85,7 @@ static inline void __client_obd_list_lock(client_obd_lock_t *lock,
 		    time_before(lock->time + 5 * HZ, jiffies)) {
 			struct task_struct *task = lock->task;
 
-			if (task == NULL)
+			if (!task)
 				continue;
 
 			LCONSOLE_WARN("%s:%d: lock %p was acquired by <%s:%d:%s:%d> for %lu seconds.\n",
@@ -108,7 +108,7 @@ static inline void __client_obd_list_lock(client_obd_lock_t *lock,
 
 static inline void client_obd_list_unlock(client_obd_lock_t *lock)
 {
-	LASSERT(lock->task != NULL);
+	LASSERT(lock->task);
 	lock->task = NULL;
 	lock->time = jiffies;
 	spin_unlock(&lock->lock);
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 97c2d7e..88f754e 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -407,7 +407,7 @@ static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc,
 		} else {
 			unsigned int cpuid = get_cpu();
 
-			if (unlikely(stats->ls_percpu[cpuid] == NULL)) {
+			if (unlikely(!stats->ls_percpu[cpuid])) {
 				rc = lprocfs_stats_alloc_one(stats, cpuid);
 				if (rc < 0) {
 					put_cpu();
@@ -521,11 +521,11 @@ static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
 	unsigned long flags	= 0;
 	__u64	      ret	= 0;
 
-	LASSERT(stats != NULL);
+	LASSERT(stats);
 
 	num_cpu = lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
 	for (i = 0; i < num_cpu; i++) {
-		if (stats->ls_percpu[i] == NULL)
+		if (!stats->ls_percpu[i])
 			continue;
 		ret += lprocfs_read_helper(
 				lprocfs_stats_counter_get(stats, i, idx),
diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h
index 0b22e5e..c1c7aa1 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -392,7 +392,7 @@ struct lu_device_type_operations {
 
 static inline int lu_device_is_md(const struct lu_device *d)
 {
-	return ergo(d != NULL, d->ld_type->ldt_tags & LU_DEVICE_MD);
+	return ergo(d, d->ld_type->ldt_tags & LU_DEVICE_MD);
 }
 
 /**
@@ -1119,7 +1119,7 @@ struct lu_context_key {
 		CLASSERT(PAGE_CACHE_SIZE >= sizeof (*value));       \
 								  \
 		value = kzalloc(sizeof(*value), GFP_NOFS);	\
-		if (value == NULL)				\
+		if (!value)				\
 			value = ERR_PTR(-ENOMEM);		 \
 								  \
 		return value;				     \
@@ -1174,7 +1174,7 @@ void  lu_context_key_revive  (struct lu_context_key *key);
 		do {						    \
 			LU_CONTEXT_KEY_INIT(key);		       \
 			key = va_arg(args, struct lu_context_key *);    \
-		} while (key != NULL);				  \
+		} while (key);				  \
 		va_end(args);					   \
 	}
 
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index b064b58..c646426 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -807,7 +807,7 @@ static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
 
 static inline int fid_is_sane(const struct lu_fid *fid)
 {
-	return fid != NULL &&
+	return fid &&
 	       ((fid_seq(fid) >= FID_SEQ_START && fid_ver(fid) == 0) ||
 		fid_is_igif(fid) || fid_is_idif(fid) ||
 		fid_seq_is_rsvd(fid_seq(fid)));
@@ -3273,7 +3273,7 @@ static inline void lustre_set_wire_obdo(struct obd_connect_data *ocd,
 {
 	*wobdo = *lobdo;
 	wobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
-	if (ocd == NULL)
+	if (!ocd)
 		return;
 
 	if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
@@ -3300,7 +3300,7 @@ static inline void lustre_get_wire_obdo(struct obd_connect_data *ocd,
 		lobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
 		lobdo->o_flags |= local_flags;
 	}
-	if (ocd == NULL)
+	if (!ocd)
 		return;
 
 	if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h
index d30d8b0..1bc35c4 100644
--- a/drivers/staging/lustre/lustre/include/lustre_cfg.h
+++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h
@@ -128,7 +128,7 @@ static inline void lustre_cfg_bufs_set(struct lustre_cfg_bufs *bufs,
 {
 	if (index >= LUSTRE_CFG_MAX_BUFCOUNT)
 		return;
-	if (bufs == NULL)
+	if (!bufs)
 		return;
 
 	if (bufs->lcfg_bufcount <= index)
@@ -158,7 +158,6 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, int index)
 	int offset;
 	int bufcount;
 
-	LASSERT (lcfg != NULL);
 	LASSERT (index >= 0);
 
 	bufcount = lcfg->lcfg_bufcount;
@@ -191,7 +190,7 @@ static inline char *lustre_cfg_string(struct lustre_cfg *lcfg, int index)
 		return NULL;
 
 	s = lustre_cfg_buf(lcfg, index);
-	if (s == NULL)
+	if (!s)
 		return NULL;
 
 	/*
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 11a841a..51f416d 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -465,7 +465,6 @@ struct ldlm_namespace {
  */
 static inline int ns_connect_cancelset(struct ldlm_namespace *ns)
 {
-	LASSERT(ns != NULL);
 	return !!(ns->ns_connect_flags & OBD_CONNECT_CANCELSET);
 }
 
@@ -474,14 +473,12 @@ static inline int ns_connect_cancelset(struct ldlm_namespace *ns)
  */
 static inline int ns_connect_lru_resize(struct ldlm_namespace *ns)
 {
-	LASSERT(ns != NULL);
 	return !!(ns->ns_connect_flags & OBD_CONNECT_LRU_RESIZE);
 }
 
 static inline void ns_register_cancel(struct ldlm_namespace *ns,
 				      ldlm_cancel_for_recovery arg)
 {
-	LASSERT(ns != NULL);
 	ns->ns_cancel_for_recovery = arg;
 }
 
@@ -921,7 +918,7 @@ static inline int ldlm_lvbo_init(struct ldlm_resource *res)
 {
 	struct ldlm_namespace *ns = ldlm_res_to_ns(res);
 
-	if (ns->ns_lvbo != NULL && ns->ns_lvbo->lvbo_init != NULL)
+	if (ns->ns_lvbo && ns->ns_lvbo->lvbo_init)
 		return ns->ns_lvbo->lvbo_init(res);
 
 	return 0;
@@ -931,7 +928,7 @@ static inline int ldlm_lvbo_size(struct ldlm_lock *lock)
 {
 	struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
 
-	if (ns->ns_lvbo != NULL && ns->ns_lvbo->lvbo_size != NULL)
+	if (ns->ns_lvbo && ns->ns_lvbo->lvbo_size)
 		return ns->ns_lvbo->lvbo_size(lock);
 
 	return 0;
@@ -941,10 +938,9 @@ static inline int ldlm_lvbo_fill(struct ldlm_lock *lock, void *buf, int len)
 {
 	struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
 
-	if (ns->ns_lvbo != NULL) {
-		LASSERT(ns->ns_lvbo->lvbo_fill != NULL);
+	if (ns->ns_lvbo)
 		return ns->ns_lvbo->lvbo_fill(lock, buf, len);
-	}
+
 	return 0;
 }
 
@@ -1015,7 +1011,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 
 /** Non-rate-limited lock printing function for debugging purposes. */
 #define LDLM_DEBUG(lock, fmt, a...)   do {				  \
-	if (likely(lock != NULL)) {					    \
+	if (likely(lock)) {						    \
 		LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_DLMTRACE, NULL);      \
 		ldlm_lock_debug(&msgdata, D_DLMTRACE, NULL, lock,	    \
 				"### " fmt, ##a);			    \
@@ -1091,7 +1087,7 @@ ldlm_handle2lock_long(const struct lustre_handle *h, __u64 flags)
 	struct ldlm_lock *lock;
 
 	lock = __ldlm_handle2lock(h, flags);
-	if (lock != NULL)
+	if (lock)
 		LDLM_LOCK_REF_DEL(lock);
 	return lock;
 }
diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h
index a030a98f..86f91ce 100644
--- a/drivers/staging/lustre/lustre/include/lustre_export.h
+++ b/drivers/staging/lustre/lustre/include/lustre_export.h
@@ -228,7 +228,6 @@ static inline __u64 exp_connect_flags(struct obd_export *exp)
 
 static inline int exp_max_brw_size(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	if (exp_connect_flags(exp) & OBD_CONNECT_BRW_SIZE)
 		return exp->exp_connect_data.ocd_brw_size;
 
@@ -242,19 +241,16 @@ static inline int exp_connect_multibulk(struct obd_export *exp)
 
 static inline int exp_connect_cancelset(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	return !!(exp_connect_flags(exp) & OBD_CONNECT_CANCELSET);
 }
 
 static inline int exp_connect_lru_resize(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	return !!(exp_connect_flags(exp) & OBD_CONNECT_LRU_RESIZE);
 }
 
 static inline int exp_connect_rmtclient(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	return !!(exp_connect_flags(exp) & OBD_CONNECT_RMT_CLIENT);
 }
 
@@ -268,14 +264,11 @@ static inline int client_is_remote(struct obd_export *exp)
 
 static inline int exp_connect_vbr(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
-	LASSERT(exp->exp_connection);
 	return !!(exp_connect_flags(exp) & OBD_CONNECT_VBR);
 }
 
 static inline int exp_connect_som(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	return !!(exp_connect_flags(exp) & OBD_CONNECT_SOM);
 }
 
@@ -288,7 +281,6 @@ static inline int imp_connect_lru_resize(struct obd_import *imp)
 {
 	struct obd_connect_data *ocd;
 
-	LASSERT(imp != NULL);
 	ocd = &imp->imp_connect_data;
 	return !!(ocd->ocd_connect_flags & OBD_CONNECT_LRU_RESIZE);
 }
@@ -300,7 +292,6 @@ static inline int exp_connect_layout(struct obd_export *exp)
 
 static inline bool exp_connect_lvb_type(struct obd_export *exp)
 {
-	LASSERT(exp != NULL);
 	if (exp_connect_flags(exp) & OBD_CONNECT_LVB_TYPE)
 		return true;
 	else
@@ -311,7 +302,6 @@ static inline bool imp_connect_lvb_type(struct obd_import *imp)
 {
 	struct obd_connect_data *ocd;
 
-	LASSERT(imp != NULL);
 	ocd = &imp->imp_connect_data;
 	if (ocd->ocd_connect_flags & OBD_CONNECT_LVB_TYPE)
 		return true;
@@ -331,7 +321,6 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp)
 {
 	struct obd_connect_data *ocd;
 
-	LASSERT(imp != NULL);
 	ocd = &imp->imp_connect_data;
 	return ocd->ocd_connect_flags & OBD_CONNECT_DISP_STRIPE;
 }
diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h
index cfccf7c..8f821df 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -540,7 +540,7 @@ do {									   \
 	l_add_wait(&wq, &__wait);					      \
 									       \
 	/* Block all signals (just the non-fatal ones if no timeout). */       \
-	if (info->lwi_on_signal != NULL && (__timeout == 0 || __allow_intr))   \
+	if (info->lwi_on_signal && (__timeout == 0 || __allow_intr))   \
 		__blocked = cfs_block_sigsinv(LUSTRE_FATAL_SIGS);	      \
 	else								   \
 		__blocked = cfs_block_sigsinv(0);			      \
@@ -562,13 +562,13 @@ do {									   \
 			__timeout = cfs_time_sub(__timeout,		    \
 					    cfs_time_sub(interval, remaining));\
 			if (__timeout == 0) {				  \
-				if (info->lwi_on_timeout == NULL ||	    \
+				if (!info->lwi_on_timeout ||		      \
 				    info->lwi_on_timeout(info->lwi_cb_data)) { \
 					ret = -ETIMEDOUT;		      \
 					break;				 \
 				}					      \
 				/* Take signals after the timeout expires. */  \
-				if (info->lwi_on_signal != NULL)	       \
+				if (info->lwi_on_signal)		       \
 				    (void)cfs_block_sigsinv(LUSTRE_FATAL_SIGS);\
 			}						      \
 		}							      \
@@ -578,7 +578,7 @@ do {									   \
 		if (condition)						 \
 			break;						 \
 		if (cfs_signal_pending()) {				    \
-			if (info->lwi_on_signal != NULL &&		     \
+			if (info->lwi_on_signal &&		     \
 			    (__timeout == 0 || __allow_intr)) {		\
 				if (info->lwi_on_signal != LWI_ON_SIGNAL_NOOP) \
 					info->lwi_on_signal(info->lwi_cb_data);\
diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h
index e4fc8b5..155a0e6 100644
--- a/drivers/staging/lustre/lustre/include/lustre_log.h
+++ b/drivers/staging/lustre/lustre/include/lustre_log.h
@@ -255,7 +255,7 @@ struct llog_ctxt {
 static inline int llog_handle2ops(struct llog_handle *loghandle,
 				  struct llog_operations **lop)
 {
-	if (loghandle == NULL || loghandle->lgh_logops == NULL)
+	if (!loghandle || !loghandle->lgh_logops)
 		return -EINVAL;
 
 	*lop = loghandle->lgh_logops;
@@ -272,7 +272,7 @@ static inline struct llog_ctxt *llog_ctxt_get(struct llog_ctxt *ctxt)
 
 static inline void llog_ctxt_put(struct llog_ctxt *ctxt)
 {
-	if (ctxt == NULL)
+	if (!ctxt)
 		return;
 	LASSERT_ATOMIC_GT_LT(&ctxt->loc_refcount, 0, LI_POISON);
 	CDEBUG(D_INFO, "PUTting ctxt %p : new refcount %d\n", ctxt,
@@ -294,7 +294,7 @@ static inline int llog_group_set_ctxt(struct obd_llog_group *olg,
 	LASSERT(index >= 0 && index < LLOG_MAX_CTXTS);
 
 	spin_lock(&olg->olg_lock);
-	if (olg->olg_ctxts[index] != NULL) {
+	if (olg->olg_ctxts[index]) {
 		spin_unlock(&olg->olg_lock);
 		return -EEXIST;
 	}
@@ -311,7 +311,7 @@ static inline struct llog_ctxt *llog_group_get_ctxt(struct obd_llog_group *olg,
 	LASSERT(index >= 0 && index < LLOG_MAX_CTXTS);
 
 	spin_lock(&olg->olg_lock);
-	if (olg->olg_ctxts[index] == NULL)
+	if (!olg->olg_ctxts[index])
 		ctxt = NULL;
 	else
 		ctxt = llog_ctxt_get(olg->olg_ctxts[index]);
@@ -335,7 +335,7 @@ static inline struct llog_ctxt *llog_get_context(struct obd_device *obd,
 
 static inline int llog_group_ctxt_null(struct obd_llog_group *olg, int index)
 {
-	return (olg->olg_ctxts[index] == NULL);
+	return (!olg->olg_ctxts[index]);
 }
 
 static inline int llog_ctxt_null(struct obd_device *obd, int index)
@@ -354,7 +354,7 @@ static inline int llog_next_block(const struct lu_env *env,
 	rc = llog_handle2ops(loghandle, &lop);
 	if (rc)
 		return rc;
-	if (lop->lop_next_block == NULL)
+	if (!lop->lop_next_block)
 		return -EOPNOTSUPP;
 
 	rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx,
diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h
index 3da3733..db46004 100644
--- a/drivers/staging/lustre/lustre/include/lustre_mdc.h
+++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h
@@ -81,8 +81,8 @@ static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
 static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
 				    struct lookup_intent *it)
 {
-	if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
-			   it->it_op == IT_LAYOUT))
+	if (it && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
+		   it->it_op == IT_LAYOUT))
 		return;
 
 	/* This would normally block until the existing request finishes.
@@ -112,15 +112,15 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
 		goto again;
 	}
 
-	LASSERT(lck->rpcl_it == NULL);
+	LASSERT(!lck->rpcl_it);
 	lck->rpcl_it = it;
 }
 
 static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
 				    struct lookup_intent *it)
 {
-	if (it != NULL && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
-			   it->it_op == IT_LAYOUT))
+	if (it && (it->it_op == IT_GETATTR || it->it_op == IT_LOOKUP ||
+		   it->it_op == IT_LAYOUT))
 		return;
 
 	if (lck->rpcl_it == MDC_FAKE_RPCL_IT) { /* OBD_FAIL_MDC_RPCS_SEM */
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h
index d9c7267..c4a0b00 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -1518,7 +1518,7 @@ struct ptlrpc_request {
 static inline int ptlrpc_req_interpret(const struct lu_env *env,
 				       struct ptlrpc_request *req, int rc)
 {
-	if (req->rq_interpret_reply != NULL) {
+	if (req->rq_interpret_reply) {
 		req->rq_status = req->rq_interpret_reply(env, req,
 							 &req->rq_async_args,
 							 rc);
@@ -2141,8 +2141,8 @@ struct ptlrpc_service_part {
 #define ptlrpc_service_for_each_part(part, i, svc)			\
 	for (i = 0;							\
 	     i < (svc)->srv_ncpts &&					\
-	     (svc)->srv_parts != NULL &&				\
-	     ((part) = (svc)->srv_parts[i]) != NULL; i++)
+	     (svc)->srv_parts &&					\
+	     ((part) = (svc)->srv_parts[i]); i++)
 
 /**
  * Declaration of ptlrpcd control structure
@@ -2259,7 +2259,6 @@ static inline bool nrs_policy_compat_all(const struct ptlrpc_service *svc,
 static inline bool nrs_policy_compat_one(const struct ptlrpc_service *svc,
 					 const struct ptlrpc_nrs_pol_desc *desc)
 {
-	LASSERT(desc->pd_compat_svc_name != NULL);
 	return strcmp(svc->srv_name, desc->pd_compat_svc_name) == 0;
 }
 
@@ -2303,7 +2302,6 @@ static inline int ptlrpc_client_bulk_active(struct ptlrpc_request *req)
 	struct ptlrpc_bulk_desc *desc;
 	int		      rc;
 
-	LASSERT(req != NULL);
 	desc = req->rq_bulk;
 
 	if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
@@ -2726,7 +2724,7 @@ ptlrpc_client_recv_or_unlink(struct ptlrpc_request *req)
 static inline void
 ptlrpc_client_wake_req(struct ptlrpc_request *req)
 {
-	if (req->rq_set == NULL)
+	if (!req->rq_set)
 		wake_up(&req->rq_reply_waitq);
 	else
 		wake_up(&req->rq_set->set_waitq);
@@ -2750,7 +2748,7 @@ ptlrpc_rs_decref(struct ptlrpc_reply_state *rs)
 /* Should only be called once per req */
 static inline void ptlrpc_req_drop_rs(struct ptlrpc_request *req)
 {
-	if (req->rq_reply_state == NULL)
+	if (!req->rq_reply_state)
 		return; /* shouldn't occur */
 	ptlrpc_rs_decref(req->rq_reply_state);
 	req->rq_reply_state = NULL;
@@ -2807,7 +2805,6 @@ ptlrpc_server_get_timeout(struct ptlrpc_service_part *svcpt)
 static inline struct ptlrpc_service *
 ptlrpc_req2svc(struct ptlrpc_request *req)
 {
-	LASSERT(req->rq_rqbd != NULL);
 	return req->rq_rqbd->rqbd_svcpt->scp_service;
 }
 
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index c64a499..2245359 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -123,7 +123,7 @@ static inline bool lsm_is_released(struct lov_stripe_md *lsm)
 
 static inline bool lsm_has_objects(struct lov_stripe_md *lsm)
 {
-	if (lsm == NULL)
+	if (!lsm)
 		return false;
 	if (lsm_is_released(lsm))
 		return false;
@@ -1224,7 +1224,7 @@ static inline struct md_open_data *obd_mod_alloc(void)
 	struct md_open_data *mod;
 
 	mod = kzalloc(sizeof(*mod), GFP_NOFS);
-	if (mod == NULL)
+	if (!mod)
 		return NULL;
 	atomic_set(&mod->mod_refcount, 1);
 	return mod;
@@ -1271,7 +1271,7 @@ static inline bool filename_is_volatile(const char *name, int namelen, int *idx)
 		return false;
 
 	/* caller does not care of idx */
-	if (idx == NULL)
+	if (!idx)
 		return true;
 
 	/* volatile file, the MDT can be set from name */
@@ -1306,7 +1306,6 @@ bad_format:
 
 static inline int cli_brw_size(struct obd_device *obd)
 {
-	LASSERT(obd != NULL);
 	return obd->u.cli.cl_max_pages_per_rpc << PAGE_CACHE_SHIFT;
 }
 
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 4f631e6..a4d3600 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -306,7 +306,7 @@ static inline int obd_check_dev_active(struct obd_device *obd)
 	 / sizeof(((struct obd_ops *)(0))->iocontrol))
 
 #define OBD_COUNTER_INCREMENT(obdx, op)			   \
-	if ((obdx)->obd_stats != NULL) {			  \
+	if ((obdx)->obd_stats) {				  \
 		unsigned int coffset;			     \
 		coffset = (unsigned int)((obdx)->obd_cntr_base) + \
 			OBD_COUNTER_OFFSET(op);		   \
@@ -315,7 +315,7 @@ static inline int obd_check_dev_active(struct obd_device *obd)
 	}
 
 #define EXP_COUNTER_INCREMENT(export, op)				    \
-	if ((export)->exp_obd->obd_stats != NULL) {			  \
+	if ((export)->exp_obd->obd_stats) {			  \
 		unsigned int coffset;					\
 		coffset = (unsigned int)((export)->exp_obd->obd_cntr_base) + \
 			OBD_COUNTER_OFFSET(op);			      \
@@ -329,7 +329,7 @@ static inline int obd_check_dev_active(struct obd_device *obd)
 	 / sizeof(((struct md_ops *)(0))->getstatus))
 
 #define MD_COUNTER_INCREMENT(obdx, op)			   \
-	if ((obd)->md_stats != NULL) {			   \
+	if ((obd)->md_stats) {			   \
 		unsigned int coffset;			    \
 		coffset = (unsigned int)((obdx)->md_cntr_base) + \
 			MD_COUNTER_OFFSET(op);		   \
@@ -338,24 +338,24 @@ static inline int obd_check_dev_active(struct obd_device *obd)
 	}
 
 #define EXP_MD_COUNTER_INCREMENT(export, op)				 \
-	if ((export)->exp_obd->obd_stats != NULL) {			  \
+	if ((export)->exp_obd->obd_stats) {				  \
 		unsigned int coffset;					\
 		coffset = (unsigned int)((export)->exp_obd->md_cntr_base) +  \
 			MD_COUNTER_OFFSET(op);			       \
 		LASSERT(coffset < (export)->exp_obd->md_stats->ls_num);      \
 		lprocfs_counter_incr((export)->exp_obd->md_stats, coffset);  \
-		if ((export)->exp_md_stats != NULL)			  \
+		if ((export)->exp_md_stats)				  \
 			lprocfs_counter_incr(				\
 				(export)->exp_md_stats, coffset);	    \
 	}
 
 #define EXP_CHECK_MD_OP(exp, op)				\
 do {							    \
-	if ((exp) == NULL) {				    \
+	if (!(exp)) {				    \
 		CERROR("obd_" #op ": NULL export\n");	   \
 		return -ENODEV;				\
 	}						       \
-	if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) {   \
+	if (!(exp)->exp_obd || !OBT((exp)->exp_obd)) {   \
 		CERROR("obd_" #op ": cleaned up obd\n");	\
 		return -EOPNOTSUPP;			    \
 	}						       \
@@ -379,11 +379,11 @@ do {							    \
 
 #define EXP_CHECK_DT_OP(exp, op)				\
 do {							    \
-	if ((exp) == NULL) {				    \
+	if (!(exp)) {				    \
 		CERROR("obd_" #op ": NULL export\n");	   \
 		return -ENODEV;				\
 	}						       \
-	if ((exp)->exp_obd == NULL || !OBT((exp)->exp_obd)) {   \
+	if (!(exp)->exp_obd || !OBT((exp)->exp_obd)) {   \
 		CERROR("obd_" #op ": cleaned up obd\n");	\
 		return -EOPNOTSUPP;			    \
 	}						       \
@@ -467,7 +467,7 @@ static inline int obd_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 	DECLARE_LU_VARS(ldt, d);
 
 	ldt = obd->obd_type->typ_lu;
-	if (ldt != NULL) {
+	if (ldt) {
 		struct lu_context  session_ctx;
 		struct lu_env env;
 
@@ -509,7 +509,7 @@ static inline int obd_precleanup(struct obd_device *obd,
 		return rc;
 	ldt = obd->obd_type->typ_lu;
 	d = obd->obd_lu_dev;
-	if (ldt != NULL && d != NULL) {
+	if (ldt && d) {
 		if (cleanup_stage == OBD_CLEANUP_EXPORTS) {
 			struct lu_env env;
 
@@ -538,7 +538,7 @@ static inline int obd_cleanup(struct obd_device *obd)
 
 	ldt = obd->obd_type->typ_lu;
 	d = obd->obd_lu_dev;
-	if (ldt != NULL && d != NULL) {
+	if (ldt && d) {
 		struct lu_env env;
 
 		rc = lu_env_init(&env, ldt->ldt_ctx_tags);
@@ -586,7 +586,7 @@ obd_process_config(struct obd_device *obd, int datalen, void *data)
 	obd->obd_process_conf = 1;
 	ldt = obd->obd_type->typ_lu;
 	d = obd->obd_lu_dev;
-	if (ldt != NULL && d != NULL) {
+	if (ldt && d) {
 		struct lu_env env;
 
 		rc = lu_env_init(&env, ldt->ldt_ctx_tags);
@@ -674,7 +674,7 @@ static inline int obd_alloc_memmd(struct obd_export *exp,
 				  struct lov_stripe_md **mem_tgt)
 {
 	LASSERT(mem_tgt);
-	LASSERT(*mem_tgt == NULL);
+	LASSERT(!*mem_tgt);
 	return obd_unpackmd(exp, mem_tgt, NULL, 0);
 }
 
@@ -767,7 +767,7 @@ static inline int obd_setattr_rqset(struct obd_export *exp,
 	EXP_COUNTER_INCREMENT(exp, setattr_async);
 
 	set =  ptlrpc_prep_set();
-	if (set == NULL)
+	if (!set)
 		return -ENOMEM;
 
 	rc = OBP(exp->exp_obd, setattr_async)(exp, oinfo, oti, set);
@@ -858,7 +858,7 @@ static inline int obd_connect(const struct lu_env *env,
 
 	rc = OBP(obd, connect)(env, exp, obd, cluuid, data, localdata);
 	/* check that only subset is granted */
-	LASSERT(ergo(data != NULL, (data->ocd_connect_flags & ocf) ==
+	LASSERT(ergo(data, (data->ocd_connect_flags & ocf) ==
 				    data->ocd_connect_flags));
 	return rc;
 }
@@ -882,8 +882,7 @@ static inline int obd_reconnect(const struct lu_env *env,
 
 	rc = OBP(obd, reconnect)(env, exp, obd, cluuid, d, localdata);
 	/* check that only subset is granted */
-	LASSERT(ergo(d != NULL,
-		     (d->ocd_connect_flags & ocf) == d->ocd_connect_flags));
+	LASSERT(ergo(d, (d->ocd_connect_flags & ocf) == d->ocd_connect_flags));
 	return rc;
 }
 
@@ -998,7 +997,7 @@ static inline int obd_init_export(struct obd_export *exp)
 {
 	int rc = 0;
 
-	if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
+	if ((exp)->exp_obd && OBT((exp)->exp_obd) &&
 	    OBP((exp)->exp_obd, init_export))
 		rc = OBP(exp->exp_obd, init_export)(exp);
 	return rc;
@@ -1006,7 +1005,7 @@ static inline int obd_init_export(struct obd_export *exp)
 
 static inline int obd_destroy_export(struct obd_export *exp)
 {
-	if ((exp)->exp_obd != NULL && OBT((exp)->exp_obd) &&
+	if ((exp)->exp_obd && OBT((exp)->exp_obd) &&
 	    OBP((exp)->exp_obd, destroy_export))
 		OBP(exp->exp_obd, destroy_export)(exp);
 	return 0;
@@ -1023,7 +1022,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
 	int rc = 0;
 	struct obd_device *obd;
 
-	if (exp == NULL || exp->exp_obd == NULL)
+	if (!exp || !exp->exp_obd)
 		return -EINVAL;
 
 	obd = exp->exp_obd;
@@ -1059,7 +1058,7 @@ static inline int obd_statfs_rqset(struct obd_export *exp,
 	int rc = 0;
 
 	set =  ptlrpc_prep_set();
-	if (set == NULL)
+	if (!set)
 		return -ENOMEM;
 
 	oinfo.oi_osfs = osfs;
@@ -1081,7 +1080,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
 	int rc = 0;
 	struct obd_device *obd = exp->exp_obd;
 
-	if (obd == NULL)
+	if (!obd)
 		return -EINVAL;
 
 	OBD_CHECK_DT_OP(obd, statfs, -EOPNOTSUPP);
@@ -1241,7 +1240,7 @@ static inline int obd_notify_observer(struct obd_device *observer,
 	 * Also, call non-obd listener, if any
 	 */
 	onu = &observer->obd_upcall;
-	if (onu->onu_upcall != NULL)
+	if (onu->onu_upcall)
 		rc2 = onu->onu_upcall(observer, observed, ev,
 				      onu->onu_owner, NULL);
 	else
@@ -1287,7 +1286,7 @@ static inline int obd_health_check(const struct lu_env *env,
 	int rc;
 
 	/* don't use EXP_CHECK_DT_OP, because NULL method is normal here */
-	if (obd == NULL || !OBT(obd)) {
+	if (!obd || !OBT(obd)) {
 		CERROR("cleaned up obd\n");
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index d031437..506753c 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -507,7 +507,6 @@ extern char obd_jobid_var[];
 do {									      \
 	struct portals_handle *__h = (handle);				      \
 									      \
-	LASSERT(handle != NULL);					      \
 	__h->h_cookie = (unsigned long)(ptr);				      \
 	__h->h_size = (size);						      \
 	call_rcu(&__h->h_rcu, class_handle_free_cb);			      \
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


#1335038 — [PATCH 29/45] staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable

Fromgreen@linuxhacker.ru
Date2016-02-16 07:00 +0100
Subject[PATCH 29/45] staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable
Message-ID<r2GQ4-3tt-51@gated-at.bofh.it>
In reply to#1335014
From: Oleg Drokin <green@linuxhacker.ru>

Found with checkpatch

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/libcfs/debug.c               | 4 ++--
 drivers/staging/lustre/lustre/libcfs/hash.c                | 1 -
 drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c | 7 +++----
 drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c   | 5 ++---
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c
index 9cb8f04..9bb31f9 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -47,15 +47,15 @@
 static char debug_file_name[1024];
 
 unsigned int libcfs_subsystem_debug = ~0;
+EXPORT_SYMBOL(libcfs_subsystem_debug);
 module_param(libcfs_subsystem_debug, int, 0644);
 MODULE_PARM_DESC(libcfs_subsystem_debug, "Lustre kernel debug subsystem mask");
-EXPORT_SYMBOL(libcfs_subsystem_debug);
 
 unsigned int libcfs_debug = (D_CANTMASK |
 			     D_NETERROR | D_HA | D_CONFIG | D_IOCTL);
+EXPORT_SYMBOL(libcfs_debug);
 module_param(libcfs_debug, int, 0644);
 MODULE_PARM_DESC(libcfs_debug, "Lustre kernel debug mask");
-EXPORT_SYMBOL(libcfs_debug);
 
 static int libcfs_param_debug_mb_set(const char *val,
 				     const struct kernel_param *kp)
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
index 51d72f0..414577c 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -1702,7 +1702,6 @@ out:
 	cfs_hash_unlock(hs, 0);
 	cfs_hash_for_each_exit(hs);
 }
-
 EXPORT_SYMBOL(cfs_hash_hlist_for_each);
 
 /*
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
index 68515d9..13d31e8 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
@@ -65,6 +65,7 @@ void cfs_cap_raise(cfs_cap_t cap)
 		commit_creds(cred);
 	}
 }
+EXPORT_SYMBOL(cfs_cap_raise);
 
 void cfs_cap_lower(cfs_cap_t cap)
 {
@@ -76,11 +77,13 @@ void cfs_cap_lower(cfs_cap_t cap)
 		commit_creds(cred);
 	}
 }
+EXPORT_SYMBOL(cfs_cap_lower);
 
 int cfs_cap_raised(cfs_cap_t cap)
 {
 	return cap_raised(current_cap(), cap);
 }
+EXPORT_SYMBOL(cfs_cap_raised);
 
 static void cfs_kernel_cap_pack(kernel_cap_t kcap, cfs_cap_t *cap)
 {
@@ -95,10 +98,6 @@ cfs_cap_t cfs_curproc_cap_pack(void)
 	cfs_kernel_cap_pack(current_cap(), &cap);
 	return cap;
 }
-
-EXPORT_SYMBOL(cfs_cap_raise);
-EXPORT_SYMBOL(cfs_cap_lower);
-EXPORT_SYMBOL(cfs_cap_raised);
 EXPORT_SYMBOL(cfs_curproc_cap_pack);
 
 /*
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
index 565f990..04203b3 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
@@ -144,6 +144,7 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata)
 
 	libcfs_run_upcall (argv);
 }
+EXPORT_SYMBOL(libcfs_run_lbug_upcall);
 
 /* coverity[+kill] */
 void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
@@ -166,6 +167,7 @@ void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
 	while (1)
 		schedule();
 }
+EXPORT_SYMBOL(lbug_with_loc);
 
 static int panic_notifier(struct notifier_block *self, unsigned long unused1,
 			  void *unused2)
@@ -194,6 +196,3 @@ void libcfs_unregister_panic_notifier(void)
 {
 	atomic_notifier_chain_unregister(&panic_notifier_list, &libcfs_panic_notifier);
 }
-
-EXPORT_SYMBOL(libcfs_run_lbug_upcall);
-EXPORT_SYMBOL(lbug_with_loc);
-- 
2.1.0

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web