From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 509F1C433E0 for ; Sun, 14 Feb 2021 19:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E0C464D5D for ; Sun, 14 Feb 2021 19:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbhBNTBt (ORCPT ); Sun, 14 Feb 2021 14:01:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbhBNTBs (ORCPT ); Sun, 14 Feb 2021 14:01:48 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE195C0613D6 for ; Sun, 14 Feb 2021 11:01:07 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id k22so4611920ljg.3 for ; Sun, 14 Feb 2021 11:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M+PrlagK3FXPEbDOZIY/ECRbDBZyE6NRnFmFq47XoKo=; b=e8vgrlaDAszZNUkNayc/bQhGtTDVv2JWQ2vcikOXiPfOvXZyT7o6vWAx5IiBM+Q5aK xdHDapKbzufyKmtn2WyIcyjmXvK9/AY/sW/TaHGzXucoZnioLMvlxwq5wCIBY1xjxt3H 8t/fXMkN3hYAEKXFusstufxRxZGE6gAS/rk1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M+PrlagK3FXPEbDOZIY/ECRbDBZyE6NRnFmFq47XoKo=; b=QbyL74/k6pPyZWhHEl0FZ7rPYLA2JxeagOyzUrj6ieMM4dECLywKbX7Jog62+o4ZTy Jq7M61rjNuYHRLaZHDjZsoCzrBCjVtObcNrD3UsbFlzAJYvs5x8aoMKf9J/EA2YX6X3X YKkJdLjk5RaDzfFNdQDNF4rIpjLuRJK2xUrn/Mxph8dO3j+gkBM1F4G9dAobjgDo1Me/ UQsXF8YH2Cm39XQaPrv6KJJMzl2UYTb+uRBR9qWkhDqaAWlJOVGsgCQcrHhPL90GjX+o 0GfBcmmNlQE+GV0yJvHbTWNcK/0LlKAuiPJgV90gABQiXoGyCAs9TDy5xDDfg04ku97I uDMg== X-Gm-Message-State: AOAM531S6oXhQdk0Xgnsb+6/mh3HPcfSNRTGKaOXwvA5gEyFejx17cHO EC7pXJA4dvjbfUpO/FWqmppZ1tUxG0aApg== X-Google-Smtp-Source: ABdhPJyCGIAAoI71dLj/qcjKz/PoPzuPwJUwJXKHZSDucnAUjSN5pRX1AzCwmMIYB5fd+j1uH7ow6Q== X-Received: by 2002:a2e:b8c7:: with SMTP id s7mr7183355ljp.397.1613329265539; Sun, 14 Feb 2021 11:01:05 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id r18sm2573540lff.270.2021.02.14.11.01.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Feb 2021 11:01:04 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id f1so7074641lfu.3 for ; Sun, 14 Feb 2021 11:01:04 -0800 (PST) X-Received: by 2002:a19:7f44:: with SMTP id a65mr6579147lfd.41.1613329264262; Sun, 14 Feb 2021 11:01:04 -0800 (PST) MIME-Version: 1.0 References: <651ac50b9ff6ed3db8cab9f176514900f6a02a0c.1613131413.git.agx@sigxcpu.org> <20210213031237.GP219708@shao2-debian> <6a8eb07f-16d5-f461-cf0b-6c4aaf93b014@ramsayjones.plus.com> In-Reply-To: <6a8eb07f-16d5-f461-cf0b-6c4aaf93b014@ramsayjones.plus.com> From: Linus Torvalds Date: Sun, 14 Feb 2021 11:00:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/4] usb: typec: tps6598x: Add trace event for status register To: Ramsay Jones , Greg Kroah-Hartman , Linux Kernel Mailing List , linux-usb@vger.kernel.org Cc: =?UTF-8?Q?Guido_G=C3=BCnther?= , Luc Van Oostenryck , Sparse Mailing-list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Sun, Feb 14, 2021 at 10:42 AM Ramsay Jones 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. 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 wouldn't be surprised if tracing buffers etc make such strings useless anyway. Linus