[PATCH -next] arm/softfloat: Remove unused variable "bSign"

Li Zetao lizetao1 at huawei.com
Sat Sep 24 02:16:21 PDT 2022


Gcc report warning as follows:

arch/arm/nwfpe/softfloat.c: In function ‘floatx80_rem’:
arch/arm/nwfpe/softfloat.c:3071:17: error: variable ‘bSign’
  set but not used [-Werror=unused-but-set-variable]

arch/arm/nwfpe/softfloat.c: In function ‘float64_rem’:
arch/arm/nwfpe/softfloat.c:2247:17: error: variable ‘bSign’
  set but not used [-Werror=unused-but-set-variable]

arch/arm/nwfpe/softfloat.c: In function ‘float32_rem’:
arch/arm/nwfpe/softfloat.c:1349:17: error: variable ‘bSign’
  set but not used [-Werror=unused-but-set-variable]

Only assign value to variables "bSign", no final use. Fix by
  removing them.

Signed-off-by: Li Zetao <lizetao1 at huawei.com>
---
 arch/arm/nwfpe/softfloat.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
index ffa6b438786b..cbfba26a54af 100644
--- a/arch/arm/nwfpe/softfloat.c
+++ b/arch/arm/nwfpe/softfloat.c
@@ -1346,7 +1346,7 @@ according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
 */
 float32 float32_rem( struct roundingData *roundData, float32 a, float32 b )
 {
-    flag aSign, bSign, zSign;
+    flag aSign, zSign;
     int16 aExp, bExp, expDiff;
     bits32 aSig, bSig;
     bits32 q;
@@ -1359,7 +1359,6 @@ float32 float32_rem( struct roundingData *roundData, float32 a, float32 b )
     aSign = extractFloat32Sign( a );
     bSig = extractFloat32Frac( b );
     bExp = extractFloat32Exp( b );
-    bSign = extractFloat32Sign( b );
     if ( aExp == 0xFF ) {
         if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) {
             return propagateFloat32NaN( a, b );
@@ -2244,7 +2243,7 @@ according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
 */
 float64 float64_rem( struct roundingData *roundData, float64 a, float64 b )
 {
-    flag aSign, bSign, zSign;
+    flag aSign, zSign;
     int16 aExp, bExp, expDiff;
     bits64 aSig, bSig;
     bits64 q, alternateASig;
@@ -2255,7 +2254,6 @@ float64 float64_rem( struct roundingData *roundData, float64 a, float64 b )
     aSign = extractFloat64Sign( a );
     bSig = extractFloat64Frac( b );
     bExp = extractFloat64Exp( b );
-    bSign = extractFloat64Sign( b );
     if ( aExp == 0x7FF ) {
         if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) {
             return propagateFloat64NaN( a, b );
@@ -3068,7 +3066,7 @@ according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
 */
 floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b )
 {
-    flag aSign, bSign, zSign;
+    flag aSign, zSign;
     int32 aExp, bExp, expDiff;
     bits64 aSig0, aSig1, bSig;
     bits64 q, term0, term1, alternateASig0, alternateASig1;
@@ -3079,7 +3077,6 @@ floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b )
     aSign = extractFloatx80Sign( a );
     bSig = extractFloatx80Frac( b );
     bExp = extractFloatx80Exp( b );
-    bSign = extractFloatx80Sign( b );
     if ( aExp == 0x7FFF ) {
         if (    (bits64) ( aSig0<<1 )
              || ( ( bExp == 0x7FFF ) && (bits64) ( bSig<<1 ) ) ) {
-- 
2.34.1




More information about the linux-arm-kernel mailing list