Skip to content

Commit c42257d

Browse files
julianwiedmannhcahca
authored andcommitted
s390/zcrypt: remove gratuitious NULL check in .remove() callbacks
As .remove() is only called after a successful .probe() call, we can trust that the drvdata is valid. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent b5adbbf commit c42257d

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎drivers/s390/crypto/zcrypt_cex2a.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ static void zcrypt_cex2a_card_remove(struct ap_device *ap_dev)
132132
{
133133
struct zcrypt_card *zc = dev_get_drvdata(&ap_dev->device);
134134

135-
if (zc)
136-
zcrypt_card_unregister(zc);
135+
zcrypt_card_unregister(zc);
137136
}
138137

139138
static struct ap_driver zcrypt_cex2a_card_driver = {
@@ -192,8 +191,7 @@ static void zcrypt_cex2a_queue_remove(struct ap_device *ap_dev)
192191
{
193192
struct zcrypt_queue *zq = dev_get_drvdata(&ap_dev->device);
194193

195-
if (zq)
196-
zcrypt_queue_unregister(zq);
194+
zcrypt_queue_unregister(zq);
197195
}
198196

199197
static struct ap_driver zcrypt_cex2a_queue_driver = {

‎drivers/s390/crypto/zcrypt_cex2c.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ static void zcrypt_cex2c_card_remove(struct ap_device *ap_dev)
314314

315315
if (ap_test_bit(&ac->functions, AP_FUNC_COPRO))
316316
sysfs_remove_group(&ap_dev->device.kobj, &cca_card_attr_grp);
317-
if (zc)
318-
zcrypt_card_unregister(zc);
317+
318+
zcrypt_card_unregister(zc);
319319
}
320320

321321
static struct ap_driver zcrypt_cex2c_card_driver = {
@@ -387,8 +387,8 @@ static void zcrypt_cex2c_queue_remove(struct ap_device *ap_dev)
387387

388388
if (ap_test_bit(&aq->card->functions, AP_FUNC_COPRO))
389389
sysfs_remove_group(&ap_dev->device.kobj, &cca_queue_attr_grp);
390-
if (zq)
391-
zcrypt_queue_unregister(zq);
390+
391+
zcrypt_queue_unregister(zq);
392392
}
393393

394394
static struct ap_driver zcrypt_cex2c_queue_driver = {

‎drivers/s390/crypto/zcrypt_cex4.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,8 @@ static void zcrypt_cex4_card_remove(struct ap_device *ap_dev)
575575
sysfs_remove_group(&ap_dev->device.kobj, &cca_card_attr_grp);
576576
else if (ap_test_bit(&ac->functions, AP_FUNC_EP11))
577577
sysfs_remove_group(&ap_dev->device.kobj, &ep11_card_attr_grp);
578-
if (zc)
579-
zcrypt_card_unregister(zc);
578+
579+
zcrypt_card_unregister(zc);
580580
}
581581

582582
static struct ap_driver zcrypt_cex4_card_driver = {
@@ -665,8 +665,8 @@ static void zcrypt_cex4_queue_remove(struct ap_device *ap_dev)
665665
sysfs_remove_group(&ap_dev->device.kobj, &cca_queue_attr_grp);
666666
else if (ap_test_bit(&aq->card->functions, AP_FUNC_EP11))
667667
sysfs_remove_group(&ap_dev->device.kobj, &ep11_queue_attr_grp);
668-
if (zq)
669-
zcrypt_queue_unregister(zq);
668+
669+
zcrypt_queue_unregister(zq);
670670
}
671671

672672
static struct ap_driver zcrypt_cex4_queue_driver = {

0 commit comments

Comments
 (0)