diff mbox series

KVM: arm64: Remove unused TRNG_NO_ENTROPY

Message ID 20211026210913.57006-1-quic_qiancai@quicinc.com (mailing list archive)
State New, archived
Headers show
Series KVM: arm64: Remove unused TRNG_NO_ENTROPY | expand

Commit Message

Qian Cai Oct. 26, 2021, 9:09 p.m. UTC
TRNG_NO_ENTROPY was unused when introduced and now. This is also caught by
GCC (W=2):

arch/arm64/kvm/trng.c:17: warning: macro "TRNG_NO_ENTROPY" is not used [-Wunused-macros]
   17 | #define TRNG_NO_ENTROPY   ((unsigned long)-3)

Signed-off-by: Qian Cai <quic_qiancai@quicinc.com>
---
 arch/arm64/kvm/trng.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Will Deacon Oct. 27, 2021, 7:37 a.m. UTC | #1
On Tue, Oct 26, 2021 at 05:09:13PM -0400, Qian Cai wrote:
> TRNG_NO_ENTROPY was unused when introduced and now. This is also caught by
> GCC (W=2):
> 
> arch/arm64/kvm/trng.c:17: warning: macro "TRNG_NO_ENTROPY" is not used [-Wunused-macros]
>    17 | #define TRNG_NO_ENTROPY   ((unsigned long)-3)

This return value is defined by the TRNG SMCCC spec (Arm DEN0098) so I'd
rather just keep it around given that it's not causing any problems.

Will
Marc Zyngier Oct. 27, 2021, 7:46 a.m. UTC | #2
On 2021-10-26 22:09, Qian Cai wrote:
> TRNG_NO_ENTROPY was unused when introduced and now. This is also caught 
> by
> GCC (W=2):
> 
> arch/arm64/kvm/trng.c:17: warning: macro "TRNG_NO_ENTROPY" is not used
> [-Wunused-macros]
>    17 | #define TRNG_NO_ENTROPY   ((unsigned long)-3)
> 
> Signed-off-by: Qian Cai <quic_qiancai@quicinc.com>
> ---
>  arch/arm64/kvm/trng.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/trng.c b/arch/arm64/kvm/trng.c
> index 99bdd7103c9c..6a46b3ac3970 100644
> --- a/arch/arm64/kvm/trng.c
> +++ b/arch/arm64/kvm/trng.c
> @@ -14,7 +14,6 @@
>  #define TRNG_SUCCESS			0UL
>  #define TRNG_NOT_SUPPORTED		((unsigned long)-1)
>  #define TRNG_INVALID_PARAMETER		((unsigned long)-2)
> -#define TRNG_NO_ENTROPY			((unsigned long)-3)
> 
>  #define TRNG_MAX_BITS64			192

That's an architectural definition that doesn't cause any problem.
If anything, that's documentation.

We have *tons* of other definitions with no user all over the
arm64 code. They save the exact same purpose.

         M.
Qian Cai Oct. 27, 2021, 3:17 p.m. UTC | #3
On 10/27/21 3:46 AM, Marc Zyngier wrote:
> That's an architectural definition that doesn't cause any problem.
> If anything, that's documentation.
> 
> We have *tons* of other definitions with no user all over the
> arm64 code. They save the exact same purpose.

Understood. Thanks for the quick feedback, guys!
diff mbox series

Patch

diff --git a/arch/arm64/kvm/trng.c b/arch/arm64/kvm/trng.c
index 99bdd7103c9c..6a46b3ac3970 100644
--- a/arch/arm64/kvm/trng.c
+++ b/arch/arm64/kvm/trng.c
@@ -14,7 +14,6 @@ 
 #define TRNG_SUCCESS			0UL
 #define TRNG_NOT_SUPPORTED		((unsigned long)-1)
 #define TRNG_INVALID_PARAMETER		((unsigned long)-2)
-#define TRNG_NO_ENTROPY			((unsigned long)-3)
 
 #define TRNG_MAX_BITS64			192