Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7748134ybc; Fri, 29 Nov 2019 00:21:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxQYjhSzAondyFQu0p0GlBjC8pMcaHPgbB1jNZLwQoMXzoMUhGP/hC7F8TVdafCVhunfUwD X-Received: by 2002:aa7:c595:: with SMTP id g21mr192489edq.143.1575015696151; Fri, 29 Nov 2019 00:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575015696; cv=none; d=google.com; s=arc-20160816; b=Kei+7gKl7sU9iJZEuuSB8VOahgh/cgJI3/sdGGJ9VjUus0hafEd5zHTh3HjQ8YkFN0 Le3cD/dc60t/JSkXZg1igKcGgMywmzcv2b9Epg7ZCM5CiIjv4TNwEBhrBQ/as7RJVfoW ELOiqDocJGT+qlWgiGPDndYayte7zuxLwnCEUDCer3EeC/J8synFLbdcUVq9qYH+yPiG AmucB2++wyXglSw+dZWkdc2Ripoap0t/aJnvt1zfB+RmP3UyIkEJFMpbD5jE3MDbVr0A W9dOp+lXVxiqkKx7+MAkrj2/KLANLjvxWseWOmw9/MKkVum+ma6VYHyOzRsk88U+0FZ4 jsnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gv5zzVxLlG8GDkPCvOw5BxFln15GQXxmdxcqIDkEcJA=; b=Zo3JBiaERTxLY53tJUC0Bk6geHsKsz4KV/mmo/WeKGUF7VYxuw+rYmu+6xZiS4GkIx VhAs6s8dQySyqIvdd4bdT6z7SuISZHDAq2Df64y9myu9PekV0ZM4DIuuUbuJOUEnqZD6 erWlhZpx/b1oG96g9viaVlEQaSCjspfK6wxEwaRHiSmqmdv6G5dgw5ei8NJsAmbFhCMU qoRMpQmbGSYqjUB34I/7GI8jq2le5R/vIbQCEWoRu3pdWVuJc0lpvfMtYXUcNYPbdyvF PKVOF62fYYamGLEt+esArrATysYHmIZmQqrDZeYJEVx8Id6FT51gH4ELoTNYernF6Gqt yJ0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Hr+/H5eK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si13749896ejv.424.2019.11.29.00.21.12; Fri, 29 Nov 2019 00:21:36 -0800 (PST) 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=@linaro.org header.s=google header.b="Hr+/H5eK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbfK2IT7 (ORCPT + 99 others); Fri, 29 Nov 2019 03:19:59 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44927 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfK2IT7 (ORCPT ); Fri, 29 Nov 2019 03:19:59 -0500 Received: by mail-lj1-f194.google.com with SMTP id c19so4002983lji.11 for ; Fri, 29 Nov 2019 00:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gv5zzVxLlG8GDkPCvOw5BxFln15GQXxmdxcqIDkEcJA=; b=Hr+/H5eKSVxdaZL3TW+Cs4R15WVDNCGrQGDFkhiDTMqROh8mUQoHjF6OagTz8SKZ2Y hVozHvElVuWcFXlImw1kjxdoIM3a56iaME/n009GOhpL3UF8LzvK/CWO4+aw8aoGGffm t1+2IXz8AWYE9xR1zAOCxRm+1RuuKkEb71E8FpJkKxelKDWndMI+YerN1FVRPzxuV4Bf P0tBe/FyrdTvsis01b/fGSwpjonrjHHp9ZtXKEeg0RLtdAnYiv87woprBHX1CxWB+KZa gzoAoLfO8v5zY9FUsOCErJULWnfzvEmOySo5aBDwMg46933Vka+OqM+hiNBVWS2PpAw8 AIBw== 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; bh=gv5zzVxLlG8GDkPCvOw5BxFln15GQXxmdxcqIDkEcJA=; b=ji0FFJrvb2rVh8uV1JH0NVIkO1rZK1/XiJewsAWu4GVcQuioMWPAOeD6AYJ+c50/5q ZHXFaUZytWmzQdAD5WKkOAqgpyDVybtpbTsRqQpX6kVIoS/wNx6AaJRz7Tr52sM1ecIE gOZJqP1iQQllkcheRQamclJg3G79XZeB0/qetTda2+cmdbxUHeiwFnjIpABGxO2cf4DF GbMZ/1ynQPlB7d8Q0u8cKRRg5dr2e0WRZR9kH2pwWWBVLfsgJCkMDfBSBPvn00VUbw9T EbeaNMbAu+lv23fnMZbjjFzJaz66d83L1tJ4m0SZZaVVzc3Qwbh+MzjrUMt0PoSGL7eo xXGQ== X-Gm-Message-State: APjAAAV7NfU9NpyQMwIi6tU8RDMt8Sh14BQQ9h6hPyJn3dkhibxsuM+X gwXQ19jCQdSSGdGjX3ABBDTkPe1g8dhCDr46ceV+3A== X-Received: by 2002:a2e:b4f6:: with SMTP id s22mr24453253ljm.218.1575015597194; Fri, 29 Nov 2019 00:19:57 -0800 (PST) MIME-Version: 1.0 References: <20191127095919.4214-1-geert+renesas@glider.be> In-Reply-To: <20191127095919.4214-1-geert+renesas@glider.be> From: Linus Walleij Date: Fri, 29 Nov 2019 09:19:45 +0100 Message-ID: Subject: Re: [PATCH] gpiolib: Fix error message on out-of-range GPIO in lookup table To: Geert Uytterhoeven Cc: Bartosz Golaszewski , Alexandre Courbot , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 10:59 AM Geert Uytterhoeven wrote: > When a GPIO offset in a lookup table is out-of-range, the printed error > message (1) does not include the actual out-of-range value, and (2) > contains an off-by-one error in the upper bound. > > Avoid user confusion by also printing the actual GPIO offset, and > correcting the upper bound of the range. > While at it, use "%u" for unsigned int. > > Sample impact: > > -requested GPIO 0 is out of range [0..32] for chip e6052000.gpio > +requested GPIO 0 (45) is out of range [0..31] for chip e6052000.gpio > > Fixes: 2a3cf6a3599e9015 ("gpiolib: return -ENOENT if no GPIO mapping exists") > Signed-off-by: Geert Uytterhoeven Patch applied for fixes! Thanks! Linus Walleij