From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 618A0C25B75 for ; Thu, 6 Jun 2024 07:43:04 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gxODmp2xKTi8vMfstXjNtssHcHji5iHbqpvN9/8ycjY=; b=J5tOliUeL963q4 UZgY7J44WTbAC3lAi958LF/cQqENGYeIZreqRx6GId0e1PrhXSNYFTflnDunQsOPlviIloT1nFS+D pFen9HhVi/9xvUA0y5uEU3gUf/1viD2Dw6N9YK1JTgy0InIF5Eu9+qk4BxvQ7kic+H+MslI7bKQcq ocwYsZdfm4wnBbedANFK7meEUdQGXDf3dtr/z1ZOzdDS3whZtuY27cNV5oPtSufEvYVNaSxPWc5/o +25fYiNbrgliOJIjJocO2ZpuqQCGfw4rJtJAG28BF5l/EAPEVOkkeS3hsIm1JglLVyWpRcc3hCaLM xJS6t8Q+N5OjdMarHFaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sF7lt-00000008iMU-0Ifq; Thu, 06 Jun 2024 07:42:53 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sF7lp-00000008iL0-3TSq for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2024 07:42:51 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a68c8b90c85so77857166b.2 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=lists.infradead.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=QpdF8/e2+csDerZVEAgxFTXKe4QxjbJf/SuFhVnwju5bl8w49TY3TwHrWdUAQ8zY6y lqZ0GgewidQxXU58nkFYTdctAdti9jZeJHVhBd4WWJwoMmTUoANmnEDRYe/RgrQ7Lisl UTbUQayPecNGtxkpQjPYNvxMgmgFwjcJ168VSD4R8rcLMHR23xn3GvwAUV1uE+Ca/Hab DfCUyKvhQ+ZdX56fd2flfrqBqKEIRLR9gM+jESSi2MaSquuaL0rkHJy5h8fe2ZjPBoiL HWRD78GVnCtMZO8eYycVkI7sF5UVzrCZ/LRV9CUG5dLPYAP1AR/VWLYJBloB9Dncetye AhDQ== 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=B9UoE9xZ+vw16BwLoQC0wXSy/TIfKAKmMygdf3hhk/Gpa4UJFBKJ5rkuZ7o1e1SiF/ saYsWo6aCl04+RjjIUfNZv6UGOBMFBliKecg33Rd2edD7HS6taRSUwDzzOwM0ABp1EMZ E0qynUN0mTs3KtMRNP3UgVoGedNiCKXReNtoLHVSPkQh6jCwo7evwE//NYXg5Moui5AY nCJblPabEnxuDVmRiTINLNmf5ZU1C891lNRqu/C9+3rBAahzKBhibiV5K2wBMpFRoNFU kDEcZnojGoZMkxlIHWBrgdkyOaIFJrZdeaKQHSuM4VTsUP1RaDisBZ6rilNCUA/MUYJV kwJg== X-Forwarded-Encrypted: i=1; AJvYcCXAyduulzMQY4COgM+1s9VSnA7gldxrLDtJpkRBajKHdHWuDv2YePHjmlFVZZTrII22a+6nltgLWTmZj621KgtWn79WKknszNQc6BUJUC+8oeA+ImI= X-Gm-Message-State: AOJu0YxB1TQYKV4D3HCtbXurcOAU0HPgIMbv5bgNfnw+reg3JZWFJ+vl CKHZS5lS+no8KbYoV9p/ODjn8+kzRahyfFsXZ3c03Pj7dSnytJJQoSkhGeoLRoY= X-Google-Smtp-Source: AGHT+IG9fb84ekx6f8HaBtotI1FnubBAZuTJ3dgM/XdsdCeyuhCLEIFdUbolQkfIb3FKjJXzmIhddQ== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240605175953.2613260-2-joychakr@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240606_004249_921324_077EC094 X-CRM114-Status: GOOD ( 18.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel