/* Double check: it may have been committed by someone else,
                 * while we have been waiting for the lock. */
                if (mdev->act_log->pending_changes) {
-                       int err;
-                       err = al_write_transaction(mdev);
+                       al_write_transaction(mdev);
                        mdev->al_writ_cnt++;
 
                        spin_lock_irq(&mdev->al_lock);
        unsigned enr;
        struct lc_element *extent;
        unsigned long flags;
-       bool wake = false;
 
        spin_lock_irqsave(&mdev->al_lock, flags);
 
                        dev_err(DEV, "al_complete_io() called on inactive extent %u\n", enr);
                        continue;
                }
-               if (lc_put(mdev->act_log, extent) == 0)
-                       wake = true;
+               lc_put(mdev->act_log, extent);
        }
        spin_unlock_irqrestore(&mdev->al_lock, flags);
        wake_up(&mdev->al_wait);
 int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
                            const char *file, const unsigned int line)
 {
-       unsigned long sbnr, ebnr, lbnr, flags;
+       unsigned long sbnr, ebnr, flags;
        sector_t esector, nr_sectors;
        unsigned int enr, count = 0;
        struct lc_element *e;
        if (!expect(esector < nr_sectors))
                esector = nr_sectors - 1;
 
-       lbnr = BM_SECT_TO_BIT(nr_sectors-1);
-
        /* we set it out of sync,
         * we do not need to round anything here */
        sbnr = BM_SECT_TO_BIT(sector);
 
 {
        struct drbd_conf *mdev;
        enum drbd_conns oc;
-       int vnr, rv = SS_UNKNOWN_ERROR;
+       int vnr;
 
        if (tconn->cstate == C_STANDALONE)
                return;
        spin_lock_irq(&tconn->req_lock);
        oc = tconn->cstate;
        if (oc >= C_UNCONNECTED)
-               rv = _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE);
+               _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE);
 
        spin_unlock_irq(&tconn->req_lock);
 
 
 static int drbd_disconnected(struct drbd_conf *mdev)
 {
-       enum drbd_fencing_p fp;
        unsigned int i;
 
        /* wait for current activity to cease. */
 
        drbd_md_sync(mdev);
 
-       fp = FP_DONT_CARE;
-       if (get_ldev(mdev)) {
-               rcu_read_lock();
-               fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
-               rcu_read_unlock();
-               put_ldev(mdev);
-       }
-
        /* serialize with bitmap writeout triggered by the state change,
         * if any. */
        wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags));
 
        cpu = part_stat_lock();
        part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]);
        part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio));
+       (void) cpu; /* The macro invocations above want the cpu argument, I do not like
+                      the compiler warning about cpu only assigned but never used... */
        part_inc_in_flight(&mdev->vdisk->part0, rw);
        part_stat_unlock();
 }
 
 static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
                           union drbd_state ns, enum chg_state_flags flags)
 {
-       enum drbd_fencing_p fp;
        struct sib_info sib;
 
        sib.sib_reason = SIB_STATE_CHANGE;
                        mdev->p_uuid[UI_FLAGS] &= ~((u64)2);
        }
 
-       fp = FP_DONT_CARE;
-       if (get_ldev(mdev)) {
-               rcu_read_lock();
-               fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
-               rcu_read_unlock();
-               put_ldev(mdev);
-       }
-
        /* Inform userspace about the change... */
        drbd_bcast_event(mdev, &sib);