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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5574C00140 for ; Fri, 12 Aug 2022 07:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237321AbiHLHBk (ORCPT ); Fri, 12 Aug 2022 03:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237118AbiHLHB1 (ORCPT ); Fri, 12 Aug 2022 03:01:27 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82FBF99250 for ; Fri, 12 Aug 2022 00:01:24 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id c17so169531lfb.3 for ; Fri, 12 Aug 2022 00:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=SIkBdKPO0ia6WryWVkSmCCsuoT+XbQoa2jB/wItvraw=; b=QcVSBUIiPoJBTP/i7J05TmQcLDmF+7re5RaUW7Yue5QCHt7PFToz9xeuYL+4EJnuDs PFMzc0bg7G7TBDlF3Cngr/XnD+myenUSl3WYUmUL+hKlvo5AWe2kdbHCGU5MgkXMujCr 9W7P70YJqRFOr8+//4z1CYL7szZB6+BkBjvGQOnv71VP+Ku3Jo0ZUpGp6593ciRFCBag vm6RZNbiSm3spWzlFQsdbYZokeZEGRvHID10EruE8e4ru/khzXsnWFMT72bojLKxZnZ0 80VDCyatjKWKuRqlrkGfH1+rQxzg/CR67vgqR/UmTVlXB7hhLDkIusXtyEWo0J2dQeQf wMWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=SIkBdKPO0ia6WryWVkSmCCsuoT+XbQoa2jB/wItvraw=; b=OQAUJy8R4lapiiuZ2kW+pxKr/hT5ChaMxn27zDe+W42x9hMQXsa2EOyOeM7esiZRuU 0snmSNFLjfn8ykG0wnAEgOdkuyHqQThh54lUzIriwfmT7TP+5Tw9mGRWRUiBlu5THVwe Vp3F0S0kff62wnE5Td97VPKFgleqS+Pq+i8znhN6N/j3fleIsCA6FI7QU0nu+NSTc+9F 9I7VTmDSByhPDnK7wIQaNq7M7w1b/dV5bJrN4LAQ3HhIjQFUeR8987udQMSXVUFK0nlX GS5bWvJld7C2Mcl2+2zyAxuw+jJxbQE3eJ59b6MTJsrHKH805dVSLfxe/066cV/7oasu TmAQ== X-Gm-Message-State: ACgBeo23lG4LfKELpXxRt0bDXVBdQoOlvFi28TwKSE160OfvgLxuL0xl cLBkdmDjv8BS+BgwiS7Eo8M9Aw== X-Google-Smtp-Source: AA6agR4dr9OpzaVrayVua9XEETsz6x4gzfPaVp1rLoMSliu+ypKx2TsqnT6xOOIjwQQiKfzvXErzDQ== X-Received: by 2002:a05:6512:3501:b0:48b:205f:91a2 with SMTP id h1-20020a056512350100b0048b205f91a2mr834830lfs.83.1660287682735; Fri, 12 Aug 2022 00:01:22 -0700 (PDT) Received: from [192.168.1.39] ([83.146.140.105]) by smtp.gmail.com with ESMTPSA id x2-20020ac24882000000b0047f6b4f82d1sm105601lfc.250.2022.08.12.00.01.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Aug 2022 00:01:22 -0700 (PDT) Message-ID: <40130c63-1e36-bb43-43b4-444a8f287226@linaro.org> Date: Fri, 12 Aug 2022 10:01:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 4/4] dt-bindings: net: dsa: mediatek,mt7530: update json-schema Content-Language: en-US From: Krzysztof Kozlowski To: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sean Wang , Landen Chao , DENG Qingfang , Frank Wunderlich , Luiz Angelo Daros de Luca , Sander Vanheule , =?UTF-8?Q?Ren=c3=a9_van_Dorst?= , Daniel Golle , erkin.bozoglu@xeront.com, Sergio Paracuellos Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220730142627.29028-1-arinc.unal@arinc9.com> <20220730142627.29028-5-arinc.unal@arinc9.com> <8a665b7a-bbd0-99ce-658e-bc78568bdca2@linaro.org> In-Reply-To: <8a665b7a-bbd0-99ce-658e-bc78568bdca2@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/08/2022 09:57, Krzysztof Kozlowski wrote: > On 12/08/2022 01:09, Arınç ÜNAL wrote: >>>> -patternProperties: >>>> - "^(ethernet-)?ports$": >>>> - type: object >>> >>> Actually four patches... >>> >>> I don't find this change explained in commit msg. What is more, it looks >>> incorrect. All properties and patternProperties should be explained in >>> top-level part. >>> >>> Defining such properties (with big piece of YAML) in each if:then: is no >>> readable. >> >> I can't figure out another way. I need to require certain properties for >> a compatible string AND certain enum/const for certain properties which >> are inside patternProperties for "^(ethernet-)?port@[0-9]+$" by reading >> the compatible string. > > requiring properties is not equal to defining them and nothing stops you > from defining all properties top-level and requiring them in > allOf:if:then:patternProperties. > > >> If I put allOf:if:then under patternProperties, I can't do the latter. > > You can. > >> >> Other than readability to human eyes, binding check works as intended, >> in case there's no other way to do it. > > I don't see the problem in doing it and readability is one of main > factors of code admission to Linux kernel. One more thought - if your schema around allOf:if:then grows too much, it is actually a sign that it might benefit from splitting. Either into two separate schemas or into common+two separate. Best regards, Krzysztof