Message ID | 20240212170423.2860895-5-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-62045-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp167822dyb; Mon, 12 Feb 2024 13:06:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVTGqU7evLz6UAvbe3S86DnuSPgfX2PSJjpRGL1IvelQuqo1N9yvk+NeLNkicv2S1AV3JSa3RVUXcEIEJU5z4Flz9rZQw== X-Google-Smtp-Source: AGHT+IHEkPjsDis7OFWBeyN8sIIf53e1Ln9umDHHk+VPDE6Ew9oOL+C8d19QJrfuXU+XG+AdAVZS X-Received: by 2002:a17:906:6bc9:b0:a38:41e8:14eb with SMTP id t9-20020a1709066bc900b00a3841e814ebmr6075362ejs.26.1707771981598; Mon, 12 Feb 2024 13:06:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707771981; cv=pass; d=google.com; s=arc-20160816; b=kMyK+qgQzWpJdKpJ+Urar/nV1gZS5Q44hR4jrG1MflIjiPhaI8z0TKe7KV13ZGMf0F DER6CP+dqST6KZNabxG2MdQufjFdOlnRl4d60JOvwhZo2JlmJv00QLw+g7ajKpoeq/m6 CngxN/vDIhXtp8y4FlvG9sbwI6k2CNy/Zz960jfD7tq/mcAbUuo7oYyXr0IfRUudAi7B fgt5RdH7EFDTKv/QJyBwOPl0Kk14U/zqqOzD/C8oxClKxYzD7zyF/+jiCyobjV5gtPjY eQk5ayQp2vCZSQLmuSbD8U7OwO4hhurNMa+0d/LnJ7OJ4+NxryR1i8x3sSXahRUsAynH zmOg== 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=94b+v8XysJRMfZB5dwHYGqq0/1Q3jnD+TabhPwEZtw0=; fh=kKVcQcD9pvly8P9Wtn0IXnh820Eip29CjF5uMfvN+F8=; b=COmQCCho5gw3Tp1ggRrcgn0g/LqcnOfKFZq4JuHzjiz8QhhCPRssgGiXE+G6HAYmYy F+FCZMIKT/OGI8MWegbecewIqdfRNMc9yMkZEl9H0rQSNfQeAwi7WXrClKLcjHsiAbJF qU1zP1CuJkr1Owy0V/2eqOAgR4m4V0LkjMGpVEvKQvLd+gP1sI/bsB5Dh5EGbwp5Ev4Q NhV2UW2hXF43OjOnwxVrs6sKu5K76fYJ/gyDQEGOyd/53Wi6u2cmvaQi0Q2jY1TMXAjV 7sz9AE22KhAETGGZ353hnTsiQGgLiR750VHHJACbJIg0JHIi5f1042ihBYeObIuQ8fal JhMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eTZdTodF; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-62045-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62045-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWj/AuedRWrha8y1owBAaiIv4oP1yQzVxoxKEvp4JMACyvYSGXq5BhkSaB3Lxk6XVHSjKK3EWytLdg8P/W64ayPKiagiQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h25-20020a170906719900b00a3869d03d13si515905ejk.610.2024.02.12.13.06.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 13:06:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62045-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=eTZdTodF; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-62045-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62045-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 797F51F28695 for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 17:08:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36544481A5; Mon, 12 Feb 2024 17:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eTZdTodF" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 552C83FE2B; Mon, 12 Feb 2024 17:04:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707757492; cv=none; b=RXFvdjon08wvdcmCjKlG4ZcdGuR63rs74Jcivm8P0q2gFVhb6xIb2WJ2y2L8enFYdtbRtN2agmYy5SpnRS+PmD86qfUdu0+XA+gr0Rs7dkcq09+WH0JWmpZIIcETLCRiPnnzC0QYvdJPNA6GJr/UXqaocSwUXhrED82nxb2uQbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707757492; c=relaxed/simple; bh=2toHElackSZZyXwXNBaTI+oFom4ViAe7S5c8+PQ2aGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XC5Lp2SnyMqAmVACPOWafl+8lDQwZczWk9kD9mH0nDd3ZAoDoAOZTAco+f74XJRe4aVQpEqoFCWrLs10xud/Bhk/9GFgRlsPAKx10iOt4zUoJTUM7jkEVKOUP35wjxOlvnz5n+7Fg5viZMXwyxOnFGvUyCANZ4RhRL7RmG4+2cY= 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=eTZdTodF; arc=none smtp.client-ip=198.175.65.10 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=1707757491; x=1739293491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2toHElackSZZyXwXNBaTI+oFom4ViAe7S5c8+PQ2aGc=; b=eTZdTodFSzzrKE3Dyd7YeTDByOHRyfJETBTUSYKLuwXoHslyTZpdaMjC cZozG2DjeYxWceIDlYUXx35BHDY3X1cavzsa0wA9iCSbjkVacZCM11Fkg vSkUgJUmE7Imv+9ZWT/Zq902wVtzU2vLRyhl7xFnkGsrxakNhRy3esAKJ /dOXu0+/7Kpl83WCrdLbXTBtBUuPsSPW6WC/GOSuu11G5x9JyAOKpObh6 aL4Pv/Nw2u+hD/1FdkQLR7+VryVKcpRb0y2hRqdm058d5T17lFsgRoUSN xQI2rE9wmSVSsDWzlbcithvfTDnLEDGw4+9nwciuOkgmBzPgPT1XNgioW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="19153181" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="19153181" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 09:04:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935116810" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="935116810" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 12 Feb 2024 09:04:43 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AF1E911D; Mon, 12 Feb 2024 19:04:42 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko <andy@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Robin van der Gracht <robin@protonic.nl>, Paul Burton <paulburton@kernel.org> Subject: [PATCH v2 04/15] auxdisplay: linedisp: Unshadow error codes in ->store() Date: Mon, 12 Feb 2024 19:01:37 +0200 Message-ID: <20240212170423.2860895-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240212170423.2860895-1-andriy.shevchenko@linux.intel.com> References: <20240212170423.2860895-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790728713092879724 X-GMAIL-MSGID: 1790728713092879724 |
Series |
auxdisplay: linedisp: Clean up and add new driver
|
|
Commit Message
Andy Shevchenko
Feb. 12, 2024, 5:01 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
drivers/auxdisplay/line-display.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Comments
On Mon, Feb 12, 2024 at 6:04 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > 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 <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68korg In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index c4dbb13293d1..8d91c2099661 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -12,6 +12,7 @@ #include <linux/device.h> #include <linux/idr.h> +#include <linux/kstrtox.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/string.h> @@ -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 err; - if (kstrtouint(buf, 10, &ms) != 0) - return -EINVAL; + err = kstrtouint(buf, 10, &ms); + if (err) + return err; linedisp->scroll_rate = msecs_to_jiffies(ms); if (linedisp->message && linedisp->message_len > linedisp->num_chars) {