Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4553331ybi; Tue, 30 Jul 2019 04:07:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC4j5ewnIYa6TITTv/HmCE9rKwYNbZtsVnEGgxySouk4OouzTHjzE2hY9N31ROVA9+SRf9 X-Received: by 2002:a63:cb4f:: with SMTP id m15mr32726665pgi.100.1564484875494; Tue, 30 Jul 2019 04:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564484875; cv=none; d=google.com; s=arc-20160816; b=g6MxuSRGoQR4M0BoeRI51cpL9lz71uxx6bxxyW4ihVm3+5m+JoomVelZQ1s3a/B2X4 NlOc2gqrwl2Jf3LKQin4msSqjKiGWyzP6DsoWP1VT4PLfOMe6q5CsdTBCV9JokQDhfQA vUO3IRdroEdEWg4+yiEMoIY75Zlro5bLKz3to7mb7GJxuX7FOoU1DgZOgob2jyJXjTdh Wp3W/C2/tPFdQcNV4q1n2qBjMqOFZxbNkIVNnsTJXrgAUuN5V11W+54eHdhYMqdEEzWQ /kZ4ckFPN3lzOo8DPoyQDFhq5hzlK6hM1TivknhRNf0QQY1R8/h672DseDX9en6uu8Yo Igcw== 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=ztB3Q8DLzhhcyvyMNVMzNK6NebfDHAUbgflc/UJwuNo=; b=cBFMzsyqdczdtXtWB3RsZcIa+mBHPpSfSGhrTa4p57ZDoxxqAJ1o+wKQY/LPUrncbN +LnkWuFVH8MCiIIgvfgSPITQFKdLCXPb5ZzyjLgiWX4AoN10ZmZHFc3opmtbUPtPDcMp jUIm2Vbfbkn0KVyOW+w7QrCywrNyFKquDZGK0P2lc148vJlgdWc0Y0FWH6CDVsuh49om jNCC0Q7wY1he8qJEqLy8dXnhH9N4igV4ebkvhP1pjf24gfE8sx1rsupr/t0MZhFynfFu rt8gw7CSEFF/KrvBbUas0FJq01iBlEg22No0NSQG9CdnjS8ceMlwArGngwl2cUm9IAjz dIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pIzDyP8+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6si18282646plq.213.2019.07.30.04.07.40; Tue, 30 Jul 2019 04:07:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pIzDyP8+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730237AbfG3IUH (ORCPT + 99 others); Tue, 30 Jul 2019 04:20:07 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:38017 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbfG3IUH (ORCPT ); Tue, 30 Jul 2019 04:20:07 -0400 Received: by mail-oi1-f193.google.com with SMTP id v186so47299195oie.5 for ; Tue, 30 Jul 2019 01:20:06 -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=ztB3Q8DLzhhcyvyMNVMzNK6NebfDHAUbgflc/UJwuNo=; b=pIzDyP8+aLF6N+tvz+qRREtMKOxN8h9OLXktM72vNNuq0cwNn7ePJ87Oh3Bp7mcvK5 e0LVy1Y/VpmFkZoEcUcJHJtqQO9N9lnl5L4JDyncWSS4z5CiFZK6u4oqT0gdUZenQlGs 0U0QsWw6vyHM+mxKVCmcZQ5jiqWlSUvxoqz5Xmd9W/7hBJkZrjKZ+vBYH7ZpCisvDvBA KJ0pQ6DJ16a+ycW5MmGcFgEuVG2/HJM4tvyM1tGZljdhT5nA1nzYaJqpGSrzuLYEExWd Q53RlmbAlThY5R90DRzNBnbQEOFmcf4U6+zE/1fhY+kHnP/g+RAgRtugKnIEDfKYCJYW T7gw== 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=ztB3Q8DLzhhcyvyMNVMzNK6NebfDHAUbgflc/UJwuNo=; b=eGZ0o3amd1LG7v8mS3te7dxoV9Rer7W5BhikDYc5GW9npoYatWn/S3AYQ04xK5hnDH BMgbK3G1rWyIsq5j2NzklQDPEJkTpmOMIfjbH5lmLh61TMRKYvCvWVXjqUxx6nUoI/v5 FMJ3oXsfHSYgoCiOZ0Rq3Od8ZnEgGopazNbca0IQAO6Fj7KG5/uv0cuDGR2K0IPprFqm lx87omwzM/+3Sg/BDn7KfCdJMG1BJwg/WqwXlOarLPBiWpE0DEPUAKdFEw6CyBJO8SF2 gdXbxtVxX3TlCLlsmYpzBbJ+aUNG1+n/KVV4/4WHw1h3yR18vmh0VUt0rKKbw9lWjYdQ tVXA== X-Gm-Message-State: APjAAAWKC6/646wp7ELDseiWYoZ8ON3hgddheXgcRsfO0pz5BmzKxBK8 edo3E+Ul05xefpGzjeyYIyzDoHD5yGvq3Ak41dhDeoAB X-Received: by 2002:aca:450:: with SMTP id 77mr21728053oie.114.1564474806601; Tue, 30 Jul 2019 01:20:06 -0700 (PDT) MIME-Version: 1.0 References: <1564410993-22101-1-git-send-email-info@metux.net> In-Reply-To: <1564410993-22101-1-git-send-email-info@metux.net> From: Bartosz Golaszewski Date: Tue, 30 Jul 2019 10:19:55 +0200 Message-ID: Subject: Re: [PATCH] gpio: just plain warning when nonexisting gpio requested To: "Enrico Weigelt, metux IT consult" Cc: LKML , Linus Walleij , linux-gpio 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 pon., 29 lip 2019 o 16:41 Enrico Weigelt, metux IT consult napisa=C5=82(a): > > From: Enrico Weigelt > > When trying to export an nonexisting gpio ID, the kernel prints > outs a big warning w/ stacktrace, sounding like a huge problem. > In fact it's a pretty normal situation, like file or device not > found. > > So, just print a more relaxed warning instead. > > Signed-off-by: Enrico Weigelt > --- > drivers/gpio/gpiolib.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 3ee99d0..06eeedd 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1,4 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > + > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + While adding pr_fmt would make sense for gpiolib in general, it changes all the already existing pr_* log messages in gpiolib.c. This has nothing to do with this patch. Please use a regular pr_warn() and then we can think about simplifying the messages in general. Bart > #include > #include > #include > @@ -121,7 +124,7 @@ struct gpio_desc *gpio_to_desc(unsigned gpio) > spin_unlock_irqrestore(&gpio_lock, flags); > > if (!gpio_is_valid(gpio)) > - WARN(1, "invalid GPIO %d\n", gpio); > + pr_warn("invalid GPIO %d\n", gpio); > > return NULL; > } > -- > 1.9.1 >