mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-usb@vger.kernel.org
Cc: "Guido Günther" <agx@sigxcpu.org>,
	"Luc Van Oostenryck" <luc.vanoostenryck@gmail.com>,
	"Sparse Mailing-list" <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH v2 2/4] usb: typec: tps6598x: Add trace event for status register
Date: Sun, 14 Feb 2021 19:31:37 +0000	[thread overview]
Message-ID: <c48e4250-a42a-9f99-1280-69b0b5cfb69d@ramsayjones.plus.com> (raw)
In-Reply-To: <CAHk-=wjCAVj7J+KAC1pvtdeM-c76oXZq7k=v40-maKjTo6qfVw@mail.gmail.com>



On 14/02/2021 19:00, Linus Torvalds wrote:
> On Sun, Feb 14, 2021 at 10:42 AM Ramsay Jones
> <ramsay@ramsayjones.plus.com> wrote:
>>
>>>
>>> I looked around but didn't find any hints how to fix this. Any pointers
>>> I missed (added the sparse list to cc:)?
>>
>> This is a limitation of sparse; when using the 'stringize' pre-processor
>> operator #, the maximum size of the resulting string is about 8k (if I
>> remember correctly).
> 
> Well, yes and no.
> 
> The C89 standard actually says that a string literal can be at most
> 509 characters to be portable. C99 increased it to 4095 characters.
> 
> Sparse makes the limit higher, and the limit could easily be expanded
> way past 8kB - but the point is that large string literals are
> actually not guaranteed to be valid C.
> 
> So honestly, it really sounds like that TRACE_EVENT() thing is doing
> something it shouldn't be doing.

Yep, as I said, I didn't submit the patch - rather I changed the source
so as not to need such a long string.

> I don't think there's any fundamental limit why sparse does 8kB as a
> limit (just a few random buffers). Making sparse accept larger ones
> should be as simple as just increasing MAX_STRING, but I really don't
> think the kernel should encourage that kind of excessive string sizes.

I agree, but I wiggled my patch (which doesn't increase MAX_STRING) to
apply to the current codebase, and ... it now fails two tests! ;-)
(It seems, in the intervening 9 years, the show_token_sequence() function
fixed the quoting of double-quotes in the resulting strings, which
my patch fails to do).

Sorry for the noise.

ATB,
Ramsay Jones


  parent reply	other threads:[~2021-02-14 19:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 12:04 [PATCH v2 0/4] usb: typec: tps6598x: Add IRQ flag and register tracing Guido Günther
2021-02-12 12:04 ` [PATCH v2 1/4] usb: typec: tps6598x: Add trace event for IRQ events Guido Günther
2021-02-12 12:04 ` [PATCH v2 2/4] usb: typec: tps6598x: Add trace event for status register Guido Günther
2021-02-13  3:12   ` kernel test robot
2021-02-14 17:06     ` Guido Günther
     [not found]       ` <6a8eb07f-16d5-f461-cf0b-6c4aaf93b014@ramsayjones.plus.com>
2021-02-14 19:00         ` Linus Torvalds
2021-02-14 19:07           ` Linus Torvalds
2021-02-14 19:31           ` Ramsay Jones [this message]
2021-02-14 20:41           ` Luc Van Oostenryck
2021-02-15 11:32             ` Guido Günther
2021-02-12 12:04 ` [PATCH v2 3/4] usb: typec: tps6598x: Add trace event for power " Guido Günther
2021-02-12 12:04 ` [PATCH v2 4/4] usb: typec: tps6598x: Add trace event for data status Guido Günther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c48e4250-a42a-9f99-1280-69b0b5cfb69d@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=agx@sigxcpu.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®