From patchwork Wed Jun 5 18:02:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vEJQBc3f; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=2DWnL00H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb0j1rJGz20KL for ; Thu, 6 Jun 2024 04:03:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: Mime-Version:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5+SqiQq1JmU55Qqsf59HJfoC1FZkggQ6xe04cJ/1XYM=; b=vEJ QBc3f2vKkqjd/PHHk9RRS4Oh+ZCZJmfjtWLh10tBPTvm6cb+4IpynZTzjHAkbK/USfYF1JbanTpyt 6P3PhMP1G7qwrxkPCxssuUNXq34MvaY+l03OerbkJWVLP6v1OFu9PKleCQd2QxMzYR7Wb9mXQHDUk TF7gH4Nhj98SdhU88ClCvzO+TN3CYDIGwB7E0YEfm0xTgCLVknNHS3nw2pN1sbarBiOpTJwfsPJ8g 5p4srL0VkmDSCw+94zq+nKFykLaeChqU6dNXfVdghLH013cbhdN0ga+04V8fscEpzMI/jlLj0kOMR 6Q+6aOZePUmmoDfNaQHOgB4BA2HDHvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyJ-000000074Vj-14D6; Wed, 05 Jun 2024 18:02:51 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyF-000000074TM-45Eg for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:02:49 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-627f43bec13so708287b3.0 for ; Wed, 05 Jun 2024 11:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610564; x=1718215364; darn=lists.infradead.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=y5YxZkBMx7xM0lBc97o2/iv7RwAsHr+ZFIuj4hushzk=; b=2DWnL00H9LXKeklLar1PcxZ2u0vpYz3P4MbVLjma0TJEIMD9qWQNK5eGDqWFPM2P4k 6fv2LI0pK1EPH/m1+q8ic6riVdoXIHi7LENLW8g8NKz3vyskowYfUATtQe3VclNjz0np tiIV6o3qlYC1MJz0jfXyXuVTjhiF+QRQzC4TDo0CTDY8O7b7JjGVyDXcAaVlDpYALyT1 /baZZpqk4dlkXWJ6NveUFMn/zDFer7re2jJXZl9eRh7RoOcty7H+T7HTVKiiiIWJfEot mSbS8p7wAKeH2CjPmhjJI4RF+S/9VLQpFolJRRsyUqTztEhBPe0JHpoC0+XAVIIhcz5N io0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610564; x=1718215364; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y5YxZkBMx7xM0lBc97o2/iv7RwAsHr+ZFIuj4hushzk=; b=FU7xh3Di4EGyV4srgK0jNFAB36MfHpo73Ay8T9SVeWa6vVCB/FnuamAdov2hqMbgSO Eug8zihqXiEiDo1wOGeA+p5FjhXkItjFi6o1JvUuj3oMkp/maZ2HRqDCu0L/BTVnipqk q/UdMO48JUODB94EKnXjtM2R0xDK/Dg4YhqOfutuAjSDL0n/gCUeHwzmJqKY+f82Gnqn smzjNrfltD8fVP6N1v8YZMOyEtSszMyASCQRdmpwJFn88qua59W3FxdhCjYklLioMouR 2lgz3f/iB7tIaA5GHv44e6hVjeZy+7OKP5RW5mfYGEO5oO0GuVPIMj+GcmjwotxW8TIE zUTQ== X-Forwarded-Encrypted: i=1; AJvYcCXQYC5nRXhDZVx1ePKWuGlbPz8ijSuOjkOqiSqRVwtC1jMngB31wuN+kx/Tk5gC7lh2xFWsepJNaBGcgxmu6doVY1DOtCLSv2oDff43MA== X-Gm-Message-State: AOJu0YzcoNO1oEmcf53wt3GXoDpFW62p8WCDhAKRqfvf5TCKNWmATKwN 8kd/oaG0C5UYmTW9l6K5WU46oWh5845rwFsp/CtM3Sste8W9p7+GH0QgZzEnP8EFPPsbCkNvPs8 t0EeUm6Re7A== X-Google-Smtp-Source: AGHT+IGCU+GmK3Rf3XT5eiVn8GBJTqffr6kRhdYR5C7W1ubGEWJe6ysf+n1fV0SHLE+oXrcbvgWtj6KwbrbfFQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:884:b0:61d:3304:c25e with SMTP id 00721157ae682-62cbb5b3bc3mr8573737b3.7.1717610564108; Wed, 05 Jun 2024 11:02:44 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:31 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-1-joychakr@google.com> Subject: [PATCH v1 10/17] mtd: core: Change nvmem reg_read/write return type From: Joy Chakraborty To: Srinivas Kandagatla , Greg Kroah-Hartman , AngeloGioacchino Del Regno , Lars-Peter Clausen , Sakari Ailus , Bingbu Cao , Zhihao Cheng , Jerome Brunet , Martin Blumenstingl Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-media@vger.kernel.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, manugautam@google.com, Joy Chakraborty , kernel test robot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110248_032693_63531418 X-CRM114-Status: GOOD ( 10.48 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Signed-off-by: Joy Chakraborty --- drivers/mtd/m [...] Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Signed-off-by: Joy Chakraborty --- drivers/mtd/mtdcore.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 724f917f91ba..b13752ec2f1c 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -530,8 +530,8 @@ int mtd_pairing_groups(struct mtd_info *mtd) } EXPORT_SYMBOL_GPL(mtd_pairing_groups); -static int mtd_nvmem_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -541,7 +541,7 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset, if (err && err != -EUCLEAN) return err; - return retlen == bytes ? 0 : -EIO; + return retlen; } static int mtd_nvmem_add(struct mtd_info *mtd) @@ -919,8 +919,8 @@ static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd, return nvmem; } -static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -930,11 +930,11 @@ static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, if (ret) return ret; - return retlen == bytes ? 0 : -EIO; + return retlen; } -static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -944,7 +944,7 @@ static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, if (ret) return ret; - return retlen == bytes ? 0 : -EIO; + return retlen; } static int mtd_otp_nvmem_add(struct mtd_info *mtd)