Skip to content

Commit 2e84fec

Browse files
mauelshaMike Snitzer
authored andcommitted
dm: avoid split of quoted strings where possible
Signed-off-by: Heinz Mauelshagen <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 2d0f25c commit 2e84fec

12 files changed

+37
-67
lines changed

drivers/md/dm-crypt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,7 @@ static int crypt_iv_eboiv_ctr(struct crypt_config *cc, struct dm_target *ti,
733733
}
734734

735735
if (crypto_skcipher_blocksize(any_tfm(cc)) != cc->iv_size) {
736-
ti->error = "Block size of EBOIV cipher does "
737-
"not match IV size of block cipher";
736+
ti->error = "Block size of EBOIV cipher does not match IV size of block cipher";
738737
return -EINVAL;
739738
}
740739

drivers/md/dm-ioctl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ static struct mapped_device *dm_hash_rename(struct dm_ioctl *param,
449449
hc = __get_name_cell(new);
450450

451451
if (hc) {
452-
DMERR("Unable to change %s on mapped device %s to one that "
453-
"already exists: %s",
452+
DMERR("Unable to change %s on mapped device %s to one that already exists: %s",
454453
change_uuid ? "uuid" : "name",
455454
param->name, new);
456455
dm_put(hc->md);
@@ -1838,8 +1837,7 @@ static int check_version(unsigned int cmd, struct dm_ioctl __user *user)
18381837

18391838
if ((DM_VERSION_MAJOR != version[0]) ||
18401839
(DM_VERSION_MINOR < version[1])) {
1841-
DMERR("ioctl interface mismatch: "
1842-
"kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)",
1840+
DMERR("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)",
18431841
DM_VERSION_MAJOR, DM_VERSION_MINOR,
18441842
DM_VERSION_PATCHLEVEL,
18451843
version[0], version[1], version[2], cmd);

drivers/md/dm-log-userspace-transfer.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,8 @@ static int fill_pkg(struct cn_msg *msg, struct dm_ulog_request *tfr)
109109
if (pkg->error != -EAGAIN)
110110
*(pkg->data_size) = 0;
111111
} else if (tfr->data_size > *(pkg->data_size)) {
112-
DMERR("Insufficient space to receive package [%u] "
113-
"(%u vs %zu)", tfr->request_type,
114-
tfr->data_size, *(pkg->data_size));
112+
DMERR("Insufficient space to receive package [%u] (%u vs %zu)",
113+
tfr->request_type, tfr->data_size, *(pkg->data_size));
115114

116115
*(pkg->data_size) = 0;
117116
pkg->error = -ENOSPC;

drivers/md/dm-log.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
389389
else if (!strcmp(argv[1], "nosync"))
390390
sync = NOSYNC;
391391
else {
392-
DMWARN("unrecognised sync argument to "
393-
"dirty region log: %s", argv[1]);
392+
DMWARN("unrecognised sync argument to dirty region log: %s", argv[1]);
394393
return -EINVAL;
395394
}
396395
}

drivers/md/dm-raid1.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type)
239239
* Better to issue requests to same failing device
240240
* than to risk returning corrupt data.
241241
*/
242-
DMERR("Primary mirror (%s) failed while out-of-sync: "
243-
"Reads may fail.", m->dev->name);
242+
DMERR("Primary mirror (%s) failed while out-of-sync: Reads may fail.",
243+
m->dev->name);
244244
goto out;
245245
}
246246

@@ -526,8 +526,7 @@ static void read_callback(unsigned long error, void *context)
526526
fail_mirror(m, DM_RAID1_READ_ERROR);
527527

528528
if (likely(default_ok(m)) || mirror_available(m->ms, bio)) {
529-
DMWARN_LIMIT("Read failure on mirror device %s. "
530-
"Trying alternative device.",
529+
DMWARN_LIMIT("Read failure on mirror device %s. Trying alternative device.",
531530
m->dev->name);
532531
queue_bio(m->ms, bio, bio_data_dir(bio));
533532
return;

drivers/md/dm-snap-persistent.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,7 @@ static int read_header(struct pstore *ps, int *new_snapshot)
358358
return 0;
359359

360360
if (chunk_size_supplied)
361-
DMWARN("chunk size %u in device metadata overrides "
362-
"table chunk size of %u.",
361+
DMWARN("chunk size %u in device metadata overrides table chunk size of %u.",
363362
chunk_size, ps->store->chunk_size);
364363

365364
/* We had a bogus chunk_size. Fix stuff up. */
@@ -966,8 +965,7 @@ int dm_persistent_snapshot_init(void)
966965

967966
r = dm_exception_store_type_register(&_persistent_compat_type);
968967
if (r) {
969-
DMERR("Unable to register old-style persistent exception "
970-
"store type");
968+
DMERR("Unable to register old-style persistent exception store type");
971969
dm_exception_store_type_unregister(&_persistent_type);
972970
return r;
973971
}

drivers/md/dm-snap-transient.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ int dm_transient_snapshot_init(void)
143143

144144
r = dm_exception_store_type_register(&_transient_compat_type);
145145
if (r) {
146-
DMWARN("Unable to register old-style transient "
147-
"exception store type");
146+
DMWARN("Unable to register old-style transient exception store type");
148147
dm_exception_store_type_unregister(&_transient_type);
149148
return r;
150149
}

drivers/md/dm-snap.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ static int __validate_exception_handover(struct dm_snapshot *snap)
495495
if ((__find_snapshots_sharing_cow(snap, &snap_src, &snap_dest,
496496
&snap_merge) == 2) ||
497497
snap_dest) {
498-
snap->ti->error = "Snapshot cow pairing for exception "
499-
"table handover failed";
498+
snap->ti->error = "Snapshot cow pairing for exception table handover failed";
500499
return -EINVAL;
501500
}
502501

@@ -523,8 +522,7 @@ static int __validate_exception_handover(struct dm_snapshot *snap)
523522

524523
if (!snap_src->store->type->prepare_merge ||
525524
!snap_src->store->type->commit_merge) {
526-
snap->ti->error = "Snapshot exception store does not "
527-
"support snapshot-merge.";
525+
snap->ti->error = "Snapshot exception store does not support snapshot-merge.";
528526
return -EINVAL;
529527
}
530528

@@ -943,8 +941,7 @@ static int __remove_single_exception_chunk(struct dm_snapshot *s,
943941

944942
e = dm_lookup_exception(&s->complete, old_chunk);
945943
if (!e) {
946-
DMERR("Corruption detected: exception for block %llu is "
947-
"on disk but not in memory",
944+
DMERR("Corruption detected: exception for block %llu is on disk but not in memory",
948945
(unsigned long long)old_chunk);
949946
return -EINVAL;
950947
}
@@ -971,8 +968,7 @@ static int __remove_single_exception_chunk(struct dm_snapshot *s,
971968
e->new_chunk++;
972969
} else if (old_chunk != e->old_chunk +
973970
dm_consecutive_chunk_count(e)) {
974-
DMERR("Attempt to merge block %llu from the "
975-
"middle of a chunk range [%llu - %llu]",
971+
DMERR("Attempt to merge block %llu from the middle of a chunk range [%llu - %llu]",
976972
(unsigned long long)old_chunk,
977973
(unsigned long long)e->old_chunk,
978974
(unsigned long long)
@@ -1065,8 +1061,7 @@ static void snapshot_merge_next_chunks(struct dm_snapshot *s)
10651061
&new_chunk);
10661062
if (linear_chunks <= 0) {
10671063
if (linear_chunks < 0) {
1068-
DMERR("Read error in exception store: "
1069-
"shutting down merge");
1064+
DMERR("Read error in exception store: shutting down merge");
10701065
down_write(&s->lock);
10711066
s->merge_failed = true;
10721067
up_write(&s->lock);
@@ -2215,12 +2210,10 @@ static int snapshot_preresume(struct dm_target *ti)
22152210
if (snap_src && snap_dest) {
22162211
down_read(&snap_src->lock);
22172212
if (s == snap_src) {
2218-
DMERR("Unable to resume snapshot source until "
2219-
"handover completes.");
2213+
DMERR("Unable to resume snapshot source until handover completes.");
22202214
r = -EINVAL;
22212215
} else if (!dm_suspended(snap_src->ti)) {
2222-
DMERR("Unable to perform snapshot handover until "
2223-
"source is suspended.");
2216+
DMERR("Unable to perform snapshot handover until source is suspended.");
22242217
r = -EINVAL;
22252218
}
22262219
up_read(&snap_src->lock);

drivers/md/dm-stripe.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,31 +109,27 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
109109

110110
width = ti->len;
111111
if (sector_div(width, stripes)) {
112-
ti->error = "Target length not divisible by "
113-
"number of stripes";
112+
ti->error = "Target length not divisible by number of stripes";
114113
return -EINVAL;
115114
}
116115

117116
tmp_len = width;
118117
if (sector_div(tmp_len, chunk_size)) {
119-
ti->error = "Target length not divisible by "
120-
"chunk size";
118+
ti->error = "Target length not divisible by chunk size";
121119
return -EINVAL;
122120
}
123121

124122
/*
125123
* Do we have enough arguments for that many stripes ?
126124
*/
127125
if (argc != (2 + 2 * stripes)) {
128-
ti->error = "Not enough destinations "
129-
"specified";
126+
ti->error = "Not enough destinations specified";
130127
return -EINVAL;
131128
}
132129

133130
sc = kmalloc(struct_size(sc, stripe, stripes), GFP_KERNEL);
134131
if (!sc) {
135-
ti->error = "Memory allocation for striped context "
136-
"failed";
132+
ti->error = "Memory allocation for striped context failed";
137133
return -ENOMEM;
138134
}
139135

drivers/md/dm-table.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
235235
return 0;
236236

237237
if ((start >= dev_size) || (start + len > dev_size)) {
238-
DMERR("%s: %pg too small for target: "
239-
"start=%llu, len=%llu, dev_size=%llu",
238+
DMERR("%s: %pg too small for target: start=%llu, len=%llu, dev_size=%llu",
240239
dm_device_name(ti->table->md), bdev,
241240
(unsigned long long)start,
242241
(unsigned long long)len,
@@ -281,17 +280,15 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
281280
return 0;
282281

283282
if (start & (logical_block_size_sectors - 1)) {
284-
DMERR("%s: start=%llu not aligned to h/w "
285-
"logical block size %u of %pg",
283+
DMERR("%s: start=%llu not aligned to h/w logical block size %u of %pg",
286284
dm_device_name(ti->table->md),
287285
(unsigned long long)start,
288286
limits->logical_block_size, bdev);
289287
return 1;
290288
}
291289

292290
if (len & (logical_block_size_sectors - 1)) {
293-
DMERR("%s: len=%llu not aligned to h/w "
294-
"logical block size %u of %pg",
291+
DMERR("%s: len=%llu not aligned to h/w logical block size %u of %pg",
295292
dm_device_name(ti->table->md),
296293
(unsigned long long)len,
297294
limits->logical_block_size, bdev);
@@ -884,8 +881,7 @@ static int dm_table_determine_type(struct dm_table *t)
884881
bio_based = 1;
885882

886883
if (bio_based && request_based) {
887-
DMERR("Inconsistent table: different target types"
888-
" can't be mixed up");
884+
DMERR("Inconsistent table: different target types can't be mixed up");
889885
return -EINVAL;
890886
}
891887
}
@@ -1188,8 +1184,7 @@ static int dm_table_register_integrity(struct dm_table *t)
11881184
* profile the new profile should not conflict.
11891185
*/
11901186
if (blk_integrity_compare(dm_disk(md), template_disk) < 0) {
1191-
DMERR("%s: conflict with existing integrity profile: "
1192-
"%s profile mismatch",
1187+
DMERR("%s: conflict with existing integrity profile: %s profile mismatch",
11931188
dm_device_name(t->md),
11941189
template_disk->disk_name);
11951190
return 1;
@@ -1711,8 +1706,7 @@ int dm_calculate_queue_limits(struct dm_table *t,
17111706
* for the table.
17121707
*/
17131708
if (blk_stack_limits(limits, &ti_limits, 0) < 0)
1714-
DMWARN("%s: adding target device "
1715-
"(start sect %llu len %llu) "
1709+
DMWARN("%s: adding target device (start sect %llu len %llu) "
17161710
"caused an alignment inconsistency",
17171711
dm_device_name(t->md),
17181712
(unsigned long long) ti->begin,

0 commit comments

Comments
 (0)