dm: address space issues relative to switch/while/for/...
authorHeinz Mauelshagen <heinzm@redhat.com>
Wed, 25 Jan 2023 21:57:42 +0000 (22:57 +0100)
committerMike Snitzer <snitzer@kernel.org>
Tue, 14 Feb 2023 19:23:06 +0000 (14:23 -0500)
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-bio-prison-v2.c
drivers/md/dm-cache-metadata.c
drivers/md/dm-log.c
drivers/md/dm-mpath.c
drivers/md/dm-ps-io-affinity.c
drivers/md/dm-ps-round-robin.c
drivers/md/dm-zoned-metadata.c

index 8c8da49e39cd1c30e163fd9112220b1ce9242040..fd852981ef9ccbc42bb6df60661e6ac674e4e23f 100644 (file)
@@ -195,7 +195,7 @@ static bool __put(struct dm_bio_prison_v2 *prison,
 
        // FIXME: shared locks granted above the lock level could starve this
        if (!cell->shared_count) {
-               if (cell->exclusive_lock){
+               if (cell->exclusive_lock) {
                        if (cell->quiesce_continuation) {
                                queue_work(prison->wq, cell->quiesce_continuation);
                                cell->quiesce_continuation = NULL;
index c7c7b4d53fd1faf6b8e0189a10df725aee92ea54..f6817a371ddb7e1ff482788601a4378662636492 100644 (file)
@@ -1010,13 +1010,13 @@ static bool cmd_write_lock(struct dm_cache_metadata *cmd)
        do {                                    \
                if (!cmd_write_lock((cmd)))     \
                        return -EINVAL;         \
-       } while(0)
+       } while (0)
 
 #define WRITE_LOCK_VOID(cmd)                   \
        do {                                    \
                if (!cmd_write_lock((cmd)))     \
                        return;                 \
-       } while(0)
+       } while (0)
 
 #define WRITE_UNLOCK(cmd) \
        up_write(&(cmd)->root_lock)
@@ -1035,13 +1035,13 @@ static bool cmd_read_lock(struct dm_cache_metadata *cmd)
        do {                                    \
                if (!cmd_read_lock((cmd)))      \
                        return -EINVAL;         \
-       } while(0)
+       } while (0)
 
 #define READ_LOCK_VOID(cmd)                    \
        do {                                    \
                if (!cmd_read_lock((cmd)))      \
                        return;                 \
-       } while(0)
+       } while (0)
 
 #define READ_UNLOCK(cmd) \
        up_read(&(cmd)->root_lock)
index 7c3f30c5878567da5e5ea7de2b826a99a977d167..c87d8758718d53dbcc3d8a96dc0cdf63e509a68e 100644 (file)
@@ -784,7 +784,7 @@ static int core_status(struct dm_dirty_log *log, status_type_t status,
        int sz = 0;
        struct log_c *lc = log->context;
 
-       switch(status) {
+       switch (status) {
        case STATUSTYPE_INFO:
                DMEMIT("1 %s", log->type->name);
                break;
@@ -809,7 +809,7 @@ static int disk_status(struct dm_dirty_log *log, status_type_t status,
        int sz = 0;
        struct log_c *lc = log->context;
 
-       switch(status) {
+       switch (status) {
        case STATUSTYPE_INFO:
                DMEMIT("3 %s %s %c", log->type->name, lc->log_dev->name,
                       lc->log_dev_flush_failed ? 'F' :
index 27aa062590ea945e0cb569e8d39c817e186ebc80..18df7ff982038e7448cb9eb444cf4aca78480357 100644 (file)
@@ -1822,7 +1822,7 @@ static void multipath_status(struct dm_target *ti, status_type_t type,
                if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags))
                        DMEMIT("retain_attached_hw_handler ");
                if (m->queue_mode != DM_TYPE_REQUEST_BASED) {
-                       switch(m->queue_mode) {
+                       switch (m->queue_mode) {
                        case DM_TYPE_BIO_BASED:
                                DMEMIT("queue_mode bio ");
                                break;
index 76ce4ce87222920310596aa855a78edc9305513c..461ee6b2044dedab69aa85b6e319e3624a426cec 100644 (file)
@@ -162,7 +162,7 @@ static int ioa_status(struct path_selector *ps, struct dm_path *path,
                return sz;
        }
 
-       switch(type) {
+       switch (type) {
        case STATUSTYPE_INFO:
                DMEMIT("%d ", atomic_read(&s->map_misses));
                break;
index aaf805efaedd2d3dad4666451b54761fa4a953fa..7c2dda9e871c2643ad59d397019fba05c4c50f08 100644 (file)
@@ -94,7 +94,7 @@ static int rr_status(struct path_selector *ps, struct dm_path *path,
        if (!path)
                DMEMIT("0 ");
        else {
-               switch(type) {
+               switch (type) {
                case STATUSTYPE_INFO:
                        break;
                case STATUSTYPE_TABLE:
index c795ea7da7917b1ad2f9343b067945e89eeee36c..35bdb83e3a6e76f02e39999ab76290039178e75e 100644 (file)
@@ -1430,7 +1430,7 @@ static int dmz_emulate_zones(struct dmz_metadata *zmd, struct dmz_dev *dev)
        int idx;
        sector_t zone_offset = 0;
 
-       for(idx = 0; idx < dev->nr_zones; idx++) {
+       for (idx = 0; idx < dev->nr_zones; idx++) {
                struct dm_zone *zone;
 
                zone = dmz_insert(zmd, idx, dev);
@@ -1457,7 +1457,7 @@ static void dmz_drop_zones(struct dmz_metadata *zmd)
 {
        int idx;
 
-       for(idx = 0; idx < zmd->nr_zones; idx++) {
+       for (idx = 0; idx < zmd->nr_zones; idx++) {
                struct dm_zone *zone = xa_load(&zmd->zones, idx);
 
                kfree(zone);