From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.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 0570F3B9DBF for ; Fri, 31 Jul 2026 11:10:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785496245; cv=none; b=BEL7G2xiwSC5nGvOzASTyGdHtF0yGRa+OzemgfNsFJ+QeEOqbo1iqxnjVxpR+edraUY0O/oL7oZxJIQDPWFa9Bf1A8WROvTf9anZIFZ86qkNbc52gWbCYXj4W4n2rtsi+zd4blkxTDNtYAyzoQFouA15/H560zwspM4MPfD2zjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785496245; c=relaxed/simple; bh=/PTPQshCdr+INc/sRQADOhUiFvt+ECFqnGrgf4S9v8I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VSTkq9a9ODqOtVSgAFzEcFPFLVVNudcF/NPZPDu/arbhJt2Xiyq+61yevK2FTtuejWsBwXyOiBBjYJXRV9bwXKkUEtGb3tdyi5VLNPTOiuY6rHcZroBpoiwGJ08CmKv4awtPJn1EspUbCz4P4WDdg336vCbcSZvNFoIp2AcMOuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fHsJgvvN; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fHsJgvvN" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c1fbe461f59so123887466b.2 for ; Fri, 31 Jul 2026 04:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785496242; x=1786101042; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=+6MH3hCSieKYm3naZlQrmnvkAztvvwieG2fx2yk8DyM=; b=fHsJgvvNIwMazjtBqf9xP6S7T73zQ/8tDK72yO+1mDghQeRg6rzGGAkWtKvupL+7dO R4use/GOpEqrPzPmJR80tEbjkNUP9MiFrL4jmbU27X92siz5PYPzGkees27rdAtM1+Jt HbfCihTqXrkPxKcBY1QlM73EqxTMK0leYeUamTkcqNNfDk/fYeA/Wbrytc+JTD/ofTR/ wLcJ28Ad1nxAj8e20M23zT8/J3qH8jJ7no8qQX1xm+w2fMy91x2Qhc1o8k8YbkXcN+72 NJtUIeQ4kymwuKxpTW4RnbA9p1mItmsF/xd9qU0m0werupFwASmNw4BxxKuS+ye3g12H WApg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785496242; x=1786101042; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+6MH3hCSieKYm3naZlQrmnvkAztvvwieG2fx2yk8DyM=; b=JcukMssurHXJgraejDy/2GNak94OoQOg+/km+jM1dgWKLK8KLFARXTWifPR/0gCaHr vER5F0Zjvzx5YxE8kMXCmBYHQYabCa2fsISj4ilxTzA4c1KoF/5m9nXZ58GGWCyH+0da yfJEb1CV7rnnYxI2i2DQHZ3+kDPtGmYOflWNFJmBcu1CiErkOJlyvfT2QUCxtK3dq5Ev ur9Xj5AqcL0jGt2D22Ez8rg5nQt/Q09YaMSMTSwrwwvXCx9JZjdeSsmM+poSAlhPngh2 evoFvuwc8AdSdhggIS2Sq37tttT8zDfq1Ji09FwG40jgBEYbzx4mh/jRZWkimwDJXKDk upYg== X-Forwarded-Encrypted: i=1; AHgh+RqK+ExlA6GBH5xaxsXGFDjCqUpULNKzk3r7zVWF2KMRr2rJte1YG2u4ZviOQiYmaQrRkhqeNI07GZHvkpw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2+XmKIeUngvXBCgw/1HNgsijfJw6gaLE+9xHmc1j7pIQ4RTqp nxL9zFYwzwakgVpnCw8eRdV02P5CmMBIedKBDPLv2KMFbX/aE/ZrB/jK X-Gm-Gg: AR+sD13mFhO7Q9xJ813FiMCjbam++bH/UyPSTdeks72xWg7Pjc0yDIc2UxSw8qBfwbC 7TOgQcoRw0ftWO1RLfxBOIT+O7owNpqifVJMDVSxN+LVqNypwIBzvymOrsrWiIIqdpLH2rmjKGQ +7JejkNuSZfDslb/ERnOoze/ESqHxrprcSbW6aGzrHK9t91kDf91kydeHdO7dl7S9T90FGIq7qn j82R8NKBFHQ0pul3seOEvl+8Gc2jMraF+X0HPUWdLUljbhc6GfcUZ1KowcyBNDb+0uhpWhYOuP1 oNmDQ42uYH5Y1yi50dh9AjoKdnRrpc8CwihF4KexIjsaAvT4Z6R/LuV/dDSVqHcPDBP2Y7dOyrN GeM+g6VBhXoKwuVBKLkQOG4HZxZVsKYwfyb88kIq3H5f3LrW5eekfDfStHuyGsIVT5+WVyEi7/Z Wc3ZI8wTpslY6VK9w9CZDs3EHU9OOUgywYe+dmeaZptqN9VMrj3UonBleBF/HU4fTyg8w= X-Received: by 2002:a17:907:801:b0:c1c:4a7d:c501 with SMTP id a640c23a62f3a-c1fd24a91b8mr91840766b.1.1785496242136; Fri, 31 Jul 2026 04:10:42 -0700 (PDT) Received: from localhost ([2c0f:3d00:6be:8900:ce5e:9212:ea4b:f30]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1fd3c5a48asm103523566b.11.2026.07.31.04.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 04:10:41 -0700 (PDT) Date: Fri, 31 Jul 2026 14:10:37 +0300 From: Dan Carpenter To: Lucas Jeffrey Cc: gregkh@linuxfoundation.org, ovidiu.panait.oss@gmail.com, gustavopiazdasilva2102@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] axis-fifo: use size_t for write size calculations Message-ID: References: <20260731034307.327377-1-luquijeffrey@gmail.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: <20260731034307.327377-1-luquijeffrey@gmail.com> On Fri, Jul 31, 2026 at 12:43:07AM -0300, Lucas Jeffrey wrote: > The write length is provided as size_t, but words_to_write and the > return value storage used narrower types. Use size_t for the word count > and ssize_t for the return value to keep the types consistent with the > write interface. > > This avoids relying on implicit size limits when handling write sizes. > > Signed-off-by: Lucas Jeffrey > --- This doesn't affect real life because len is capped in rw_verify_area(). The commit message needs to make it clear that this is just a clean up and not a fix. If we pretended that the len value in read/write functions was an range from 0-ULONG_MAX then we would have a ton of integer overflow bugs etc. regards, dan carpenter