Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp314473lqp; Wed, 12 Jun 2024 02:23:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4PzKR7dS2VEGBq690m+Xrkkj6Cb0HZgBlVmBiSK+3QvTNTysQfCXLbAbQDqkIXXAc9hzDAkmNcZ7GMgwePgek6xlRgWNfhBj/epX2DA== X-Google-Smtp-Source: AGHT+IFjIl1KPjdjDKhexM6RJun5WS6Ot2nYP03o25OJdTZqKiy5CohRAiQo4A56lOLfun3yclNH X-Received: by 2002:ac8:7e8e:0:b0:43f:f07a:2490 with SMTP id d75a77b69052e-4415ac0d0c2mr8330621cf.11.1718184202361; Wed, 12 Jun 2024 02:23:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718184202; cv=pass; d=google.com; s=arc-20160816; b=SgSteWa3cDHa7O9q/2gAZ9w4BqZe2MvBAkH0fY2knXZzfBxf3i5a8ox9BuEmucN69c Oz4aRIhv3bU1nD0yKduuUMnxHJsU6a2kt9cByM/kFnGgrmWjgJXJ3S+Db4ZccloO7HaC hbglE4Lt/OEEFObx7Nx/T0kM4Z/bIriA9jC2NMpAI71EnzqfdnHtux8E6mJ/nSgcIm2o NXQn5HmVVfxaek6gDaYli/KG8hv/HyQudEAmKzmHea5kHolxIFJ+b+X2Q2s9vNGiRSx6 FvFRiuDJ4SqdHmk7XHFYY82WCl4TbuJLPbmAwjSEk6u4rYMW8ahJWZZ07jt7PFOzO6EH 27jQ== 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=px3FWD61KwYUoVLXs51y4wh/lB5F1voz4oJ3Gukra6M=; fh=3iCx7PE1s0mlsfLKbbs38PwQBUNgnSeiWS4V240bUEY=; b=GhhHSmXLTWhRtU/shjdxchB8SeVE5j0yoNIi5ds3h9eSgv7TnwS0Gbc5wXSy0jRzkA fXMDoaIE1JPYRWRFM6KqQUjB3jy5tjcz9pR82bEu6RduaIUI4lEBylQ8xc4I2AtbRvEp 5sN6fQfUr2hRrn6TN0al61vbFygv0r9q3H/PASeatKjfEXdhRC/UrB2mow4I1fDFwQ6G 9dRuuCkTnsflXtGK/SaIet10eQhPThCRk1/amZEbqk094kAICDwEAouyi9jHiTcxSTLQ orWULPAMf95yMw2v4pCaJxDL8efu+CmiTtcvQccA+CXm4aViha9O5eTfZ6Z3DYruENfi wBLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yr0/iviL"; 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-211254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-441543ec7f4si29232721cf.51.2024.06.12.02.23.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yr0/iviL"; 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-211254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211254-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 191301C2245D for ; Wed, 12 Jun 2024 09:23:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63E9516C875; Wed, 12 Jun 2024 09:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yr0/iviL" Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 0C509A34 for ; Wed, 12 Jun 2024 09:23:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718184193; cv=none; b=ui5aj21J8doYbmnFMq+O1df9dZb/lQGTOKhqIll63EiAuK6o7/0KV2FPtO4L+X0jj5hyGc41S9pqJBEk9i9Ovf4vD0wpoA3cnvjUxRS6BscV6XO3i75YMgG+YA6m4MtstuwGqrJJJxNFLPRa+QWlmokHO7MP1yDf5n+2DyKf5ww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718184193; c=relaxed/simple; bh=L6aQlkYdf1XjFaD3aaJ4kmtrRKD/GnbI/GjZRBMbZjE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WOJkphCLRF8uICcWiV8HRQxgbZan8bb2nyTSGwZ01B9dCQ0WvtxNpktkE+DBpUY2sCU4vgRe0cRxVcai7+xJNZzeWbrWoSHCYQTdYJxpqHGT6CmapS5Q9uxjhPKKi1Mve+zgliGzHhcTzvF8vHX0uBSZA7XO/9JCaTG58SsX6I4= 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=yr0/iviL; arc=none smtp.client-ip=209.85.221.46 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-wr1-f46.google.com with SMTP id ffacd0b85a97d-35f1c209893so4121742f8f.2 for ; Wed, 12 Jun 2024 02:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718184190; x=1718788990; 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=px3FWD61KwYUoVLXs51y4wh/lB5F1voz4oJ3Gukra6M=; b=yr0/iviLd0x+N6izlpoVwFHchZVFq0+B/C4HXaQcEE9/WbMxy9Wjm21AtJpmPeLL5d aO5VI1CC6NBddliXGJS+J2uZjOGlV7ad3uSMWNYb+Fyk8INe0Gw7fbfRqjCZTyl7lOMc k23dAlQk+wIyN57fIHhkxtULBXIVVXCCjqIf0kv5SF33rv7nsyjDYr8l44xaHmJMh9/v xFm2QtSj8xCGVkTgM2mJhoqj0KlzYfRyf9/locAICanKC8TQPmG1+o8jR+rMF/o+fNiH WkrnX8bQkrhPdnawTqnBuMEQTYk/Xy3mMfJy7RRN2z5BU4euqLec+NwN4rBccdkoj+ob aPig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718184190; x=1718788990; 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=px3FWD61KwYUoVLXs51y4wh/lB5F1voz4oJ3Gukra6M=; b=VnPlT8WES6W5HPMnLfB6CjOKSR+MCPX3+F3W0vYBMwzn5aN34cWht1cjoBczVOpdcx 3wVHe9Gb2s0yafi0SISR9cawSoN4CfjDMEpxWB1PkqIXW/gXEYf4FtmGd4hs/YOm6dq2 83qIGpiPJlhHbcQwOjnL1uRKuBaXp7Rb1iA/Ay4W2/YWZNY3IZSZDUU7g2LaQQaIVlfn QfawAFxGmYiJRJTK/SyH8ATYTsUnLPMdvufXfZvPLygdKqC6xVQ+dUGO+ujwvKsgCnZw Wp4qxyl/eiK/NxVQ1Qdr/wJbsIX4kvpLCtg3hBSWRGU7y6HEmKta24Q2OWbQx3TQdyYv ZzeA== X-Forwarded-Encrypted: i=1; AJvYcCUaZBbQUeKehpnodsw63iePF5zjKVnI8AEQnkpGEOkbO+ZOVnHlHIWFrbRN5xuO5tb9y/vVbMZV8pKaJq/CMaLIyR+dt22gJNiw0t9Z X-Gm-Message-State: AOJu0YzozU49vpzpl/+N54yP/gjf0vvn3qcf5Ublc2NekLaDF+4zeXvq AnYSb5rPMcEk9z33WD6rmqGE98rrLol0PqqT4hHlJwNdmYrPSf2/2iijZ6d93IE= X-Received: by 2002:a5d:4f8f:0:b0:35f:1cec:3cf with SMTP id ffacd0b85a97d-35fe89395bcmr1062754f8f.65.1718184190317; Wed, 12 Jun 2024 02:23:10 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f2598ac1esm7109636f8f.93.2024.06.12.02.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:23:09 -0700 (PDT) Date: Wed, 12 Jun 2024 12:23:05 +0300 From: Dan Carpenter To: Joy Chakraborty Cc: Alexandre Belloni , Srinivas Kandagatla , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] rtc: cmos: Fix return value of nvmem callbacks Message-ID: References: <20240612083635.1253039-1-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: <20240612083635.1253039-1-joychakr@google.com> On Wed, Jun 12, 2024 at 08:36:35AM +0000, Joy Chakraborty wrote: > Read/write callbacks registered with nvmem core expect 0 to be returned > on success and a negative value to be returned on failure. > > cmos_nvram_read()/cmos_nvram_write() currently return the number of > bytes read or written, fix to return 0 on success and -EIO incase number > of bytes requested was not read or written. > > Fixes: 8b5b7958fd1c ("rtc: cmos: use generic nvmem") > Cc: stable@vger.kernel.org > Signed-off-by: Joy Chakraborty > --- Thanks! Reviewed-by: Dan Carpenter After we fix all the these, can we add a warning once message to detect when people introduce new bugs? It could either go into __nvmem_reg_read/write() or bin_attr_nvmem_read/write(). I think bin_attr_nvmem_read() is the only caller where the buggy functions work but that's the caller that most people use I guess. regards, dan carpenter