From patchwork Thu Feb 8 16:58:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 198629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp499016dyd; Thu, 8 Feb 2024 14:51:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCJGW7M08wu6kn62xYwhDvtPqOEGD2A37OCRYlO0E13FaS7tDSBQm1RkcBCCeWCw4j8oIZi0X1XRbbspx+OpqqZ4J1Sg== X-Google-Smtp-Source: AGHT+IERa0jPQbXeHhq+s7X8jqqXduQtLBcgnBbNLknhR2FQ1eggIaLj7LY/poEVntBKvwirIH51 X-Received: by 2002:a17:907:1050:b0:a37:7057:5b3c with SMTP id oy16-20020a170907105000b00a3770575b3cmr398699ejb.50.1707432697307; Thu, 08 Feb 2024 14:51:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707432697; cv=pass; d=google.com; s=arc-20160816; b=WXQiEKz/If4JKVR7sxHN7m2wImycMz1ajRtYTE416G0g50pgOz1BP29oK69CRFNS1F yicDvreHAxnfgC06AflW3u/mgexGvHZ8Z2ta9Qlsie+G/EXMZhtLw+DUP/g/8e+c83Mr OcSP/e1+SxdwaajgyVfQsqqBdX34VPR1uNhRrU4yVZTCBzv3t+RdKU1CHgB9vRHpKi35 3nnmlMQ3Ae7ZLPe78pyg9PRGyed9X3xEkB5Yw+wISMxW0KtkKzTFaTFugJlTX83lwBN5 F/Vnj949ftzls+ECfuIT3fX8TC8MyZJCvCXEhxjOLq2CpN+Z/+7HyCl5+lUH/CIbkvmY ewSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YXvq4nsTthWnNOvah4CH5HkIfAdpdthoxHgoZBMOdlg=; fh=pHjJH7/WyotkhuhdtWmxTBMf3OyNQwdxpgrAQSzamS0=; b=iA9Cq1/BkjrEYgp8wxLkXNLPVB7qbmeq0a92YqUuA1Jfk3R0rBKZfl/Pq/83kSAoZz wOQT+waeuhKQmczmIxV02/4jL27acubPZMz52SfMhK+KzUbY9ZKfaM+k3eFs4j2FpIkO p5F0+cAhbM7JxkCyG58hkd1y8XTGAvu/13GIn3ZArgVEerDhuDbigAry/lQnbFrA0kqN HAIbNU6NxORzR0xxCQjGbQJH8ccIA0ItgtC/dWOVGBunILqODrXzYjhG5R0G2BqdozJL 9eDCMRvgsVXb1ZsJupmaEB2+ZVq+szsX7vrdW6/3+CUq7ItSJV2xWFu8hlWshPICUeYW lauQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UR/MFjBi"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58554-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58554-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWEfAYDxSLLluAGyyLfHngZgbyGZESwrMmpCRhb1oIYqe1iO7HF+Qf/SO9xLCnsmevPqC+yMhXtO2aJLooQ/yA40SK9oQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d9-20020a17090648c900b00a3ba3ffe968si130814ejt.915.2024.02.08.14.51.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 14:51:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58554-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="UR/MFjBi"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58554-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58554-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 76C5D1F2D385 for ; Thu, 8 Feb 2024 18:47:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C34492E633; Thu, 8 Feb 2024 18:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UR/MFjBi" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91E012562A; Thu, 8 Feb 2024 18:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707417958; cv=none; b=A5S33koOkNEhDdhV33tGykQnwNVvn5WE0bX/5DcttMtrUZffbeLwxTpfpccUw89DQYIM5aeaIcL/30Nv/dk9RVXAVZgYqk/U5pxtOess7h61W/HxDNu3jPXWCzSYRIqaBdAL5Nil/quyRHDWBXLwWF0w+n80CFX9rSpJxzyn79U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707417958; c=relaxed/simple; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mhVTXmIHPj3Tvo4hXEnhtAAJPeHoHAxCAkANgmq9xXp9gv92nwVJscXrbjDkGKPmyJ9Wau1AIrYPbAy1SK+85VEoQIDHBImrHNBo25/3PUtQkXBBGeOi1L2vNixf2kTv+aUW2e1DBtBzs8RXjTt4A7LWvCQaj38Jc7mZ/4wa1kk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UR/MFjBi; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707417957; x=1738953957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xSKeAKNBA96roisQYOcxV4QilUZU+Ks7Czd6oPoWOHU=; b=UR/MFjBiVReft1FQ0unS0YgCo3WyzG1AsdBR2ipGEozVVzBEaP7AMokA aF4MOXbDk5nSN5gTq5ZbXNELDROb9f9sEkPYj0ius5gyBhP+Jd6IETXgY d4oVA4lRZ/cDpDkOOb3L93vyTvxDK7na0rSyNiC/ezP9u4Zcim9qgJt7f 6HtJwouQYMfNKGjI4benqvhr0m3SZDJ0rL1Hq4QLl6gtvwommtS3FRWO8 CPie1DYG7GD3DYmIA6zq4MYLCHNTZU18Xh2ZLo/giAwKDNxnAI8uF3N4Z 5sVDdXuRtkH/XtwVJKoe8PaXFKMVJvIGaXHpQZw6j92ePBihfYTN5b71M w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1185260" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1185260" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 10:45:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="934214478" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="934214478" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Feb 2024 10:45:51 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 397BF142C; Thu, 8 Feb 2024 18:59:41 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Miguel Ojeda , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robin van der Gracht , Paul Burton , Geert Uytterhoeven Subject: [PATCH v1 04/15] auxdisplay: linedisp: Unshadow error codes in ->store() Date: Thu, 8 Feb 2024 18:58:47 +0200 Message-ID: <20240208165937.2221193-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240208165937.2221193-1-andriy.shevchenko@linux.intel.com> References: <20240208165937.2221193-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790372947757886720 X-GMAIL-MSGID: 1790372947757886720 kstrtox() may return different error codes. Unshadow them in the ->store() callback to give better error report. While at it, add missing kstrtox.h inclusion. Signed-off-by: Andy Shevchenko --- drivers/auxdisplay/line-display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index c4dbb13293d1..4b92ae7781f1 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -166,9 +167,11 @@ static ssize_t scroll_step_ms_store(struct device *dev, { struct linedisp *linedisp = container_of(dev, struct linedisp, dev); unsigned int ms; + int ret; - if (kstrtouint(buf, 10, &ms) != 0) - return -EINVAL; + ret = kstrtouint(buf, 10, &ms); + if (ret) + return ret; linedisp->scroll_rate = msecs_to_jiffies(ms); if (linedisp->message && linedisp->message_len > linedisp->num_chars) {