aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-11-07 04:54:28 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:58:05 -0500
commit376694a0543f5da194d9c6e102cfcd023ffac949 (patch)
tree6c470c16923152a64c76539b9889a4f8ee2a4a2f
parent9bcd2521827bb7c418a83a77474c449d6496d55c (diff)
drbd: Silenced compiler warnings
Since version 4.6.1 gcc warns about variables that get a value assigned, but which are never read later on. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_actlog.c11
-rw-r--r--drivers/block/drbd/drbd_receiver.c13
-rw-r--r--drivers/block/drbd/drbd_req.c2
-rw-r--r--drivers/block/drbd/drbd_state.c9
4 files changed, 7 insertions, 28 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 4dd52088f241..ade79be4e27a 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -264,8 +264,7 @@ void drbd_al_begin_io(struct drbd_conf *mdev, struct drbd_interval *i)
264 /* Double check: it may have been committed by someone else, 264 /* Double check: it may have been committed by someone else,
265 * while we have been waiting for the lock. */ 265 * while we have been waiting for the lock. */
266 if (mdev->act_log->pending_changes) { 266 if (mdev->act_log->pending_changes) {
267 int err; 267 al_write_transaction(mdev);
268 err = al_write_transaction(mdev);
269 mdev->al_writ_cnt++; 268 mdev->al_writ_cnt++;
270 269
271 spin_lock_irq(&mdev->al_lock); 270 spin_lock_irq(&mdev->al_lock);
@@ -290,7 +289,6 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i)
290 unsigned enr; 289 unsigned enr;
291 struct lc_element *extent; 290 struct lc_element *extent;
292 unsigned long flags; 291 unsigned long flags;
293 bool wake = false;
294 292
295 spin_lock_irqsave(&mdev->al_lock, flags); 293 spin_lock_irqsave(&mdev->al_lock, flags);
296 294
@@ -300,8 +298,7 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i)
300 dev_err(DEV, "al_complete_io() called on inactive extent %u\n", enr); 298 dev_err(DEV, "al_complete_io() called on inactive extent %u\n", enr);
301 continue; 299 continue;
302 } 300 }
303 if (lc_put(mdev->act_log, extent) == 0) 301 lc_put(mdev->act_log, extent);
304 wake = true;
305 } 302 }
306 spin_unlock_irqrestore(&mdev->al_lock, flags); 303 spin_unlock_irqrestore(&mdev->al_lock, flags);
307 wake_up(&mdev->al_wait); 304 wake_up(&mdev->al_wait);
@@ -730,7 +727,7 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size,
730int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size, 727int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
731 const char *file, const unsigned int line) 728 const char *file, const unsigned int line)
732{ 729{
733 unsigned long sbnr, ebnr, lbnr, flags; 730 unsigned long sbnr, ebnr, flags;
734 sector_t esector, nr_sectors; 731 sector_t esector, nr_sectors;
735 unsigned int enr, count = 0; 732 unsigned int enr, count = 0;
736 struct lc_element *e; 733 struct lc_element *e;
@@ -752,8 +749,6 @@ int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
752 if (!expect(esector < nr_sectors)) 749 if (!expect(esector < nr_sectors))
753 esector = nr_sectors - 1; 750 esector = nr_sectors - 1;
754 751
755 lbnr = BM_SECT_TO_BIT(nr_sectors-1);
756
757 /* we set it out of sync, 752 /* we set it out of sync,
758 * we do not need to round anything here */ 753 * we do not need to round anything here */
759 sbnr = BM_SECT_TO_BIT(sector); 754 sbnr = BM_SECT_TO_BIT(sector);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index aba04d7dadf5..e823968f1cd2 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -4324,7 +4324,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
4324{ 4324{
4325 struct drbd_conf *mdev; 4325 struct drbd_conf *mdev;
4326 enum drbd_conns oc; 4326 enum drbd_conns oc;
4327 int vnr, rv = SS_UNKNOWN_ERROR; 4327 int vnr;
4328 4328
4329 if (tconn->cstate == C_STANDALONE) 4329 if (tconn->cstate == C_STANDALONE)
4330 return; 4330 return;
@@ -4351,7 +4351,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
4351 spin_lock_irq(&tconn->req_lock); 4351 spin_lock_irq(&tconn->req_lock);
4352 oc = tconn->cstate; 4352 oc = tconn->cstate;
4353 if (oc >= C_UNCONNECTED) 4353 if (oc >= C_UNCONNECTED)
4354 rv = _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE); 4354 _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE);
4355 4355
4356 spin_unlock_irq(&tconn->req_lock); 4356 spin_unlock_irq(&tconn->req_lock);
4357 4357
@@ -4361,7 +4361,6 @@ static void conn_disconnect(struct drbd_tconn *tconn)
4361 4361
4362static int drbd_disconnected(struct drbd_conf *mdev) 4362static int drbd_disconnected(struct drbd_conf *mdev)
4363{ 4363{
4364 enum drbd_fencing_p fp;
4365 unsigned int i; 4364 unsigned int i;
4366 4365
4367 /* wait for current activity to cease. */ 4366 /* wait for current activity to cease. */
@@ -4405,14 +4404,6 @@ static int drbd_disconnected(struct drbd_conf *mdev)
4405 4404
4406 drbd_md_sync(mdev); 4405 drbd_md_sync(mdev);
4407 4406
4408 fp = FP_DONT_CARE;
4409 if (get_ldev(mdev)) {
4410 rcu_read_lock();
4411 fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
4412 rcu_read_unlock();
4413 put_ldev(mdev);
4414 }
4415
4416 /* serialize with bitmap writeout triggered by the state change, 4407 /* serialize with bitmap writeout triggered by the state change,
4417 * if any. */ 4408 * if any. */
4418 wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); 4409 wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags));
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index d61309db14a2..42bdf36cef18 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -39,6 +39,8 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req
39 cpu = part_stat_lock(); 39 cpu = part_stat_lock();
40 part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); 40 part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]);
41 part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio)); 41 part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio));
42 (void) cpu; /* The macro invocations above want the cpu argument, I do not like
43 the compiler warning about cpu only assigned but never used... */
42 part_inc_in_flight(&mdev->vdisk->part0, rw); 44 part_inc_in_flight(&mdev->vdisk->part0, rw);
43 part_stat_unlock(); 45 part_stat_unlock();
44} 46}
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 9aefca69e4e7..4075bd2d2515 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1143,7 +1143,6 @@ int drbd_bitmap_io_from_worker(struct drbd_conf *mdev,
1143static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, 1143static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1144 union drbd_state ns, enum chg_state_flags flags) 1144 union drbd_state ns, enum chg_state_flags flags)
1145{ 1145{
1146 enum drbd_fencing_p fp;
1147 struct sib_info sib; 1146 struct sib_info sib;
1148 1147
1149 sib.sib_reason = SIB_STATE_CHANGE; 1148 sib.sib_reason = SIB_STATE_CHANGE;
@@ -1156,14 +1155,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1156 mdev->p_uuid[UI_FLAGS] &= ~((u64)2); 1155 mdev->p_uuid[UI_FLAGS] &= ~((u64)2);
1157 } 1156 }
1158 1157
1159 fp = FP_DONT_CARE;
1160 if (get_ldev(mdev)) {
1161 rcu_read_lock();
1162 fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
1163 rcu_read_unlock();
1164 put_ldev(mdev);
1165 }
1166
1167 /* Inform userspace about the change... */ 1158 /* Inform userspace about the change... */
1168 drbd_bcast_event(mdev, &sib); 1159 drbd_bcast_event(mdev, &sib);
1169 1160