History

blk-crypto: remove blk_crypto_unregister()

This function is trivial and is only used in one place. Having this function is misleading because it implies that blk_crypto_register() needs to be paired with blk_crypto_unregister(), which is not the case. Just set disk->queue->crypto_profile to NULL directly.

Eric Biggers committed 4 years ago

Commit 72cd9df1 parent 5b13bc83 files · +1 −10Browse files

Unified · Split

3 files
  1. block/blk-crypto-profile.c +0 −5
  2. block/blk-integrity.c +1 −1
  3. include/linux/blkdev.h +0 −4
block/blk-crypto-profile.c+0−5
@@ -463,11 +463,6 @@ bool blk_crypto_register(struct blk_crypto_profile *profile, · 462 unmodified lines
463}463}
464EXPORT_SYMBOL_GPL(blk_crypto_register);464EXPORT_SYMBOL_GPL(blk_crypto_register);
465 465
466void blk_crypto_unregister(struct request_queue *q)
467{
468 q->crypto_profile = NULL;
469}
470
471/**466/**
472 * blk_crypto_intersect_capabilities() - restrict supported crypto capabilities467 * blk_crypto_intersect_capabilities() - restrict supported crypto capabilities
473 * by child device468 * by child device
block/blk-integrity.c+1−1
@@ -411,7 +411,7 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template · 410 unmodified lines
411#ifdef CONFIG_BLK_INLINE_ENCRYPTION411#ifdef CONFIG_BLK_INLINE_ENCRYPTION
412 if (disk->queue->crypto_profile) {412 if (disk->queue->crypto_profile) {
413 pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");413 pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");
414 blk_crypto_unregister(disk->queue);414 disk->queue->crypto_profile = NULL;
415 }415 }
416#endif416#endif
417}417}
include/linux/blkdev.h+0−4
@@ -1170,8 +1170,6 @@ int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned lo · 1169 unmodified lines
1170bool blk_crypto_register(struct blk_crypto_profile *profile,1170bool blk_crypto_register(struct blk_crypto_profile *profile,
1171 struct request_queue *q);1171 struct request_queue *q);
1172 1172
1173void blk_crypto_unregister(struct request_queue *q);
1174
1175#else /* CONFIG_BLK_INLINE_ENCRYPTION */1173#else /* CONFIG_BLK_INLINE_ENCRYPTION */
1176 1174
1177static inline bool blk_crypto_register(struct blk_crypto_profile *profile,1175static inline bool blk_crypto_register(struct blk_crypto_profile *profile,
@@ -1180,8 +1178,6 @@ static inline bool blk_crypto_register(struct blk_crypto_profile *profile, · 2 unmodified lines
1180 return true;1178 return true;
1181}1179}
1182 1180
1183static inline void blk_crypto_unregister(struct request_queue *q) { }
1184
1185#endif /* CONFIG_BLK_INLINE_ENCRYPTION */1181#endif /* CONFIG_BLK_INLINE_ENCRYPTION */
1186 1182
1187enum blk_unique_id {1183enum blk_unique_id {