Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp268661lqt; Thu, 6 Jun 2024 03:05:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMrbwWaFLTtk+oCR973F/aCfk69loZvG4ar6XRtWILEJYYWkXYD3ucx5+AX6TKdprmBr3oRzkF38zH0eeb4SiQ2qUp9PdCqLA6JeBnmw== X-Google-Smtp-Source: AGHT+IHyFf3RMfP5S/vxWTU/b5Xi44liP6VqsqIwy0yQHomAqByjZ1HJsRmy/tyWZcbI3Lw6xJs+ X-Received: by 2002:a17:902:7ed0:b0:1f2:ff65:d2d8 with SMTP id d9443c01a7336-1f6b8f0aa39mr26204935ad.27.1717668345334; Thu, 06 Jun 2024 03:05:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717668345; cv=pass; d=google.com; s=arc-20160816; b=cHmmKpv8U3KNIoBo7dfPzUGZbWhBm5W62L/dCFlgT4HEOUBcY3E4UWYy21MPAoR28T 8MfizT06D20gnt12AyvVzMr8X3cLwn0pwVrLp728M/QqRCn9F2wj6EWE0oiJS1JhGY3a ANZWYzr2sEiLh1hL1o3F2laUPa99fyNr708SPqZmeMUJeQcM2LvBk+71iwnHJqU2GSLc 5xmVBW2oNJq96sIH8eUPtxfOuAOO5HCSfiSjBkNU90IE2gR6XC1HzWia+PkV/p3wbN7R D+kCtjp2mKOGjmpGrpQkfkOKDgMLZ8Wdk04BAFrsQzzhlrctqDGs83ImjzUi5PPg3xBA N2mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Xdo3ldNDeMyIM6Kx3VweI5RQmky1PUGTcMckmPYOvUE=; fh=mYfkzqEWDm6Mr7eJFSQG66IYh36/BHshhHvfu4Oz2hU=; b=a/ZiiVrBwXUC7bgtgXedbLwp2ms5cPI8LbLttafZEhYfA145g09cDj3elE5zrrD6wE 9udFopMLVyl94D6PiiSfqOEfbkY2czJcw5b0AEhjzLDsbqCRsOAs8F+6QKqPV6jwt+6b yQTIQjaT+V/Pdmu4xqDIM+D/8woig8AGMrKgZGz0gUIfl0yLsatud867ObHzm1cb88ON IgpFZI2qHlktu75YKqxuj7KzGx4Qvb5G7Gw0iKvSEBgpQAu09yBaiYioyW9AqRWxwRN2 9S5d5xXe7h3qmNw6PHpMyAvYfcCR9ovTcZt8Rq3yrwda87aMvE5jwQDeFQImtoNHTE/r jgpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Crpew3vw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd76fb8csi9238535ad.192.2024.06.06.03.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Crpew3vw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203980-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D6DC2B29A9B for ; Thu, 6 Jun 2024 09:23:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E1FA13F428; Thu, 6 Jun 2024 09:23:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Crpew3vw" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 AE88113C913 for ; Thu, 6 Jun 2024 09:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665788; cv=none; b=L5xLjRHyMDrslzLClxkDksBb/HAS0AlnDIXhWPefUeB5e9f69+mlmX8tL6u26n65zvr9SxuuWEV8typqHXhNv86BJ1xNDeuJrY94qe4IatzgL0k8oDowSV5j8egqKhg+h/oT06OGm8TorWVbsHCMLZT9lQLVmBhbTuR/yZVUAEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665788; c=relaxed/simple; bh=SEZNCNy3TlFdmEoQ2GZ2Aljta1PfdelqlRlbOXhQfSk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OEDtvEvQF1I+ZoAJdhmMazk+ELnOFRwQDWCcsqr9yHItSNes+wcWmOFkHfNple9mgl+YRiRl3Emssvd229Tpt8LrGMp7LVmjkiX4wXAPKViUaRw/EHosFZWQipDSqehA4x86dZONaYe8e0uaQzVEwHaLsBt2Ks1rXOVxp17hrxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Crpew3vw; arc=none smtp.client-ip=209.85.218.49 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=google.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a689ad8d1f6so81763066b.2 for ; Thu, 06 Jun 2024 02:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717665785; x=1718270585; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xdo3ldNDeMyIM6Kx3VweI5RQmky1PUGTcMckmPYOvUE=; b=Crpew3vwwN9zyUOgT8tIFNgxp6++QSlGxmrGff8YAu5UGYudOjqQDqhBzlxUPFrMEe lQwbh+TQKRib3IVWV9RMF6rMtxZY3hsHCdU8I8HbI+LwhVLWO2kNrzZTpubG4X8B44RJ Sa9y8BdAM7ILpQeaOW6QluO9bTBQt0iYhgtSdnXRaT2II2RLT45JCxqq9PrtDmwcD+AF PUuW7ByZTP3xMdlOyIzevGQ/ba4qyWq4jG9E1Po+nIM2JUxIF27KbXtvexwTSnnAn+hG +58pBzJJKugJO0tN85bPtr8AAMA7y2gdUZYSJXNiNjD/9mj74dQ5dkh9jTXyoXWFDYTC +C5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717665785; x=1718270585; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xdo3ldNDeMyIM6Kx3VweI5RQmky1PUGTcMckmPYOvUE=; b=xC8C3+/LgERbmSVjz/aHMVpEAZ4jdHBSFEx6hOWi+WfQhDV+nKb1L+X/W27+ypCVPl nS+j7UWcKewPiqf7TkceG7cLO2o7aHNIIxBvQYW/IqBBvwrILRIs38SkR7cjzlSqNh+W 8PZujvXlp0l7ZyXvICyLgPPBpqk2DRdoTqzsXiKj/9CyWWNud/UACm7+1tYxUPY7rQSD 6NOz0zXF4HCnHkBoo3uxmmyy9CjtpkDnYtbTBV88VDAU/kUZiA4WJSbAq46xrQcOsxzb IpddyrzERxpOqkZdWprd8ijy6feL4LFNZSB6iwTzsYA8n60yM/y+HvPEuQzrc3EjS+Hd +MbQ== X-Forwarded-Encrypted: i=1; AJvYcCXHvtd+sh0WAX70zYrnht0nklnqDSXEbtalr1TEyOOxQaMWAVbUaAlKhXTPMTsVaJ4+5rGFNyXs6+F6LYqHnFbdG1XXKyJXFEi3It3b X-Gm-Message-State: AOJu0Yxz7szj8dFMmAHzRHc77g9Tqn1Lqcf0SmfxjLPLO8Qy+FkfnQin APykcG0VY7JluP2vwKq9veR4FQedlL4jmQ1vHTieuj5Rvv7p/hmDNuBKdUWf23m6V+AWZci8fCp Nd2+HgHxY0OVTtiftrHCp4NBxlJDh7iVDYvXk X-Received: by 2002:a17:906:4694:b0:a5a:2d30:b8c1 with SMTP id a640c23a62f3a-a699f680d76mr317202766b.14.1717665784784; Thu, 06 Jun 2024 02:23:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> <20240605175953.2613260-2-joychakr@google.com> In-Reply-To: From: Joy Chakraborty Date: Thu, 6 Jun 2024 14:52:51 +0530 Message-ID: Subject: Re: [PATCH v1 01/17] hwmon: pmbus: adm1266: Change nvmem reg_read/write return type To: Guenter Roeck Cc: Srinivas Kandagatla , Greg Kroah-Hartman , AngeloGioacchino Del Regno , Lars-Peter Clausen , Sakari Ailus , Bingbu Cao , Zhihao Cheng , Jerome Brunet , Martin Blumenstingl , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 6, 2024 at 2:59=E2=80=AFAM Guenter Roeck w= rote: > > On 6/5/24 10:59, Joy Chakraborty wrote: > > Change nvmem read/write function definition return type to ssize_t. > > > > Signed-off-by: Joy Chakraborty > > --- > > drivers/hwmon/pmbus/adm1266.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/hwmon/pmbus/adm1266.c b/drivers/hwmon/pmbus/adm126= 6.c > > index 2c4d94cc8729..7eaab5a7b04c 100644 > > --- a/drivers/hwmon/pmbus/adm1266.c > > +++ b/drivers/hwmon/pmbus/adm1266.c > > @@ -375,7 +375,7 @@ static int adm1266_nvmem_read_blackbox(struct adm12= 66_data *data, u8 *read_buff) > > return 0; > > } > > > > -static int adm1266_nvmem_read(void *priv, unsigned int offset, void *v= al, size_t bytes) > > +static ssize_t adm1266_nvmem_read(void *priv, unsigned int offset, voi= d *val, size_t bytes) > > { > > struct adm1266_data *data =3D priv; > > int ret; > > @@ -395,7 +395,7 @@ static int adm1266_nvmem_read(void *priv, unsigned = int offset, void *val, size_t > > > > memcpy(val, data->dev_mem + offset, bytes); > > > > - return 0; > > + return bytes; > > } > > > > static int adm1266_config_nvmem(struct adm1266_data *data) > > The series doesn't explain what a driver is supposed to do if it > only transfers part of the data but not all of it due to an error, > or because the request exceeded the size of the media. > This patch series is actually a follow up on https://lore.kernel.org/all/20240206042408.224138-1-joychakr@google.com/ which has now been reverted . I shall try to collate it and send it again with a better explanation. > For example, this driver still returns an error code if it successfully > transferred some data but not all of it, or if more data was requested > than is available. > > I didn't check other drivers, but I would assume that many of them > have the same or a similar problem. > > Guenter >