Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp482627rdb; Wed, 17 Jan 2024 07:54:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgQ4Z6IRgdCpvlQc0deOWOQmLKQFunzAMB2e0//WDXOIhTRYu8v/Ix0kUYJ+hrbdbVW1Sp X-Received: by 2002:a81:410d:0:b0:5f4:a5ab:4105 with SMTP id o13-20020a81410d000000b005f4a5ab4105mr5943120ywa.8.1705506894825; Wed, 17 Jan 2024 07:54:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705506894; cv=pass; d=google.com; s=arc-20160816; b=CnwAiqEKsFDHgoVcp6TTDH3hvflftJzEu+S8w4Ud9je/EHdpShx7qgYgVOw6U+k9J/ 9G/c26IGhhuVKQ1voOzdFLjWbBeBRVvvpBUvrujq9bFHSqpRlM5sDKjo+dPq4aoyUA5B u+t2H0/Q3mm0jHORbbCC6zggKPr3FRMqH18RXpz351MKnq+vcbRyZ6BWLJsJreXwjBr4 HP8+3tPli6fnzi+0gni91tmLMEwK3YQIf9cZS9pEfnUGjB6tbF/o5o0d1Q1mHvaZTyMR V5dUhv5zNCTszGPYD0LfJezzSACUtevt2LSB2SunCJyz7TRM8rSeU2yeTNIbSnCyJPfR m0ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=49vf+BpN/oETUapYPVcYitq7u/0YiGOHDP9V1nj0+yo=; fh=KGff/eM0nxU52hZvOhrb9/ThlyBETQXGfNs4UhIKOV4=; b=Ihd9woPcHh6LXBugVKV+fia+Zb3c+A8zBH5+z5L4/hnALJ6W6INPwXEwK4FKd7Run6 7WS8ODuNahONsZ+FvBwq4ZCa61JJpwaaGQpF4sgnNqL/E1e8I61iFlcVvzJkNlGWb7tI 1kl7AeOZ9scK46fRzXN+aUBuf4krwAso5qoW8d9Su/elqFBMWrZg3Py1SdhD/+cwdkH/ bHOzmV67QZskYzizWHiSu6BA9anT3d4wHzN+4/mMDAN4d3mZIoTcTLYVTrvVLXfL2eex I4fo8nDAc0Spz+hyqTc147IamN9b/HjXVkER7UczN9B63Ll6/+ngNZEztm8SeyJM58iP OdMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uHiRt8Mb; 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-29176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29176-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 s14-20020a05620a030e00b00783527e4a6csi7606687qkm.593.2024.01.17.07.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 07:54:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29176-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=uHiRt8Mb; 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-29176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29176-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 91BDC1C23377 for ; Wed, 17 Jan 2024 15:54:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DFD621A1B; Wed, 17 Jan 2024 15:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uHiRt8Mb" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 245CB22304 for ; Wed, 17 Jan 2024 15:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705506885; cv=none; b=BcOOXpnNK5NCLEISG+nKsmnAmw50gFw/IrbBOq4tdq9Wdf43IjqWV/XR3dlGxAbi7WJvbf8dLF1sBfc9OY4fZ2ssWR/VxRqmO+UvTkw5K9utglA8bv7P+sB6Ujby1J5tkAnfDFLLhxdLRnsNvVFs9SSjyUxJL8iS3BzI0+nVRdk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705506885; c=relaxed/simple; bh=49vf+BpN/oETUapYPVcYitq7u/0YiGOHDP9V1nj0+yo=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=qu/sba6ngPaAKhnUFlC5OP0leAAehOB/S+N64+tt5pYTip+QUo6brench/1FF4TGyZuOZMpwStM4z+vagGO9jXUOPZq77le/wxsbBbgrWIaJirGobi6cnZDvU5EYuwKdZ0x7FIOV68Pa7H9s0S6AuCMdT+nHwgUUHujffnbmqcw= 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=uHiRt8Mb; arc=none smtp.client-ip=209.85.208.51 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-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-559b3ee02adso2311506a12.3 for ; Wed, 17 Jan 2024 07:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705506882; x=1706111682; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=49vf+BpN/oETUapYPVcYitq7u/0YiGOHDP9V1nj0+yo=; b=uHiRt8MbYh8mhnsUxVrjOKlF2cY5eGgjmqLzvPT8hPOnETN2S3/7S+btFTsZmO3nH1 6wwi4ceGW17K4ZhKIinIM/VvjH0vXMhCc8EljU5p2aQ0FziivJ+XCiW4VPFL65QR1dvx SHP1tp56XGtcUHYf/GJYgk9RfOpOEQPC9P07SuEkLrzDYukZ7Onz8sPjA+1UGDHLxZXn rug4DS9Y9jJa4APUWCkpSFoAOdmeacRz1Zu0TaStv/ocM6kvb72gHv42A84ppT4jwvbD RdJiGj66b9+Vd6G3i/L7z7+/KoaFRzoz58Uj2hdP6DBqS3RLuAsEetfDdz+fKGJT60Jg zcVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705506882; x=1706111682; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=49vf+BpN/oETUapYPVcYitq7u/0YiGOHDP9V1nj0+yo=; b=QRHCRLH2JCt1jy0ehkxalpaIdHDC23ygwmU5zPlKpMQrwCJ3r/EBf/xHjmk/5wZjXu qAYbIdwB1izTj+eFi+wf2yZuW3mShARA3hMIvvKNQlxwsOf9Ji7+R+0Mwb7V2sNjtIH5 E3wt+03IoNMJX3U5HPXKImcHYrEKxgJkLczE03PPMo/1o4Pc82fqUBJsAnofHd+E4p5j zGa5/kIZUYd53pgbgkQZx6iQFNsZjyK7WT8xca0AHNcamaiovLOeFv2oqguWoUnsYUZ1 era3MHDgz1aVkcYLX/fgn9UThsPlfRzGYmOLD9KU+qK6pl/I5c/KFyL9NwGw7WZl6/mx 0xdQ== X-Gm-Message-State: AOJu0Yyo9nvWDfPR2TuJrXVxc8J8QrRY+d9pW3qZ2oq7pdVto1JN8mCZ b2mpZA4g1KRsFk30Yi3ZqnlF1JMmuE39dQ== X-Received: by 2002:a05:6402:3134:b0:559:52a0:f5dc with SMTP id dd20-20020a056402313400b0055952a0f5dcmr1835531edb.69.1705506882411; Wed, 17 Jan 2024 07:54:42 -0800 (PST) Received: from [192.168.2.107] ([79.115.63.202]) by smtp.gmail.com with ESMTPSA id ez6-20020a056402450600b0055803202e83sm8262579edb.67.2024.01.17.07.54.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jan 2024 07:54:42 -0800 (PST) Message-ID: <97c3579d-d6e3-475f-9f90-d4a2b3e25e86@linaro.org> Date: Wed, 17 Jan 2024 15:54:40 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/18] tty: serial: samsung: make max_count unsigned int Content-Language: en-US To: =?UTF-8?Q?Andr=C3=A9_Draszik?= , Sam Protsenko Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com References: <20240110102102.61587-1-tudor.ambarus@linaro.org> <20240110102102.61587-11-tudor.ambarus@linaro.org> <026bdf502c0af8260c67a7a851562633a6976031.camel@linaro.org> From: Tudor Ambarus In-Reply-To: <026bdf502c0af8260c67a7a851562633a6976031.camel@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/17/24 15:38, André Draszik wrote: >>>> +       unsigned int max_count = port->fifosize; >>> What if port->fifosize is 0? Then this code below: >>> >>>     while (max_count-- > 0) { >>> >>> would cause int overflow, if max_count is unsigned? >>> >> good catch, Sam! > Does it matter, though? As this is a post-decrement, the test is done first, and the > decrement after. Therefore, it'll still bail out as expected. Indeed, it doesn't. This reminds me of stop replying to emails at the end of the day :) Cheers Andre'! ta