Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp472162lqr; Wed, 5 Jun 2024 11:08:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgih/02OWR3TDyv9wW2y1UHkJ0JSb0W5XL9q+UX7OqlM7B6NNgTG8GX2AhL8Mq0FQPsnH89AiVDsjZiQBG3MY6iCiG6EHTIv5y0zULvg== X-Google-Smtp-Source: AGHT+IHbmZpZIqUsh/YUE7GDi4K+EOW2Xcs8P2N0w5ByRCvm+qz667QDJFDHXBwOIJjeMnzfA/Wx X-Received: by 2002:a17:902:dad2:b0:1f4:a45b:8429 with SMTP id d9443c01a7336-1f6a5a0ed99mr38985885ad.27.1717610914050; Wed, 05 Jun 2024 11:08:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610914; cv=pass; d=google.com; s=arc-20160816; b=tvj4cS59wfiRdYzpqna+1YmnfbHnkMHSx70Z15A5sTCD626romucKvYVnwULPND27Q O6b81WhIJgpf6t9SWkE4jCpLQ8XsxrhdTL8INCoyvzAk+T/aK4uwjf99/2FrO8/voYs5 xRm4z1hlwloxACIlHVysqrOxcQd+yHB2foathNT7hlLnKoHasalEd1g/xkuSd2+ZTR5q hIAwfN+ZYt97UmpCNzseJGDJIo0JVEBowbZXkIuGzYYDHF8iIk47G20v2qcv59dhPV0i jSSjiFKmvxaAxqda2TrDfc/xLIZK35bnz9dI0aQa7ED1eQxLBrvI5JKcSMJirM+EfTdX 0ltw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=y5YxZkBMx7xM0lBc97o2/iv7RwAsHr+ZFIuj4hushzk=; fh=7XjQeeApYA+u/hkSGb3/gn7dvCgvpC3tbGQtEm0X54U=; b=Ta5k92cXOWPCfjo+GWUqGAOPREnShb6gUXfc1zEq1IGUkT75XVww4h+magrcgjZg6L wzfEs+CRZN+mh8YPhhfT7XJVVFXA3iPjAelazDVfAeSXz+ES8WSLooPxzwSTnt0UeNg8 I3IJ3dhvlqk0xGKtLeiD6eC/ko7WEpPw1W2G0Ym5eSeki+T69PKRVSKgEZNMcuobQ0Po q4PO9nqcry/lH10atQD6fzOcFv1Y6/ECf1I7YgTWpbwi/wfeGdKEnrH7XhvwcA6b+dj0 v3vmgy2nYwdmOOJsVNKOrJkbLvzVrUIZMbHPLk/WF+RfX1PcmWqlUx047nCMGbupIwkc ejBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bosRmD0V; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203017-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f632402f8esi35565165ad.489.2024.06.05.11.08.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203017-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bosRmD0V; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203017-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C2FA287306 for ; Wed, 5 Jun 2024 18:05:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B38F7144D02; Wed, 5 Jun 2024 18:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bosRmD0V" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AC5B14431B for ; Wed, 5 Jun 2024 18:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610566; cv=none; b=lWiHoFZHYI0bz7A9f0IWMbEIsSGR8KoIOYwFytLbx0dMTZ/j0coIh8P0qN6TDvXlzhW16cmOdFTtDfnr1PHn1uLIlc1jB8Tlk0ltOJPs2uzSqfxObDdcWNLn9qLc8YJhrCn4ccgUVgxV9AtRHo3xzqSu15hN+0iTOWdoQKfIQfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610566; c=relaxed/simple; bh=eF30gjQEDuHJ/IYGm6d82rKPYlogi0y1Le1+CTBv8es=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=qhCs5vzand8k//vsUV316OCCgLE3lgHN3tC0d3PRIJFqjE0rYgrwY7tzUbtRSqm9mo3tBbfR5yC4Q9GLsIRDrbSqwjttdgmA64VYrvAPUy6P2Ajnthe0QgQfW8G0M9EMCYXpgHdOejoHs5ztxbAfKy8UQQaJMzvtlBda959Jcro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bosRmD0V; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-627f43bec13so708277b3.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=vger.kernel.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=bosRmD0VAZb+uNeHi7HIWEvwXg4aQpu6UokJkBAlLIP/mwUBkraTcuWQxK3I7oKf92 IUqNEgKeAor+QlQfrxVSX46Wr8qSmnre7Lod1wkkTeP1WiYmtzlXHsm6O3NcweNaf3ya Qandj21eqkSssUvIpP1j/ByVvuTqh/97jqaJeYq3PTsSsF6edkETmP9wm72ftlMYpBuP miYX+L6h9T7WRJYqPenCfll5CtFtSZIBP1XQjvu5Eg6N2CYzUGIsxekAXrrCObtum9/3 0mZb0apPgAHlNJwLvOjE2WR6cA9sNf2aU7/wo0Eq6mAi9yMTDLfZS5nu4m+yBkRZ20EB ZVAA== 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=GL35/ZeA32uSHpSoDdrlGq85pw+x9FIE5gyIKSW7n4RYTK63sJzPRRBsR3xqMBVuX1 hBXi10isRebO+30XPxW0ok7unped4EXckozUCvpl9UoEqCKC2mE2scBEPNnICbChm9Gf hRJuGfYno3NJbEOIhhAh/N5dnDpbDrGHjK/YD2pW6sVZ1AGW+mcEtg1ygyOa1iz/0AIB EIQRZ/nLGu5KM3euL5KBP7sVczPsUrL6gGJTUoTdvpeEaqXxP/rz9BL4Avj8Cx8lqfz0 GtzQqB1/gkhTkEKVmoo7FP9DM5WNBcnBMxdtdc0MggNLEdjuUR2QzPZNmG9ua5QMufBO FHbQ== X-Forwarded-Encrypted: i=1; AJvYcCUhzQyimB0YVN7mrAHeDt1pn7qt8CNKiSyQGgkAUyayr3oqU/RNi4GjEIeTHycOYYdWpwkBjkmbV4ey9gjSO2oMS86R01j+S1mZCDvS X-Gm-Message-State: AOJu0Yyh0vzY0LPeY5Hwzn7FsG9jHbhzyIHyhFuSvIpjGn6RVktYTWST CTOi6D03c2mAW5e7pmETergNcCT/qgHYf2EnquUxTCxxGZfuX6L59CtknTuWq1VVvQc7jMeisUh YgJiaIVda2A== 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Type: text/plain; charset="UTF-8" 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) -- 2.45.1.467.gbab1589fc0-goog