aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-log.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-08-02 07:32:01 -0400
committerAlasdair G Kergon <agk@redhat.com>2011-08-02 07:32:01 -0400
commitc8f543e0786785d8c7118fc2878e42bc0193a88d (patch)
treeb8984adc44c3a15f1bee56f3b6b9ff49f8ed4d2c /drivers/md/dm-log.c
parent936688d7eb0f39be96c5791be1a04994cc8d6aa0 (diff)
dm log: clean up bit little endian bitops
Using __test_and_{set,clear}_bit_le() with ignoring its return value can be replaced with __{set,clear}_bit_le(). This also removes unnecessary casts. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r--drivers/md/dm-log.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 5f06fb687408..306ce123d6b4 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -257,20 +257,20 @@ struct log_c {
257 */ 257 */
258static inline int log_test_bit(uint32_t *bs, unsigned bit) 258static inline int log_test_bit(uint32_t *bs, unsigned bit)
259{ 259{
260 return test_bit_le(bit, (unsigned long *) bs) ? 1 : 0; 260 return test_bit_le(bit, bs) ? 1 : 0;
261} 261}
262 262
263static inline void log_set_bit(struct log_c *l, 263static inline void log_set_bit(struct log_c *l,
264 uint32_t *bs, unsigned bit) 264 uint32_t *bs, unsigned bit)
265{ 265{
266 __test_and_set_bit_le(bit, (unsigned long *) bs); 266 __set_bit_le(bit, bs);
267 l->touched_cleaned = 1; 267 l->touched_cleaned = 1;
268} 268}
269 269
270static inline void log_clear_bit(struct log_c *l, 270static inline void log_clear_bit(struct log_c *l,
271 uint32_t *bs, unsigned bit) 271 uint32_t *bs, unsigned bit)
272{ 272{
273 __test_and_clear_bit_le(bit, (unsigned long *) bs); 273 __clear_bit_le(bit, bs);
274 l->touched_dirtied = 1; 274 l->touched_dirtied = 1;
275} 275}
276 276
@@ -745,8 +745,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
745 return 0; 745 return 0;
746 746
747 do { 747 do {
748 *region = find_next_zero_bit_le( 748 *region = find_next_zero_bit_le(lc->sync_bits,
749 (unsigned long *) lc->sync_bits,
750 lc->region_count, 749 lc->region_count,
751 lc->sync_search); 750 lc->sync_search);
752 lc->sync_search = *region + 1; 751 lc->sync_search = *region + 1;