docbook: fix fatal error in linux/input.h
Hi,
Recent commit 8613e4c2872a87cc309a42de2c7091744dc54d0e:
Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700
Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name
#define INPUT_KEYMAP_BY_INDEX (1 << 0)
^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct input_keymap_entry, like:
/* flags bits: */
#define INPUT_KEYMAP_BY_INDEX (1 << 0)
or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#define INPUT_KEYMAP_BY_INDEX (1)
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 22 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)
Quoted 6 lines
or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
I suspect that the right way is to use something like:
#define INPUT_KEYMAP_BY_INDEX (1 << 0)
Could you please test if this would fix the issue?
Thanks,
Mauro
Quoted 27 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)
Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 5 lines
I suspect that the right way is to use something like:
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into include/linux/input.h ??
That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Well, if you don't do it, you may have other problems ;)
Letting characters like <, > or & source code may generate wrong xml files, and may be bad interpreted by the xml tools.
Btw, that Makefile patch I did to auto-generate some media files[1] use this logic to generate such files:
ESCAPE = \ -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"
$(MEDIA_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_DIR)/v4l2.xml
@$($(quiet)gen_xml) @( \ echo "<programlisting>") > $@ @( \ expand --tabs=8 < $< | \ sed $(ESCAPE) $(DOCUMENTED) | \ sed 's/i\.e\./&ie;/') >> $@ @( \ echo "</programlisting>") >> $@
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml)
@( \
echo "<programlisting>"; \
expand --tabs=8 < $< | \
sed -e "s/&/\\&/g" \
-e "s/</\\</g" \
-e "s/>/\\>/g"; \
echo "</programlisting>") > $@Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke Makefile?
Cheers,
Mauro.
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@
Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?
Thanks, I'll look into that.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@
Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?
Maybe that rule needs to apply to .h files also.
Would
%.xml: %.[hc]
work?
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 67 lines · On Tue, 26 Oct 2010 13:59:57 -0700 Randy Dunlap wrote:
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?
Quoted 7 lines
Maybe that rule needs to apply to .h files also.
Would
%.xml: %.[hc]
work?
Doesn't work like that or as a separate rule for
%.xml: %.h
The gen_xml rule isn't firing at all AFAICT.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 73 lines · On Tue, 26 Oct 2010 14:07:26 -0700 Randy Dunlap wrote:
Quoted 71 lines · On Tue, 26 Oct 2010 13:59:57 -0700 Randy Dunlap wrote:
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?Maybe that rule needs to apply to .h files also.
Would
Quoted 8 lines
Quoted 3 lines
%.xml: %.[hc]
work?
Doesn't work like that or as a separate rule for
%.xml: %.hThe
gen_xmlrule isn't firing at all AFAICT.
That rule was used for procfs_exmaple.c in 2.6.33 and earlier. It's no longer used/needed (but I'm in no hurry to delete it either).
It appears that scripts/kernel-doc is the problem with not converting <,> to <, > etc. I'll look into that.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 82 lines · Randy Dunlap
Quoted 80 lines · On Tue, 26 Oct 2010 14:07:26 -0700 Randy Dunlap wrote:
Quoted 67 lines · On Tue, 26 Oct 2010 13:59:57 -0700 Randy Dunlap wrote:
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?Quoted 7 lines
Maybe that rule needs to apply to .h files also.
Would
%.xml: %.[hc]
work?
Doesn't work like that or as a separate rule for
%.xml: %.h
Quoted 8 lines
Quoted 1 line
The
gen_xmlrule isn't firing at all AFAICT.That rule was used for
procfs_exmaple.cin 2.6.33 and earlier. It's no longer used/needed (but I'm in no hurry to delete it either).It appears that
scripts/kernel-docis the problem with not converting <,> to <, > etc. I'll look into that.
Thnaks Randy. I'd prefer not to impose restrictions on the kernel code for the sake of kerneldoc tools.
Signature · 1 line
Dmitry
Quoted 88 lines · On Tue, 26 Oct 2010 14:41:40 -0700 Dmitry Torokhov wrote:
Quoted 87 lines · Randy Dunlap
Quoted 73 lines · On Tue, 26 Oct 2010 14:07:26 -0700 Randy Dunlap wrote:
Quoted 71 lines · On Tue, 26 Oct 2010 13:59:57 -0700 Randy Dunlap wrote:
Quoted 62 lines · On Tue, 26 Oct 2010 18:15:10 -0200 Mauro Carvalho Chehab wrote:
Em 26-10-2010 17:17, Randy Dunlap escreveu:
Quoted 39 lines · On Tue, 26 Oct 2010 17:13:01 -0200 Mauro Carvalho Chehab wrote:
Quoted 28 lines
Em 26-10-2010 16:45, Randy Dunlap escreveu:
Quoted 26 lines
Hi,
Recent commit
8613e4c2872a87cc309a42de2c7091744dc54d0e:Author: Mauro Carvalho Chehab <[email protected]> Date: Thu Sep 9 21:54:22 2010 -0700Input: add support for large scancodes
causes a fatal error in docbook generation:
linux-2.6.36-git8/DOC1/Documentation/DocBook/device-drivers.xml:40690: parser error : StartTag: invalid element name#define INPUT_KEYMAP_BY_INDEX (1 << 0) ^I think that this message comes from xsltproc, but I'm not positive about that. I also don't know of a really good fix for it. However, I did find 2 ways to work around the error:
a/ move the #define value to after the end of the struct
input_keymap_entry, like:/* flags bits: */
#defineINPUT_KEYMAP_BY_INDEX(1 << 0)or
b/ don't use the "<< 0" (can leave the #define where it is in this case):
#defineINPUT_KEYMAP_BY_INDEX(1)Quoted 5 lines
Quoted 2 lines
I have tested both of these patches and they work OK. Are you OK with either of them? or want to choose one?
Hmm... probably, the first one is not correct.
Why not? All it does is move the line to after the end of the struct.
Quoted 2 lines
I suspect that the right way is to use something like:
Quoted 8 lines
Quoted 3 lines
#define INPUT_KEYMAP_BY_INDEX (1 << 0)Could you please test if this would fix the issue?
You are suggesting putting that into
include/linux/input.h??That would make sense if some tool converted "<<" to "<<". And that may be where the problem is, but I don't know those tools.
Hmm... such rule is already at DocBook/Makefile:
%.xml: %.c
@$($(quiet)gen_xml) @( \ echo "<programlisting>"; \ expand --tabs=8 < $< | \ sed -e "s/&/\\&/g" \ -e "s/</\\</g" \ -e "s/>/\\>/g"; \ echo "</programlisting>") > $@Quoted 2 lines
Not sure why this didn't work. It should have replaced the < from the c file. Maybe some patch broke
Makefile?Maybe that rule needs to apply to .h files also.
Would
Quoted 8 lines
Quoted 3 lines
%.xml: %.[hc]
work?
Doesn't work like that or as a separate rule for
%.xml: %.hThe
gen_xmlrule isn't firing at all AFAICT.That rule was used for
procfs_exmaple.cin 2.6.33 and earlier. It's no longer used/needed (but I'm in no hurry to delete it either).
Quoted 6 lines
Quoted 3 lines
It appears that
scripts/kernel-docis the problem with not converting <,> to <, > etc. I'll look into that.Thnaks Randy. I'd prefer not to impose restrictions on the kernel code for the sake of kerneldoc tools.
Yes, I agree, it was just a matter of finding a way thru the maze.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
PATCH 1/1 scripts/kernel-doc: escape special characters for xml struct output
In reply to Randy DunlapFrom: Randy Dunlap <[email protected]>
scripts/kernel-doc was leaving unescaped '<', '>', and '&' in generated xml output for structs. This causes xml parser errors. Convert these characters to "<", ">", and "&" as needed to prevent errors.
Most of the conversion was already done; complete it just before output.
Documentation/DocBook/device-drivers.xml:41883: parser error : StartTag: invalid element name
#define INPUT_KEYMAP_BY_INDEX (1 << 0)
--- scripts/kernel-doc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
scripts/kernel-doc +9 -3
@@ -5,7 +5,7 @@ use strict; ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## ## Copyright (C) 2000, 1 Tim Waugh <[email protected]> ## ## Copyright (C) 2001 Simon Huggins ## -## Copyright (C) 2005-2009 Randy Dunlap ## +## Copyright (C) 2005-2010 Randy Dunlap ## ## ## ## #define enhancements by Armin Kuster <[email protected]> ## ## Copyright (c) 2000 MontaVista Software, Inc. ##
@@ -453,7 +453,7 @@ sub output_highlight { if ($output_mode eq "html" || $output_mode eq "xml") { $contents = local_unescape($contents); # convert data read & converted thru xml_escape() into &xyz; format: - $contents =~ s/\\\\\\/&/g; + $contents =~ s/\\\\\\/\&/g; } # print STDERR "contents b4:$contents\n"; eval $dohighlight;
@@ -770,7 +770,11 @@ sub output_struct_xml(%) { print $args{'type'} . " " . $args{'struct'} . " {\n"; foreach $parameter (@{$args{'parameterlist'}}) { if ($parameter =~ /^#/) { - print "$parameter\n"; + my $prm = $parameter; + # convert data read & converted thru xml_escape() into &xyz; format: + # This allows us to have #define macros interspersed in a struct. + $prm =~ s/\\\\\\/\&/g; + print "$prm\n"; next; }
@@ -1701,6 +1705,8 @@ sub push_parameter($$$) { } } + $param = xml_escape($param); + # strip spaces from $param so that it is one continous string # on @parameterlist; # this fixes a problem where check_sections() cannot find