Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp207192lqt; Thu, 6 Jun 2024 00:43:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYDx0+CJ49Bz2LllaygQOSGs01QBf782SFrV7nxeUkKvVvTpWUDpWcXwrM/NmwOfD5sL301y85Fh58HhDgIQNa4/Bbz3vZ/zPoo1Svsw== X-Google-Smtp-Source: AGHT+IHpGnT1NUU3u/lz8aTitu6lNoqvHA0gJBBZNStLMwNNNS0ZPZJ44zu3SOuvX6tIw8rwcoye X-Received: by 2002:a17:902:db08:b0:1f6:5e40:6e30 with SMTP id d9443c01a7336-1f6a5a7af00mr54310495ad.60.1717659794606; Thu, 06 Jun 2024 00:43:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717659794; cv=pass; d=google.com; s=arc-20160816; b=xelByPg8drs/nm8aNlmhSpXkv+ltH/2oHTPyYdsEI2y5bmY+Tb/EObUnnh5o1dtOC7 BbchMYCgs3kAvYEbsTWYRpv0eldjl32//TfipVSKxLVtBlWXeWtMFx2TPZM77zwvUEHo ICAJXEL+5DGvmtqgOEsGfsIZzYUxGjygBKgh21tHBZs8X/7/0YP1PQKsW+lbD5qqYmd2 +Cj7Nv6mUIB6UfXyYEUdO/GHBPQZ63xh2QUPm0h4+Bd95Gf8632m4+d0oanGALAPu6rt TT4/U4L2YasrW3LnH4ROTQaR2cChOK+xZhFj0QgE1VjRRuQbzUJ5TFwqH9dnp3tAFFzO Dlng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7hn7A2vtREo0E7HfSwjkC9hqptsOSWf7nUvmnuVDMQY=; fh=b5XjCein3JSrW8uT+RDwB/v0earf6KzcX9/IbeLTZnk=; b=DV66LSPymSPoJMov7PFVZXlxl5SU60MDMem2XfgCcItS3PTrXHha3qKyQmeYpn7dv9 wGyLbDp/jVxSTFUtAaZGM+lu3uYaEgzXx2EDL0ovQd2dqUh3ff3emGkOmcDsQ0Q7a+u5 Kk4jRhtgY09iZzNI610qoHie/GRjK3rHiF+uRCT4PqFTeKJd0+FZDC/K1f0McXRjjeJc 2KPMB+QP+WpY+Q4IvLf7MjsWvt36S1xkmlqesRE8pCTXfmuAXfAnnWzlfqooVqV6u+Pl 3ZVvxnIR+42kICcRYZRu1kMwGphnsQXuKGLpX4VRmg6ReHSeLfAmHno7G22yGERm9FLP wRwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NL++cvwa; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-203757-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7d58f1si7272785ad.210.2024.06.06.00.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 00:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203757-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NL++cvwa; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-203757-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 34BFCB22D0E for ; Thu, 6 Jun 2024 07:42:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8E2313C3E7; Thu, 6 Jun 2024 07:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NL++cvwa" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 F40D913AD06 for ; Thu, 6 Jun 2024 07:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717659763; cv=none; b=LEYffLN01lJfRRukJSTuOFHDLEVWYVL0WlSJWP5U6ciBF7UKwEk1lhOXrSuZiz7kIbLtx82h34bHDrhNNr+oRPab6Zf94mzhOQdMb0XyZ16rz4FenG1xngA/+svcJVP+lMyCrdadLDXIWToDFJO9HaezEu65g2JA8YgS8jxTVfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717659763; c=relaxed/simple; bh=7OaWmqVFqUj8UiBMIFYvyTDVYpCRKRaVDuAaqAod2/I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GpEA5ZgPwy3hyBjV+0L9ABM60CxbgSA/+V/pJiBSedfLZf9ukQjIQ9DMc+M3JzDbQY0q75lj+lbAHgoSZtwpVFOT0g22ytLJOyvzoNyH8aca7OYmnDgsBAGDM+mVEuPWLb41b6zAVdj8yhHSxGAXLP4KDz3DIwn8+fnqKqWOh5M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NL++cvwa; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a691bbb7031so86778366b.1 for ; Thu, 06 Jun 2024 00:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717659760; x=1718264560; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7hn7A2vtREo0E7HfSwjkC9hqptsOSWf7nUvmnuVDMQY=; b=NL++cvwa1YzNLaO02KuHXfdUWI0iBeBifsmyZyDIb5uMpknUdYDOeT/BDI/fB1OqHk +7gCI0acVsZJ9rqdfi0zaMODPSc2iNqRCIIzabLp1tuBymzYzAtsSw1iGNJhqh8NyJ/4 bfRhWy9o8GJlE3fdPgPV+MIOX2Zas3+n6dR2PFZyU7rJMR6cFy0R0pMq+kF7E/jGpRD5 dXGJ+GxjzoVPjGZ3tiwUrB4gUVnyjnHucGul9epeD37Bp6ZiZqmXwZ1hXIrXEdNVrXJF ilEl3P0UI+XCbpU9AbkrYXIGfV5G0BBv+rrjrB1As9IXmF71GnivuRMlHZ8mIiUgEiHw uAJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717659760; x=1718264560; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7hn7A2vtREo0E7HfSwjkC9hqptsOSWf7nUvmnuVDMQY=; b=cb0Wb/vDEr5ZZZEA1cUDEV6a86pGj/YVFSXkYW85J5gS+cNxFCZm3rGOtNWX5+5yi5 2TDbwLwmP0S6RE1xbWWTJAExZSmCTwMTwuVObCHq4M3HBJ6WhBJCKV6eQp3yOxRhf6Tf tptrVmdInUq1xokpTA8Qs2fJfAmwE10r5CgDR9NLZW0IFnsBpoDpte8a6L9uknWHZ0TB 3YcRFW9lEf6vEAZn9/kfGYRxD3s2vCVc2FmN1PiEJEPHP+XhL/YXgZrO5RjGyk1gC0dS pCBZUNTZVZBlqWpXFuvvrs9/iWX6n/DuaWiSNApAX5o/3UrWcS43jbE6yjNIDbapXGEh xcbA== X-Forwarded-Encrypted: i=1; AJvYcCWQNS4bBZC+d8PrWjf7zmoRp7zso8oXge5wJRRMkkGnhreYKqdJcewxbKrbBszGo8O1l2yZ5fdddfuw+JlGyWy2lec+HZpYpzbHAUqk X-Gm-Message-State: AOJu0Yy1QO9bDVZ+yxzmCJ3FkVo/u9yB/SqyoZ1Dwynk6Wc2pjXOB6FE Y+aM3i4yBaIm2u0MHD8/LA9Kx1LWMosxjL0Hwb9voh1JKJDLmurL/jvnh15LeFQ= X-Received: by 2002:a17:907:900e:b0:a68:fe79:9499 with SMTP id a640c23a62f3a-a699f88b67cmr343464966b.40.1717659760015; Thu, 06 Jun 2024 00:42:40 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c806ebc43sm57149266b.141.2024.06.06.00.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 00:42:39 -0700 (PDT) Date: Thu, 6 Jun 2024 10:42:35 +0300 From: Dan Carpenter To: Joy Chakraborty 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 Subject: Re: [PATCH v1 01/17] hwmon: pmbus: adm1266: Change nvmem reg_read/write return type Message-ID: <08ff07f4-034d-4342-89da-d83044871ab1@moroto.mountain> References: <20240605175953.2613260-1-joychakr@google.com> <20240605175953.2613260-2-joychakr@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240605175953.2613260-2-joychakr@google.com> On Wed, Jun 05, 2024 at 05:59:45PM +0000, 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/adm1266.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 adm1266_data *data, u8 *read_buff) > return 0; > } > > -static int adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t bytes) > +static ssize_t adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t bytes) > { > struct adm1266_data *data = 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; > } This breaks the build so it's not allowed. The way to do it is to: 1) add a new pointer which takes a ssize_t 2) convert everything to the new pointer 3) Rename the new pointer to the old name regards, dan carpenter