]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging/lustre: clean up SET_BUT_UNUSED/UNUSED macros
authorDmitry Eremin <dmitry.eremin@intel.com>
Tue, 3 Dec 2013 13:58:50 +0000 (21:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2013 16:51:40 +0000 (08:51 -0800)
This is SET_BUT_UNUSED/UNUSED macro cleaning up part
of the original Lustre tree commit.

Lustre-change: http://review.whamcloud.com/6139
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3204
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs.h
drivers/staging/lustre/lnet/selftest/rpc.c
drivers/staging/lustre/lnet/selftest/selftest.h
drivers/staging/lustre/lnet/selftest/timer.c
drivers/staging/lustre/lustre/llite/dcache.c

index 687dbab2c4ec464b811c56b3b8491bd1cf09054b..4a6c7da721748d45eccb1cb780f1126558183cef 100644 (file)
@@ -181,8 +181,6 @@ static inline void *__container_of(void *ptr, unsigned long shift)
 #define container_of0(ptr, type, member) \
        ((type *)__container_of((void *)(ptr), offsetof(type, member)))
 
-#define SET_BUT_UNUSED(a) do { } while(sizeof(a) - sizeof(a))
-
 #define _LIBCFS_H
 
 #endif /* _LIBCFS_H */
index 7659a26676bbeca424ef3a8e79767e848e5bea7a..5ae59d2a0dad6f5ecca2d2dc46c90c414b6b2d84 100644 (file)
@@ -124,7 +124,6 @@ srpc_bulk_t *
 srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
 {
        srpc_bulk_t  *bk;
-       struct page  **pages;
        int           i;
 
        LASSERT(bulk_npg > 0 && bulk_npg <= LNET_MAX_IOV);
@@ -140,7 +139,6 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
        bk->bk_sink   = sink;
        bk->bk_len    = bulk_len;
        bk->bk_niov   = bulk_npg;
-       UNUSED(pages);
 
        for (i = 0; i < bulk_npg; i++) {
                struct page *pg;
index 8053b0563ff331ea4358073531c3359dcb8ebcba..cd539263201a092b9bfc84a2fdbdf26658e1b7b3 100644 (file)
@@ -572,9 +572,6 @@ swi_state2str (int state)
 #undef STATE2STR
 }
 
-#define UNUSED(x)       ( (void)(x) )
-
-
 #define selftest_wait_events() cfs_pause(cfs_time_seconds(1) / 10)
 
 
index 82fd363679cb94d9e5a2a0e1d28e8cdce8c048b3..b8e50ef0bb4ea3c1c9572209432b4745759e228d 100644 (file)
@@ -171,19 +171,14 @@ stt_check_timers(cfs_time_t *last)
 int
 stt_timer_main(void *arg)
 {
-       int rc = 0;
-       UNUSED(arg);
-
-       SET_BUT_UNUSED(rc);
-
        cfs_block_allsigs();
 
        while (!stt_data.stt_shuttingdown) {
                stt_check_timers(&stt_data.stt_prev_slot);
 
-               rc = wait_event_timeout(stt_data.stt_waitq,
-                                       stt_data.stt_shuttingdown,
-                                       cfs_time_seconds(STTIMER_SLOTTIME));
+               wait_event_timeout(stt_data.stt_waitq,
+                                  stt_data.stt_shuttingdown,
+                                  cfs_time_seconds(STTIMER_SLOTTIME));
        }
 
        spin_lock(&stt_data.stt_lock);
index e7629be39739b99a7d2466262504ad66a981e20e..cbd663ed030cfe1edb054516d1d0b2b7bf258fa0 100644 (file)
@@ -404,7 +404,6 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                struct inode *inode = de->d_inode;
                struct ll_inode_info *lli = ll_i2info(inode);
                struct obd_client_handle **och_p;
-               __u64 *och_usecount;
                __u64 ibits;
 
                /*
@@ -418,37 +417,32 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                 */
 
 
-               if (it->it_flags & FMODE_WRITE) {
+               if (it->it_flags & FMODE_WRITE)
                        och_p = &lli->lli_mds_write_och;
-                       och_usecount = &lli->lli_open_fd_write_count;
-               } else if (it->it_flags & FMODE_EXEC) {
+               else if (it->it_flags & FMODE_EXEC)
                        och_p = &lli->lli_mds_exec_och;
-                       och_usecount = &lli->lli_open_fd_exec_count;
-               } else {
+               else
                        och_p = &lli->lli_mds_read_och;
-                       och_usecount = &lli->lli_open_fd_read_count;
-               }
+
                /* Check for the proper lock. */
                ibits = MDS_INODELOCK_LOOKUP;
                if (!ll_have_md_lock(inode, &ibits, LCK_MINMODE))
                        goto do_lock;
                mutex_lock(&lli->lli_och_mutex);
                if (*och_p) { /* Everything is open already, do nothing */
-                       /*(*och_usecount)++;  Do not let them steal our open
-                         handle from under us */
-                       SET_BUT_UNUSED(och_usecount);
-                       /* XXX The code above was my original idea, but in case
-                          we have the handle, but we cannot use it due to later
-                          checks (e.g. O_CREAT|O_EXCL flags set), nobody
-                          would decrement counter increased here. So we just
-                          hope the lock won't be invalidated in between. But
-                          if it would be, we'll reopen the open request to
-                          MDS later during file open path */
+                       /* Originally it was idea to do not let them steal our
+                        * open handle from under us by (*och_usecount)++ here.
+                        * But in case we have the handle, but we cannot use it
+                        * due to later checks (e.g. O_CREAT|O_EXCL flags set),
+                        * nobody would decrement counter increased here. So we
+                        * just hope the lock won't be invalidated in between.
+                        * But if it would be, we'll reopen the open request to
+                        * MDS later during file open path.
+                        */
                        mutex_unlock(&lli->lli_och_mutex);
                        return 1;
-               } else {
-                       mutex_unlock(&lli->lli_och_mutex);
                }
+               mutex_unlock(&lli->lli_och_mutex);
        }
 
        if (it->it_op == IT_GETATTR) {