Skip to contentSkip to conversation

staging: rtl8188eu: Type cast function argument

PATCH In review Bhaskar Singh 4 participants 5 messages Aug 18, 2018 – Aug 20, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8188eu: Type cast function argument

This patch might suppress some warrning.

The function prototype of rtw_malloc2d is

void *rtw_malloc2d(int h, int w, int size)

This patch also resolves the checkpatch.pl warning

WARNING: line over 80 characters

---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +2 -1
index 0fd306a808c4..735d654b2844 100644
@@ -91,7 +91,8 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	if (!efuseTbl)
 		return;
 
-	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
+	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E,
+			EFUSE_MAX_WORD_UNIT, (int)sizeof(u16));
 	if (!eFuseWord) {
 		DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
 		goto eFuseWord_failed;
Signature · 1 line
2.16.4
#1 lore raw
Quoted 20 lines · Bhaskar Singh

This patch might suppress some warrning.

The function prototype of rtw_malloc2d is

void *rtw_malloc2d(int h, int w, int size)

This patch also resolves the checkpatch.pl warning

WARNING: line over 80 characters

---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
index 0fd306a808c4..735d654b2844 100644

drivers/staging/rtl8188eu/core/rtw_efuse.c efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) · line 96

Quoted 7 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +2 -1
@@ -91,7 +91,8 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	if (!efuseTbl)
 		return;
 
-	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
+	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E,
+			EFUSE_MAX_WORD_UNIT, (int)sizeof(u16));
 

You should be align with left parenthesis.

Thanks,
zhong jiang

Quoted 3 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
 	if (!eFuseWord) {
 		DBG_88E("%s: alloc eFuseWord fail!\n", __func__);

goto eFuseWord_failed;

#2 lore raw
Quoted 24 lines · zhong jiang
Quoted 23 lines · Bhaskar Singh

This patch might suppress some warrning.

The function prototype of rtw_malloc2d is

void *rtw_malloc2d(int h, int w, int size)

This patch also resolves the checkpatch.pl warning

WARNING: line over 80 characters

---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
index 0fd306a808c4..735d654b2844 100644
@@ -91,7 +91,8 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	if (!efuseTbl)
 		return;
 
Quoted 13 lines

drivers/staging/rtl8188eu/core/rtw_efuse.c efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)

Quoted 4 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +2 -1
-	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
+	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E,
+			EFUSE_MAX_WORD_UNIT, (int)sizeof(u16));
 

You should be align with left parenthesis.

Thanks,
zhong jiang

Quoted 3 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
 	if (!eFuseWord) {
 		DBG_88E("%s: alloc eFuseWord fail!\n", __func__);

goto eFuseWord_failed;

why post-commit doesn't give some warrning about that (because commits are checked by post-commit script)?
Do I need to resend the patch?

#3 lore raw
Quoted 11 lines · Bhaskar Singh
Quoted 10 lines · zhong jiang
Quoted 9 lines · Bhaskar Singh

This patch might suppress some warrning.

The function prototype of rtw_malloc2d is

void *rtw_malloc2d(int h, int w, int size)

This patch also resolves the checkpatch.pl warning

WARNING: line over 80 characters

Please look deeper at the code than checkpatch.

This function is used exactly once and could
likely be removed and coded inline instead to
improve readability.

Quoted 32 lines
Quoted 20 lines
Quoted 10 lines
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
index 0fd306a808c4..735d654b2844 100644

drivers/staging/rtl8188eu/core/rtw_efuse.c efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) · line 96

Quoted 7 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +2 -1
@@ -91,7 +91,8 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	if (!efuseTbl)
 		return;
 
-	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
+	eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E,
+			EFUSE_MAX_WORD_UNIT, (int)sizeof(u16));
 

You should be align with left parenthesis.

Quoted 7 lines

Thanks,
zhong jiang

Quoted 3 lines
drivers/staging/rtl8188eu/core/rtw_efuse.c +0 -0
 	if (!eFuseWord) {
 		DBG_88E("%s: alloc eFuseWord fail!\n", __func__);

goto eFuseWord_failed;

why post-commit doesn't give some warrning about that (because commits are checked by post-commit script)?
Do I need to resend the patch?

#4 lore raw
In reply to Bhaskar Singh
Quoted 2 lines · Bhaskar Singh

This patch might suppress some warrning.

Which warning? You should find out which program is generating the warning and delete it from your computer because that is a nonsense warning.

regards,
dan carpenter