diff mbox series

scripts: kernel-doc: Bug fixed for erroneous warning

Message ID 20231220062446.14511-1-muzammil@dreambigsemi.com (mailing list archive)
State Changes Requested
Headers show
Series scripts: kernel-doc: Bug fixed for erroneous warning | expand

Commit Message

Muhammad Muzammil Dec. 20, 2023, 6:24 a.m. UTC
From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>

kernel-doc: fixed erroneous warning generated by '__counted_by'

Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
---
 scripts/kernel-doc | 1 +
 1 file changed, 1 insertion(+)

Comments

Randy Dunlap Dec. 20, 2023, 6:29 a.m. UTC | #1
Hi,

On 12/19/23 22:24, Muhammad Muzammil wrote:
> From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> 
> kernel-doc: fixed erroneous warning generated by '__counted_by'
> 
> Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> ---
>  scripts/kernel-doc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 1484127db104..ea9688df0e93 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1661,6 +1661,7 @@ sub check_sections($$$$$) {
>  			}
>  			elsif (($decl_type eq "struct") or
>  		       	       ($decl_type eq "union")) {
> +                next if (index("@_", "__counted_by") != -1);
>  				emit_warning("${file}:$.",
>  					"Excess $decl_type member " .
>  					"'$sects[$sx]' " .

One of both of these patches should be enough. Can you test these
instead of your patch, please?

https://lore.kernel.org/linux-doc/20231215001347.work.151-kees@kernel.org/

https://lore.kernel.org/linux-doc/87le9rjb4y.fsf@meer.lwn.net/

Thanks.
Greg KH Dec. 20, 2023, 6:30 a.m. UTC | #2
On Wed, Dec 20, 2023 at 11:24:46AM +0500, Muhammad Muzammil wrote:
> From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> 
> kernel-doc: fixed erroneous warning generated by '__counted_by'
> 
> Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> ---
>  scripts/kernel-doc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 1484127db104..ea9688df0e93 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1661,6 +1661,7 @@ sub check_sections($$$$$) {
>  			}
>  			elsif (($decl_type eq "struct") or
>  		       	       ($decl_type eq "union")) {
> +                next if (index("@_", "__counted_by") != -1);

Please fix your editor to properly use tabs, and to set them to the
correct 8 column spacing.

thanks,

greg k-h
Muhammad Muzammil Dec. 20, 2023, 6:35 a.m. UTC | #3
HI,

1) I already have the below patch but it does not work.
https://lore.kernel.org/linux-doc/20231215001347.work.151-kees@kernel.org/

2) When I applied the below patch. It works.
https://lore.kernel.org/linux-doc/87le9rjb4y.fsf@meer.lwn.net/

On Wed, Dec 20, 2023 at 11:29 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Hi,
>
> On 12/19/23 22:24, Muhammad Muzammil wrote:
> > From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> >
> > kernel-doc: fixed erroneous warning generated by '__counted_by'
> >
> > Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> > ---
> >  scripts/kernel-doc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> > index 1484127db104..ea9688df0e93 100755
> > --- a/scripts/kernel-doc
> > +++ b/scripts/kernel-doc
> > @@ -1661,6 +1661,7 @@ sub check_sections($$$$$) {
> >                       }
> >                       elsif (($decl_type eq "struct") or
> >                              ($decl_type eq "union")) {
> > +                next if (index("@_", "__counted_by") != -1);
> >                               emit_warning("${file}:$.",
> >                                       "Excess $decl_type member " .
> >                                       "'$sects[$sx]' " .
>
> One of both of these patches should be enough. Can you test these
> instead of your patch, please?
>
> https://lore.kernel.org/linux-doc/20231215001347.work.151-kees@kernel.org/
>
> https://lore.kernel.org/linux-doc/87le9rjb4y.fsf@meer.lwn.net/
>
> Thanks.
>
> --
> #Randy
> https://people.kernel.org/tglx/notes-about-netiquette
> https://subspace.kernel.org/etiquette.html
Randy Dunlap Dec. 20, 2023, 6:49 a.m. UTC | #4
On 12/19/23 22:35, Muhammad Muzammil wrote:
> HI,
> 
> 1) I already have the below patch but it does not work.
> https://lore.kernel.org/linux-doc/20231215001347.work.151-kees@kernel.org/
> 
> 2) When I applied the below patch. It works.
> https://lore.kernel.org/linux-doc/87le9rjb4y.fsf@meer.lwn.net/

Thanks!


> On Wed, Dec 20, 2023 at 11:29 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Hi,
>>
>> On 12/19/23 22:24, Muhammad Muzammil wrote:
>>> From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
>>>
>>> kernel-doc: fixed erroneous warning generated by '__counted_by'
>>>
>>> Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
>>> ---
>>>  scripts/kernel-doc | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
>>> index 1484127db104..ea9688df0e93 100755
>>> --- a/scripts/kernel-doc
>>> +++ b/scripts/kernel-doc
>>> @@ -1661,6 +1661,7 @@ sub check_sections($$$$$) {
>>>                       }
>>>                       elsif (($decl_type eq "struct") or
>>>                              ($decl_type eq "union")) {
>>> +                next if (index("@_", "__counted_by") != -1);
>>>                               emit_warning("${file}:$.",
>>>                                       "Excess $decl_type member " .
>>>                                       "'$sects[$sx]' " .
>>
>> One of both of these patches should be enough. Can you test these
>> instead of your patch, please?
>>
>> https://lore.kernel.org/linux-doc/20231215001347.work.151-kees@kernel.org/
>>
>> https://lore.kernel.org/linux-doc/87le9rjb4y.fsf@meer.lwn.net/
>>
>> Thanks.
>>
>> --
>> #Randy
>> https://people.kernel.org/tglx/notes-about-netiquette
>> https://subspace.kernel.org/etiquette.html
Jonathan Corbet Dec. 20, 2023, 3:30 p.m. UTC | #5
Muhammad Muzammil <m.muzzammilashraf@gmail.com> writes:

> From: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
>
> kernel-doc: fixed erroneous warning generated by '__counted_by'
>
> Signed-off-by: Muzammil Ashraf <m.muzzammilashraf@gmail.com>
> ---
>  scripts/kernel-doc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 1484127db104..ea9688df0e93 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1661,6 +1661,7 @@ sub check_sections($$$$$) {
>  			}
>  			elsif (($decl_type eq "struct") or
>  		       	       ($decl_type eq "union")) {
> +                next if (index("@_", "__counted_by") != -1);
>  				emit_warning("${file}:$.",
>  					"Excess $decl_type member " .
>  					"'$sects[$sx]' " .

Could you give an example of the warnings that this patch addresses?
I've not seen any caused by __counted_by since f600c77aeaff was applied
to docs-next.  What did it miss?

Thanks,

jon
diff mbox series

Patch

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 1484127db104..ea9688df0e93 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1661,6 +1661,7 @@  sub check_sections($$$$$) {
 			}
 			elsif (($decl_type eq "struct") or
 		       	       ($decl_type eq "union")) {
+                next if (index("@_", "__counted_by") != -1);
 				emit_warning("${file}:$.",
 					"Excess $decl_type member " .
 					"'$sects[$sx]' " .