Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions

Since ccp_dev_suspend() and ccp_dev_resume() only return 0 which causes
ret to equal 0 in sp_suspend and sp_resume, making the if condition
impossible to use. it might be a more appropriate fix to have these be
void functions and eliminate the if condition in sp_suspend() and
sp_resume().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: John Allen <john.allen@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Tian Tao and committed by
Herbert Xu
5d17c414 b2d17df3

+10 -29
+4 -8
drivers/crypto/ccp/ccp-dev.c
··· 548 548 return ccp->cmd_q_count == suspended; 549 549 } 550 550 551 - int ccp_dev_suspend(struct sp_device *sp) 551 + void ccp_dev_suspend(struct sp_device *sp) 552 552 { 553 553 struct ccp_device *ccp = sp->ccp_data; 554 554 unsigned long flags; ··· 556 556 557 557 /* If there's no device there's nothing to do */ 558 558 if (!ccp) 559 - return 0; 559 + return; 560 560 561 561 spin_lock_irqsave(&ccp->cmd_lock, flags); 562 562 ··· 572 572 while (!ccp_queues_suspended(ccp)) 573 573 wait_event_interruptible(ccp->suspend_queue, 574 574 ccp_queues_suspended(ccp)); 575 - 576 - return 0; 577 575 } 578 576 579 - int ccp_dev_resume(struct sp_device *sp) 577 + void ccp_dev_resume(struct sp_device *sp) 580 578 { 581 579 struct ccp_device *ccp = sp->ccp_data; 582 580 unsigned long flags; ··· 582 584 583 585 /* If there's no device there's nothing to do */ 584 586 if (!ccp) 585 - return 0; 587 + return; 586 588 587 589 spin_lock_irqsave(&ccp->cmd_lock, flags); 588 590 ··· 595 597 } 596 598 597 599 spin_unlock_irqrestore(&ccp->cmd_lock, flags); 598 - 599 - return 0; 600 600 } 601 601 602 602 int ccp_dev_init(struct sp_device *sp)
+2 -10
drivers/crypto/ccp/sp-dev.c
··· 213 213 214 214 int sp_suspend(struct sp_device *sp) 215 215 { 216 - int ret; 217 - 218 216 if (sp->dev_vdata->ccp_vdata) { 219 - ret = ccp_dev_suspend(sp); 220 - if (ret) 221 - return ret; 217 + ccp_dev_suspend(sp); 222 218 } 223 219 224 220 return 0; ··· 222 226 223 227 int sp_resume(struct sp_device *sp) 224 228 { 225 - int ret; 226 - 227 229 if (sp->dev_vdata->ccp_vdata) { 228 - ret = ccp_dev_resume(sp); 229 - if (ret) 230 - return ret; 230 + ccp_dev_resume(sp); 231 231 } 232 232 233 233 return 0;
+4 -11
drivers/crypto/ccp/sp-dev.h
··· 134 134 int ccp_dev_init(struct sp_device *sp); 135 135 void ccp_dev_destroy(struct sp_device *sp); 136 136 137 - int ccp_dev_suspend(struct sp_device *sp); 138 - int ccp_dev_resume(struct sp_device *sp); 137 + void ccp_dev_suspend(struct sp_device *sp); 138 + void ccp_dev_resume(struct sp_device *sp); 139 139 140 140 #else /* !CONFIG_CRYPTO_DEV_SP_CCP */ 141 141 ··· 144 144 return 0; 145 145 } 146 146 static inline void ccp_dev_destroy(struct sp_device *sp) { } 147 - 148 - static inline int ccp_dev_suspend(struct sp_device *sp) 149 - { 150 - return 0; 151 - } 152 - static inline int ccp_dev_resume(struct sp_device *sp) 153 - { 154 - return 0; 155 - } 147 + static inline void ccp_dev_suspend(struct sp_device *sp) { } 148 + static inline void ccp_dev_resume(struct sp_device *sp) { } 156 149 #endif /* CONFIG_CRYPTO_DEV_SP_CCP */ 157 150 158 151 #ifdef CONFIG_CRYPTO_DEV_SP_PSP