From patchwork Tue Jan 24 17:45:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 92382 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1829801qgi; Tue, 24 Jan 2017 09:45:40 -0800 (PST) X-Received: by 10.99.178.21 with SMTP id x21mr40668149pge.48.1485279940714; Tue, 24 Jan 2017 09:45:40 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si19984577pgh.266.2017.01.24.09.45.40; Tue, 24 Jan 2017 09:45:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750796AbdAXRpj (ORCPT + 7 others); Tue, 24 Jan 2017 12:45:39 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:35847 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbdAXRpi (ORCPT ); Tue, 24 Jan 2017 12:45:38 -0500 Received: by mail-ot0-f195.google.com with SMTP id 36so20452363otx.3; Tue, 24 Jan 2017 09:45:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v6zyPpwvjXobZrdx+v3OS0b9K1+5vAVsGFJNEQLj9wI=; b=LMgSBQUiJdM5BRoT586TzjIbLhevKFZsm5KxdY6R8hSjMVkbrF9/qNFaiDn7b8pZdM yCzAVpjPvvbIbTCm6ckafwBlyRTlm8L0PE+7NJn6hDsJb7jUrL5DBoji1HYD5AobXnMP lFUQJJ84M26hjThu/4jJxyiN1y+9Q7gal79gUI5fja0YXRHeJaXaXRuzNsHEMtYyGgAK fTCGC4f66iPvWPEyIRHETS4YLJvxuu2ZF1+7xiTyxNnyfPaNmtQCOBErxX1RKvxPSWcz Gg4V4jCcUiPd3bipETClc5ZSKi3be65YWgvjEq0rqAGsvze+g20LGZsyMy5tXOSf+wyh p9QQ== X-Gm-Message-State: AIkVDXIrGMiGVgqefpMEp1keXLptVnNrBXcygUpe9Ef7dgXvdkPM1n2wZxk3gNNGRar/mQ== X-Received: by 10.157.7.17 with SMTP id 17mr15905918ote.231.1485279937299; Tue, 24 Jan 2017 09:45:37 -0800 (PST) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id w84sm10736088oiw.21.2017.01.24.09.45.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 09:45:36 -0800 (PST) From: Rob Herring To: David Gibson Cc: devicetree@vger.kernel.org, devicetree-compiler@vger.kernel.org Subject: [PATCH 2/5] checks: Add Warning for stricter node name character checking Date: Tue, 24 Jan 2017 11:45:31 -0600 Message-Id: <20170124174534.3865-3-robh@kernel.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170124174534.3865-1-robh@kernel.org> References: <20170124174534.3865-1-robh@kernel.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org While '#', '?', '.', '+', '*', and '_' are considered valid characters, their use is discouraged in recommended practices. Testing this found a few cases of '.'. The majority of the warnings were all from underscores. Signed-off-by: Rob Herring --- checks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.10.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/checks.c b/checks.c index a0d4a9d968d7..0c78d69316bc 100644 --- a/checks.c +++ b/checks.c @@ -252,6 +252,17 @@ static void check_node_name_chars(struct check *c, struct dt_info *dti, } ERROR(node_name_chars, check_node_name_chars, PROPNODECHARS "@"); +static void check_node_name_chars_strict(struct check *c, struct dt_info *dti, + struct node *node) +{ + int n = strspn(node->name, c->data); + + if (n < node->basenamelen) + FAIL(c, "Character '%c' not recommended in node %s", + node->name[n], node->fullpath); +} +WARNING(node_name_chars_strict, check_node_name_chars_strict, PROPNODECHARSSTRICT); + static void check_node_name_format(struct check *c, struct dt_info *dti, struct node *node) { @@ -737,6 +748,7 @@ static struct check *check_table[] = { &device_type_is_string, &model_is_string, &status_is_string, &property_name_chars_strict, + &node_name_chars_strict, &addr_size_cells, ®_format, &ranges_format,