From patchwork Fri Feb 10 16:47:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 93795 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp590437qgi; Fri, 10 Feb 2017 08:48:10 -0800 (PST) X-Received: by 10.99.117.8 with SMTP id q8mr11962033pgc.9.1486745290593; Fri, 10 Feb 2017 08:48:10 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si2151760pfg.86.2017.02.10.08.48.10; Fri, 10 Feb 2017 08:48:10 -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 S1753498AbdBJQsJ (ORCPT + 7 others); Fri, 10 Feb 2017 11:48:09 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:36762 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751690AbdBJQsE (ORCPT ); Fri, 10 Feb 2017 11:48:04 -0500 Received: by mail-ot0-f193.google.com with SMTP id 36so4377904otx.3; Fri, 10 Feb 2017 08:47:21 -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=K3oKxQApiytzOWRZuV7wWHXHMeMGbqm0gfRcjZn/6YA=; b=n/v62Xs4L2iuLIMRkHr7e9pViv8JpN6cFB1zYgZ8gS64jwqt7ESEPP0CAEfyVgxzEx KKpq9kHTc4EPWPAqAPHK8i9IEWhud+NzW6CUS3LfY4lgoARN5sQCHCYj9vq5fLr9jiEV wvJf8+4Z/Bxkr90teNrCFpafuHdzsPQ0vRo7ngfhBRGL17fz+bhgMhCCsrI0Nq4drvq2 uc+Vpbuq+Dx59G6LG4c+6Uw8USGOLa2C21Ucn6r8lbvU4T5MqgrfLADr2O1P1Iyojzzv y2tOeIIFCEaEUd8YBWb1fKQUq3YZr+RLE2Mw5oT+Nk194ZZfVDgzyxBrKZIZDNtSDoDk IVUw== X-Gm-Message-State: AMke39lMD8mv+i1KC6eaPE5QUFxVL3SAON7oc4W3Ymk+vSYOGkGiwqCPyQ8hFwtwFuRVEA== X-Received: by 10.157.56.70 with SMTP id r6mr4958835otd.154.1486745241341; Fri, 10 Feb 2017 08:47:21 -0800 (PST) Received: from rob-hp-laptop.herring.priv (66-90-148-125.dyn.grandenetworks.net. [66.90.148.125]) by smtp.googlemail.com with ESMTPSA id r41sm1141714otc.40.2017.02.10.08.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2017 08:47:20 -0800 (PST) From: Rob Herring To: David Gibson Cc: devicetree@vger.kernel.org, devicetree-compiler@vger.kernel.org Subject: [PATCH v2 2/4] checks: Add Warning for stricter node name character checking Date: Fri, 10 Feb 2017 10:47:15 -0600 Message-Id: <20170210164717.1234-3-robh@kernel.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170210164717.1234-1-robh@kernel.org> References: <20170210164717.1234-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 --- v2: - Disable check by default 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 22ef4748d7be..67237ffe594e 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); +} +CHECK(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,