Skip to contentSkip to conversation

Staging: octeon: Use preferred kernel type

PATCH Superseded aybuke 3 participants 5 messages Sep 30, 2015 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

aybuke

author
#0 lore raw

PATCH 1/1 Staging: octeon: Use preferred kernel type

This patch fixes "CHECK: Prefer kernel type 'u8' over 'uint8_t'" checkpatch.pl issue in ethernet.c file.

---
 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/octeon/ethernet.c +1 -1
index 7274fda..7f9518d 100644
@@ -382,7 +382,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
 	    && (cvmx_helper_interface_get_mode(interface) !=
 		CVMX_HELPER_INTERFACE_MODE_SPI)) {
 		int i;
-		uint8_t *ptr = dev->dev_addr;
+		u8 *ptr = dev->dev_addr;
 		uint64_t mac = 0;
 
 		for (i = 0; i < 6; i++)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 4 lines · On Wednesday 30 September 2015 15:23:28 aybuke wrote:

This patch fixes "CHECK: Prefer kernel type 'u8' over 'uint8_t'" checkpatch.pl issue in ethernet.c file.

You may want to use 'git config user.name Your Full Name"' to set the author name in the preferred spelling here.

Quoted 8 lines
 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/octeon/ethernet.c +0 -0
index 7274fda..7f9518d 100644

drivers/staging/octeon/ethernet.c static int cvm_oct_set_mac_filter(struct net_device *dev) · line 388

Quoted 8 lines
drivers/staging/octeon/ethernet.c +1 -1
@@ -382,7 +382,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
            && (cvmx_helper_interface_get_mode(interface) !=
                CVMX_HELPER_INTERFACE_MODE_SPI)) {
                int i;
-               uint8_t *ptr = dev->dev_addr;
+               u8 *ptr = dev->dev_addr;
                uint64_t mac = 0;
 
                for (i = 0; i < 6; i++)

The driver has two more instances of uint8_t. It would seem appropriate to convert them all at the same time, otherwise it looks ok here.

I would go one step further and change the int32_t and uint64_t instances in the same driver as well in one patch. While it can technically be split up, that does not make it easier to review here.

Arnd

#2 lore raw
In reply to aybuke
Quoted 2 lines · aybuke

This patch fixes "CHECK: Prefer kernel type 'u8' over 'uint8_t'" checkpatch.pl issue in ethernet.c file.

Say instead what you do to carry out the fix. Here it could be "Change uint8_t to u8, as is preferred in kernel code. Problem identified using checkpatch."

Quoted 1 line

The signed off needs to have your full name, ie what is in your passpport, more or less.

julia

Quoted 27 lines
---
 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/octeon/ethernet.c +1 -2
index 7274fda..7f9518d 100644
@@ -382,7 +382,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
 	    && (cvmx_helper_interface_get_mode(interface) !=
 		CVMX_HELPER_INTERFACE_MODE_SPI)) {
 		int i;
-		uint8_t *ptr = dev->dev_addr;
+		u8 *ptr = dev->dev_addr;
 		uint64_t mac = 0;
 
 		for (i = 0; i < 6; i++)
--

2.1.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1443615808-6064-1-git-send-email-aybuke.147%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

Okey, I'll send the correct v2. I edited my name field. But I have one question.

Am I just should edit the for uint*_t found by checkpatch.pl in ethernet.c file or change all the uint* types in same file.
Because checkpatch.pl only find 2 uint* type control in file. But more than 2.

Thanks.

#4 lore raw
Quoted 7 lines · aybuke ozdemir

Okey, I'll send the correct v2. I edited my name field. But I have one question.

Am I just should edit the for uint*_t found by checkpatch.pl in ethernet.c file or change all the uint* types in same file.
Because checkpatch.pl only find 2 uint* type control in file. But more than 2.

It could be reasonable to change them all. Daniel mentioned the principle that it is good to do something everywhere it applies. Perhaps the checkpatch rule is not general enough.

julia