[44/45] iwlwifi: fix printf specifier
diff mbox

Message ID 1450731046-2796-44-git-send-email-emmanuel.grumbach@intel.com
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Emmanuel Grumbach Dec. 21, 2015, 8:50 p.m. UTC
Smatch warned about a bad specifier being used. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Joe Perches Dec. 23, 2015, 4:08 a.m. UTC | #1
On Mon, 2015-12-21 at 22:50 +0200, Emmanuel Grumbach wrote:
> Smatch warned about a bad specifier being used. Fix that.

I see nothing here other than a signed/unsigned
issue that shouldn't need fixing.  The conversion
from hex to decimal may not be useful.

> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
> index b395854..c15f5be 100644
> --- a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
> +++ b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
> @@ -454,11 +454,11 @@ static void iwl_eeprom_enhanced_txpower(struct device *dev,
>  				 TXP_CHECK_AND_PRINT(COMMON_TYPE),
>  				 txp->flags);
>  		IWL_DEBUG_EEPROM(dev,
> -				 "\t\t chain_A: 0x%02x chain_B: 0X%02x chain_C: 0X%02x\n",
> +				 "\t\t chain_A: %d chain_B: %d chain_C: %d\n",
>  				 txp->chain_a_max, txp->chain_b_max,
>  				 txp->chain_c_max);
>  		IWL_DEBUG_EEPROM(dev,
> -				 "\t\t MIMO2: 0x%02x MIMO3: 0x%02x High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
> +				 "\t\t MIMO2: %d MIMO3: %d High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
>  				 txp->mimo2_max, txp->mimo3_max,
>  				 ((txp->delta_20_in_40 & 0xf0) >> 4),
>  				 (txp->delta_20_in_40 & 0x0f));

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Emmanuel Grumbach Dec. 23, 2015, 6:28 a.m. UTC | #2
On 12/23/2015 06:08 AM, Joe Perches wrote:
> On Mon, 2015-12-21 at 22:50 +0200, Emmanuel Grumbach wrote:
>> Smatch warned about a bad specifier being used. Fix that.
> I see nothing here other than a signed/unsigned
> issue that shouldn't need fixing.  The conversion
> from hex to decimal may not be useful.

Yes so maybe I could just use the 0x%x specifier since
printk-formats.txt seems to say that 0x%x is good for s32 as well. Seems
that the "02" makes it "unsigned only".
Printing those values in hexadecimal is annoying anyway since we usually
express Tx power in decimal.
Thanks for pointing that out!

>> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>> ---
>>  drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
>> index b395854..c15f5be 100644
>> --- a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
>> +++ b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
>> @@ -454,11 +454,11 @@ static void iwl_eeprom_enhanced_txpower(struct device *dev,
>>  				 TXP_CHECK_AND_PRINT(COMMON_TYPE),
>>  				 txp->flags);
>>  		IWL_DEBUG_EEPROM(dev,
>> -				 "\t\t chain_A: 0x%02x chain_B: 0X%02x chain_C: 0X%02x\n",
>> +				 "\t\t chain_A: %d chain_B: %d chain_C: %d\n",
>>  				 txp->chain_a_max, txp->chain_b_max,
>>  				 txp->chain_c_max);
>>  		IWL_DEBUG_EEPROM(dev,
>> -				 "\t\t MIMO2: 0x%02x MIMO3: 0x%02x High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
>> +				 "\t\t MIMO2: %d MIMO3: %d High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
>>  				 txp->mimo2_max, txp->mimo3_max,
>>  				 ((txp->delta_20_in_40 & 0xf0) >> 4),
>>  				 (txp->delta_20_in_40 & 0x0f));
>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
index b395854..c15f5be 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
@@ -454,11 +454,11 @@  static void iwl_eeprom_enhanced_txpower(struct device *dev,
 				 TXP_CHECK_AND_PRINT(COMMON_TYPE),
 				 txp->flags);
 		IWL_DEBUG_EEPROM(dev,
-				 "\t\t chain_A: 0x%02x chain_B: 0X%02x chain_C: 0X%02x\n",
+				 "\t\t chain_A: %d chain_B: %d chain_C: %d\n",
 				 txp->chain_a_max, txp->chain_b_max,
 				 txp->chain_c_max);
 		IWL_DEBUG_EEPROM(dev,
-				 "\t\t MIMO2: 0x%02x MIMO3: 0x%02x High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
+				 "\t\t MIMO2: %d MIMO3: %d High 20_on_40: 0x%02x Low 20_on_40: 0x%02x\n",
 				 txp->mimo2_max, txp->mimo3_max,
 				 ((txp->delta_20_in_40 & 0xf0) >> 4),
 				 (txp->delta_20_in_40 & 0x0f));