Skip to contentSkip to conversation

staging: vt6655: Replace BBvClearFOE by bbvclearfoe

PATCH In review Varsha Rao 4 participants 21 messages Oct 8, 2016 – Oct 13, 2016 Staging

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 staging: vt6655: Replace BBvClearFOE by bbvclearfoe

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe. Avoid CamelCase: <BBvClearFOE>

---
 drivers/staging/vt6655/baseband.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.h +1 -1
index 6d9a936..a732fba 100644
@@ -58,7 +58,7 @@
 #define TOP_RATE_2M         0x00200000
 #define TOP_RATE_1M         0x00100000
 
-#define BBvClearFOE(dwIoBase)				\
+#define bbvclearfoe(dwIoBase)				\
 	BBbWriteEmbedded(dwIoBase, 0xB1, 0)
 
 #define BBvSetFOE(dwIoBase)				\
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Varsha Rao

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe. Avoid CamelCase: <BBvClearFOE>

---
 drivers/staging/vt6655/baseband.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.h +0 -0
index 6d9a936..a732fba 100644

drivers/staging/vt6655/baseband.h line 61

Quoted 5 lines
drivers/staging/vt6655/baseband.h +1 -1
@@ -58,7 +58,7 @@
 #define TOP_RATE_2M         0x00200000
 #define TOP_RATE_1M         0x00100000
 
-#define BBvClearFOE(dwIoBase)				\
+#define bbvclearfoe(dwIoBase)				\

Is the macro never used? It is strange to change a definition without at least one use. If there is no use, then the macro can be dropped.

julia

Quoted 13 lines
drivers/staging/vt6655/baseband.h +0 -1
 	BBbWriteEmbedded(dwIoBase, 0xB1, 0)
 
 #define BBvSetFOE(dwIoBase)				\
--

2.7.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/20161008112506.GA12694%40euri.
For more options, visit https://groups.google.com/d/optout.

author
#2 lore raw
Quoted 5 lines

Is the macro never used? It is strange to change a definition without at least one use. If there is no use, then the macro can be dropped.

No,it is not used anywhere else.I have checked it using grep command . I will remove it.

author
#3 lore raw
Quoted 9 lines · Varsha Rao

Is the macro never used? It is strange to change a definition without at

Quoted 2 lines

least one use. If there is no use, then the macro can be dropped.

No,it is not used anywhere else.I have checked it using grep command . I will remove it.

On executing make command ,after it's removal gives error.

In file included from drivers/staging/vt6655/device_main.c:53:0:
drivers/staging/vt6655/baseband.h:62:34: error: "0xB1" may not appear
in
macro parameter list
#define BBbWriteEmbedded(iobase, 0xB1, 0)

#4 lore raw
Quoted 15 lines · Varsha Rao

On Saturday, October 8, 2016 at 11:39:12 PM UTC+5:30, Varsha Rao wrote:

Is the macro never used?  It is strange to change a definition without at
least one use.  If there is no use, then the macro can be dropped.

    No,it is not used anywhere else.I have checked it using grep command .
    I will remove it.

Quoted 7 lines

     On executing make command ,after it's removal  gives error.

      In file included from drivers/staging/vt6655/device_main.c:53:0:
     drivers/staging/vt6655/baseband.h:62:34: error: "0xB1" may not appear in
      macro parameter list
      #define BBbWriteEmbedded(iobase, 0xB1, 0)

Where did this code come from? You should remove the whole definition of the macro, not just the header line.

julia

Quoted 12 lines

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/d15336f4-5027-4b19-b3fd- 52f4fac150c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

author
#5 lore raw

:

Quoted 16 lines
Quoted 12 lines

Is the macro never used? It is strange to change a definition without at
least one use. If there is no use, then the macro can be dropped.

No,it is not used anywhere else.I have checked it using grep
command .
I will remove it.

Quoted 4 lines

On executing make command ,after it's removal gives error.

In file included from drivers/staging/vt6655/device_main.c:53:0:
drivers/staging/vt6655/baseband.h:62:34: error: "0xB1" may not

Quoted 9 lines

appear

Quoted 3 lines

in
macro parameter list
#define BBbWriteEmbedded(iobase, 0xB1, 0)

Where did this code come from? You should remove the whole definition of the macro, not just the header line.

I have tried using grep and gcc -dN -E to find the definition of it.But
couldn't find through them.

#6 lore raw
Quoted 26 lines · Varsha Rao

:
>
>             Is the macro never used?  It is strange to change a
>             definition without at
>             least one use.  If there is no use, then the macro >             can be dropped.
>
>
>           No,it is not used anywhere else.I have checked it using grep
>       command .
>           I will remove it.
>
>
>      On executing make command ,after it's removal  gives error.
>
>       In file included from drivers/staging/vt6655/device_main.c:53:0:
>      drivers/staging/vt6655/baseband.h:62:34: error: "0xB1" may not appear
> in
>       macro parameter list
>       #define BBbWriteEmbedded(iobase, 0xB1, 0)

Quoted 7 lines

Where did this code come from?  You should remove the whole definition of
the macro, not just the header line.

   I have tried using grep and gcc -dN -E to find the definition of it.But couldn't find through them.

The above code is not a proper macro definition. What is the actual change that you made? You can see this by doing git diff on the file.

julia

Quoted 12 lines

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/fd933dbe-c8ef-4f38-ae1c- 7f75a8bab6c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

author
#7 lore raw
Quoted 6 lines

The above code is not a proper macro definition. What is the actual change that you made? You can see this by doing git diff on the file.

I have posted the patch by making the changes and but git diff won't
give information on from where it is imported . Since it is not macro definition , it has to be defined
somewhere. My question is how to locate the definition of it to remove
the macro completely? For that I have tried using grep and gcc -dN -E but could not locate using them.

Varsha

#8 lore raw
Quoted 9 lines · Varsha Rao

The above code is not a proper macro definition.  What is the actual
change that you made?  You can see this by doing git diff on the file.

    I have posted the patch by making the changes

Posted it where? If it is on the mailing list, I no longer have easy access to it. Please send it again in response to this message.

thanks,
julia

Quoted 20 lines

and  but git diff won't
give information on from where it is imported . Since it is not macro definition , it has to be defined
    somewhere. My question is how to locate the definition of it to remove the macro completely? For that I have tried using grep and gcc -dN -E but could not locate using them.

    Varsha

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/5a2e45cf-903e-41c4-91d8 -37d45aea9ce7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

author
#9 lore raw

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe.

---
drivers/staging/vt6655/
baseband.h | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-) 
(quoted diff) +0 -0

b/drivers/staging/vt6655/baseband.h
index 6d9a936..a732fba 100644

drivers/staging/vt6655/baseband.h +1 -1
@@ -58,7 +58,7 @@ 
 #define TOP_RATE_2M         0x00200000 
 #define TOP_RATE_1M         0x00100000 
  
-#define BBvClearFOE(dwIoBase)                                \ 
+#define bbvclearfoe(dwIoBase)                                \ 
         BBbWriteEmbedded(dwIoBase, 0xB1, 0) 
  
 #define BBvSetFOE(dwIoBase)                                \ 
Signature · 1 line
2.7.4 
#10 lore raw
Quoted 20 lines · Varsha Rao

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe.

---
 drivers/staging/vt6655/baseband.h | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.h +0 -0
index 6d9a936..a732fba 100644
@@ -58,7 +58,7 @@
  #define TOP_RATE_2M         0x00200000
  #define TOP_RATE_1M         0x00100000

drivers/staging/vt6655/baseband.h +1 -1
-#define BBvClearFOE(dwIoBase)                                \
+#define bbvclearfoe(dwIoBase)                                \
Quoted 1 line

         BBbWriteEmbedded(dwIoBase, 0xB1, 0)

I think this is what you sent before, and that the macro is never used? I have the impression that what you did wrong is to just remove BBvClearFOE(dwIoBase) and not the entire macro definition (both lines).

julia

Quoted 16 lines


 #define BBvSetFOE(dwIoBase)                                \
--
2.7.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 visithttps://groups.google.com/d/msgid/outreachy-kernel/21e853d5-b5bb-4b00-b1b5- 7ec1a38145f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

author
#11 lore raw
Quoted 3 lines

I think this is what you sent before, and that the macro is never used?

Yes, this is the same.

Quoted 5 lines

I have the impression that what you did wrong is to just remove BBvClearFOE(dwIoBase) and not the entire macro definition (both lines).

I made a mistake there but my question remains the same like how to
find in what file a macro is stored if it cannot be found by grep or gcc -dN -E?

maintainer
#12 lore raw

On Thu, Oct 13, 2016 at 05:37:55AM -0700, Varsha Rao wrote:

Please turn off html email in your email client options.

Quoted 7 lines

I think this is what you sent before, and that the macro is never used?

� �� Yes, this is the same.�

Quoted 7 lines

I have the impression that what you did wrong is to just remove BBvClearFOE(dwIoBase) and not the entire macro definition (both lines).

��
� �� I made a mistake there but my question remains the same like how to find in what file a macro is stored if it cannot be found by grep or gcc -dN -E?�

In that case, it is not used, so it can be removed, right?

thanks,

greg k-h

#13 lore raw
In reply to Varsha Rao
Quoted 7 lines · Varsha Rao
Quoted 2 lines

I think this is what you sent before, and that the macro is never used?

Yes, this is the same.

Quoted 2 lines
Quoted 7 lines
Quoted 3 lines

I have the impression that what you did wrong is to just remove BBvClearFOE(dwIoBase) and not the entire macro definition (both lines).

I made a mistake there but my question remains the same like how to
find in what file a macro is stored if it cannot be found by grep or gcc -dN -E?

What Julia is trying to say, is you are supposed to remove the whole definition, not just a single line. Which means that you need to remove these 2 lines [which is the Macro definition] :

#define bbvclearfoe(dwIoBase)                                \
         BBbWriteEmbedded(dwIoBase, 0xB1, 0)

This can be easily seen by git grep. But Git grep shows just the first line of the
definition. If this is the 2nd time you are sending a patch for the same issue then the patch should come out as a v2.

Also, I think there are some other macro(s) in the same file which are not used. They should go away as well.

On a side note, you are supposed to send the replies of mails in a plain text as well.

Quoted 10 lines

--
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/a2bc99d4-a161-429c-a7d6-4e9ba3a8b33b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Signature · 2 lines
Vaishali
http://vaishalithakkar.in/
author
#14 lore raw
Quoted 4 lines

What Julia is trying to say, is you are supposed to remove the whole

definition,

Quoted 5 lines

not just a single line. Which means that you need to remove these 2 lines [which is the Macro definition] :

#define bbvclearfoe(dwIoBase) \
BBbWriteEmbedded(dwIoBase, 0xB1, 0)

I understood her point.

Quoted 7 lines

This can be easily seen by git grep. But Git grep shows just the first line of the
definition.

If this is the 2nd time you are sending a patch for the same issue then the patch should come out as a v2.

No, it is not second time but I just posted the same patch.

Quoted 1 line

Also, I think there are some other macro(s) in the same file which are not

used.

Quoted 1 line

They should go away as well.

I will remove them.

Quoted 2 lines

On a side note, you are supposed to send the replies of mails in a plain text as well.

#15 lore raw
In reply to Varsha Rao
Quoted 7 lines · Varsha Rao

I think this is what you sent before, and that the macro is never used?

     Yes, this is the same.

Quoted 8 lines

I have the impression that what you did wrong is to just remove BBvClearFOE(dwIoBase) and not the entire macro definition (both lines).


     I made a mistake there but my question remains the same like how to find in what file a macro is stored if it cannot be found by grep or gcc -dN -E?

Two points:

1. If you made the change that I guess you made, then you moved what was in the body of the macro into the parameter list of the macro. The parameter list of the macro is very restricted. It should only be a lit of variable names, not arbitrary expressions.

2. A macro that is never used just disappears from the preprocessed code. It is not included in the code that is compiled. So it causes no problem to have a macro definition in Linux like:

#define never_used(a,b,c) Hello my name is Julia

The expansion of the macro is not valid C code, and refers to lots of undefined variables, but since they are not used, it doesn't matter.

On the other hand, the patch you sent in the most recent message is different than the code you were showing as erroneous. If the patch you sent is really the thing that you did, then it is possible that you converted a macro that is never used to a macro that actually is used, because it is shadowing a function of the same name. In that case too, you will have references to symbols that might not exist in the kernel.

In any case, the correct approach is to completely remove the definition.

julia

Quoted 12 lines

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/a2bc99d4-a161-429c-a7d6- 4e9ba3a8b33b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

author
#16 lore raw

Thanks for your explanation. I will post the new patch with changes.

maintainer
#17 lore raw
In reply to Varsha Rao
Quoted 11 lines · Varsha Rao

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe.

---
�drivers/staging/vt6655/
baseband.h | 2 +-
�1 file changed, 1 insertion(+), 1 deletion(-)

drivers/staging/vt6655/ renamed from drivers/staging/vt6655/baseband.h +0 -0
Quoted 1 line

baseband.h

Patch is line-wrapped and can not be applied :(

maintainer
#18 lore raw
In reply to Varsha Rao
Quoted 9 lines · Varsha Rao

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe.

---
�drivers/staging/vt6655/
baseband.h | 2 +-
�1 file changed, 1 insertion(+), 1 deletion(-)

It's also sent in html format which does not work :(

author
#19 lore raw
Quoted 4 lines

It's also sent in html format which does not work :(

Sorry it's not the patch but reply post for Julia.

maintainer
#20 lore raw
In reply to Varsha Rao
Quoted 13 lines · Varsha Rao

This patch fixes the checkpatch issue by replacing BBvClearFOE with bbvclearfoe. Avoid CamelCase: <BBvClearFOE>

---
 drivers/staging/vt6655/baseband.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/baseband.h +0 -0
index 6d9a936..a732fba 100644

drivers/staging/vt6655/baseband.h line 62

Quoted 6 lines
drivers/staging/vt6655/baseband.h +1 -1
@@ -58,7 +58,7 @@
 #define TOP_RATE_2M         0x00200000
 #define TOP_RATE_1M         0x00100000
 
-#define BBvClearFOE(dwIoBase)				\
+#define bbvclearfoe(dwIoBase)				\
 	BBbWriteEmbedded(dwIoBase, 0xB1, 0)

As this isn't used at all, why not just remove it?

thanks,

greg k-h