Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp301052ybz; Fri, 24 Apr 2020 00:13:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7AA5RY7t/IjTlBiaU43Eem89u494cldxJGVgkUrbqYz+vydyI5bNehNz0zXVZY/EbvDih X-Received: by 2002:a17:906:4cd2:: with SMTP id q18mr6056710ejt.70.1587712411321; Fri, 24 Apr 2020 00:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587712411; cv=none; d=google.com; s=arc-20160816; b=SGIj8U0o6RkRSvzCMPgyP18uJf/bpJO7ASFXcaJ7hMli2Vk/Yu9OTXnPH8w2Re+dbJ TeScfsaAUs7HmCFAvYToSMBbzRbXMth4RCUyfueTpSUEWpsGyJBnSSq/Rlcu2klEg6Ht grqw81ie2CIEbCaWqt1R2wq58jhZra0DtiQy8D67wTX1Qg90a/eVC4hNGWwngUSMvhZS OodrDyE3kjFRHqd7tVdh+qtvAw2O5vPXYplRgoH8huzdkJg9lRNIOwo4Asu7A+YQ64bS 1l5Q5GPWWl29VvCgPujApGRuu8rwQ5BoAAGmB/tv32KDRmD0lIcWfAaHMYS/XD5OYjLb DgXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Lj7aW35DO+M7We9UOI+vkxS0Q1SHiDXk8hCy7w5jTmE=; b=E3xnbXiS/1b/RJthppG758HN9SfZ8frYztpxT8esSiPqqTcXU5V6kmacaBK54UFyk/ o36x62Wdp2sJp+t2c90XM6WWC5ERijYP8omwubA3ScifbyADOeIorue9FSJYDr0wASog +yQ44Vm60VUGWIOOq03wI+GNE2CSzH+sMdJlsFKDRbuMgpjjirc1hBL1fSvwCpN8X/gG wFtqtwkyUR5tHtfiixLYjKhrESMs4gB8v62Nhw5Ip/nAstBSmZozdm8H7jbU+gp++iEx XbhHgA0VWivnuoeGflWOkngKL72FrTixhJq8VAA/YIkNXzCjj+CAgnr0x0MZYI0m/4Am J0Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="ccGT/Qtm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si2249788ejg.470.2020.04.24.00.13.07; Fri, 24 Apr 2020 00:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="ccGT/Qtm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbgDXHKl (ORCPT + 99 others); Fri, 24 Apr 2020 03:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbgDXHKl (ORCPT ); Fri, 24 Apr 2020 03:10:41 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50F6C09B046 for ; Fri, 24 Apr 2020 00:10:39 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id h6so4213469qvz.8 for ; Fri, 24 Apr 2020 00:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Lj7aW35DO+M7We9UOI+vkxS0Q1SHiDXk8hCy7w5jTmE=; b=ccGT/QtmDoSYhFHcVXKb9or5R6EAyfDThNXzsSHmeDZcTQKBQAmXVdW3eLiVs90rlc xUxzkGOTWXPsPLHnvszjnsmw82S4nejPZeApqeuOae8yVuMFGQ+Sve6h2W8TpaekXQIh FFTBLOmx6t49YyAFzXeAe1CYKgFL6o9NBASHnJ2jqB8gsOIhnqDdueYadlL7RQOjyJjK LqZ9Po9TfYAsfffYMgwmhBRQl9SvQvbAJiNdTrXDD3w6UqmAEIG91vC8aLMoYdbQN/UU c6S6el/jFIZgWe0h70Gm15CMh+r80GQ2uQhmdlpR0mpNwC7JuG0VFDQbommVq3FQFf57 AatA== 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:content-transfer-encoding; bh=Lj7aW35DO+M7We9UOI+vkxS0Q1SHiDXk8hCy7w5jTmE=; b=e72NaEp9yjpFY9k5z9xTPLuRyv/yj7JEDLZgeK/3TwEjeeI5b2ttJmXoO57jnNT185 nL3QOzl66vdkYgN/E3DVCbj7ScIlzG1lh+aB/rLzIf9nl2N5qbHIbcmi77BDmv+l0Psa JOc/GnO0ddKhJugIgPSWX3xuHVxhWL0GPTk2L6Dxt8NWbDSqn/97URlk2d/q89dmyq3z IvcOvy5igHq2+gn2+xphh1df641e9KVRLhgIV5zxeP7WqSzhOy4p+G+06fMQ7ljEkWSE 4cJhzrUcSOuHR420ZfTNvLYP838Kfr5Mwhqwz37X9cSVr1gD5mC1urnnhkr7vrUnGRTY Q7UQ== X-Gm-Message-State: AGi0Pua2e/2rggK4OfLRqk+F2AB1xh9/nBRk7/M7mV7UixooKHmeEYDA yvHrt/D/yWsRTwVTqTTmivOJFMM9szYOxJt6uq9itfAx X-Received: by 2002:a0c:d7c8:: with SMTP id g8mr7809466qvj.148.1587712239009; Fri, 24 Apr 2020 00:10:39 -0700 (PDT) MIME-Version: 1.0 References: <20200423203416.133274-1-swboyd@chromium.org> In-Reply-To: <20200423203416.133274-1-swboyd@chromium.org> From: Bartosz Golaszewski Date: Fri, 24 Apr 2020 09:10:28 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: devprop: Warn if gpio-line-names is too long To: Stephen Boyd Cc: Linus Walleij , LKML , linux-gpio , Alexandru M Stan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 23 kwi 2020 o 22:34 Stephen Boyd napisa=C5=82(a= ): > > Some DT authors (including myself) have messed up the length of > gpio-line-names and made it longer than it should be. Add a warning here > so that developers can figure out that they've messed up their DT and > should fix it. > > Cc: Alexandru M Stan > Signed-off-by: Stephen Boyd > --- > drivers/gpio/gpiolib-devprop.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib-devprop.c b/drivers/gpio/gpiolib-devpro= p.c > index 53781b253986..26741032fa9e 100644 > --- a/drivers/gpio/gpiolib-devprop.c > +++ b/drivers/gpio/gpiolib-devprop.c > @@ -37,8 +37,11 @@ void devprop_gpiochip_set_names(struct gpio_chip *chip= , > if (count < 0) > return; > > - if (count > gdev->ngpio) > + if (count > gdev->ngpio) { > + dev_warn(&gdev->dev, "gpio-line-names is length %d but sh= ould be at most length %d", > + count, gdev->ngpio); > count =3D gdev->ngpio; > + } > > names =3D kcalloc(count, sizeof(*names), GFP_KERNEL); > if (!names) > -- > Sent by a computer, using git, on the internet > Patch applied, thanks! Bart