[PATCH 2/2] nfc: pn544: Use str_low_high() helper

Qianfeng Rong posted 2 patches 3 months, 3 weeks ago
[PATCH 2/2] nfc: pn544: Use str_low_high() helper
Posted by Qianfeng Rong 3 months, 3 weeks ago
Remove hard-coded strings by using the str_low_high() helper
function.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 drivers/nfc/pn544/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index a0dfb3f98d5a..8fc9552b9d30 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -16,7 +16,7 @@
 #include <linux/nfc.h>
 #include <linux/firmware.h>
 #include <linux/gpio/consumer.h>
-
+#include <linux/string_choices.h>
 #include <linux/unaligned.h>
 
 #include <net/nfc/hci.h>
@@ -212,7 +212,7 @@ static void pn544_hci_i2c_platform_init(struct pn544_i2c_phy *phy)
 			if (ret == count) {
 				nfc_info(&phy->i2c_dev->dev,
 					 "nfc_en polarity : active %s\n",
-					 (polarity == 0 ? "low" : "high"));
+					 str_low_high(polarity == 0));
 				goto out;
 			}
 		}
-- 
2.34.1
Re: [PATCH 2/2] nfc: pn544: Use str_low_high() helper
Posted by Krzysztof Kozlowski 3 months, 3 weeks ago
On 19/06/2025 11:34, Qianfeng Rong wrote:
> Remove hard-coded strings by using the str_low_high() helper
> function.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
>  drivers/nfc/pn544/i2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

No need to make it one change per patch... but anyway look at netdev
responses for that such changes.

Best regards,
Krzysztof
Re: [PATCH 2/2] nfc: pn544: Use str_low_high() helper
Posted by Qianfeng Rong 3 months, 3 weeks ago
在 2025/6/20 1:33, Krzysztof Kozlowski 写道:
> On 19/06/2025 11:34, Qianfeng Rong wrote:
>> Remove hard-coded strings by using the str_low_high() helper
>> function.
>>
>> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
>> ---
>>   drivers/nfc/pn544/i2c.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
> No need to make it one change per patch... but anyway look at netdev
> responses for that such changes.
>
> Best regards,
> Krzysztof

Thanks for your reminder, I can release v2 if necessary.

Best regards,
Qianfeng