From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 E13871922F9 for ; Wed, 15 Jan 2025 16:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736960296; cv=none; b=ZqFZhY2sRTwIY/vMIk2Hmjem4hh1bWv+ftHHOt9tJQ0+LbfPGZXNl458N7TSqDJs46+F8FT8Jpu0EA7120v+Wa5UBQremTTpRCYNtE9g6APhNHMoqMG4WTPf8FaDAwkJkuhhX6naO8B7sglZW04DGhdpmjeL/G+VwkMgPg2LFMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736960296; c=relaxed/simple; bh=fEGQwbl9hUJ6oQnBoI7Ucx7qUB0iJoPU6Lu4Sa+32HU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RXWxmD0VOY9SL+dij+6U6/e+BaFFp2VRuqmC/c3q+h71ENnTtJZU0L78oXFRI14bTLcVCRdW5VLt6RGmESJxmIHhkz8kbVR1T4digZu+fvKqft5wFB5mtUbThlpbOoM5ItOEoXsEo63Sd9VOPS9lOGFqgKKn3HPzoZhM3bhhleo= 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=O7ovaSwk; arc=none smtp.client-ip=209.85.214.180 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O7ovaSwk" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2163dc5155fso129317945ad.0 for ; Wed, 15 Jan 2025 08:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736960294; x=1737565094; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=FrsWxlPvPjKU4BaFHbiKk5qakR6RAoiFFc2vFZEWfTk=; b=O7ovaSwk5NjNfa2RcBgw11N98IflHlTER5MqV3SEsNbb07yKZCYJ3FSKYTIm45xz0Q G1EntYnkPmWqfYA3VfyGM7cvc1+N5WbgaSS3FamOIM42CST8k8dZ3LVMhf4K1Rrd01GF PIosyBoAgi1+U6a6IG4GMpAMMy/eYi+0RWAHOXkRURPO3Z8INo3yhJTjYmHI/FDu8s1D xgYPSKrmpdg3lfyNR8MuotFzUnZUTOGg4bhRV6eFFCKOnfztjCyTinf5FHnSwWyklHkc JziTc1f6DNjoTg+lR2qPP8Zew2axopDlDcSDNUnx1ogwHMuL2Z+A6zQTS4zuBE9WMJ0D 0XBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736960294; x=1737565094; h=in-reply-to:content-transfer-encoding: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=FrsWxlPvPjKU4BaFHbiKk5qakR6RAoiFFc2vFZEWfTk=; b=NziwACdiAzcBcLRyh7dtm2Ny2LN+8YvWi74eThC5+4jzXqC0D3WRVBt45PM6Zqr+Cn jAruODSFkXiQSPx6TtbM8DAX15bNkahUQIb6iOLySQA7tH91MAhJGf+IsxC8TZF39j/6 R83N0TwuO+iAc8ZUJROstfF5uSUUETsSXbAfbqijBcJXDpS9dP5CqaILEIdsZZ9B4/Kb PgZ5H9Oh486a47xASSW4+7M4/2Kvh+1MO9ye4Sn4CVm9SJ4EFDP5pZfwOifAwX0TFwXU GRWmFClXZZSPszLrUS9CoHEgBxQ/DeU/faEOcgNeQWg9JZ3zjdYh1K4Y/fypPvwoNwIU gNxg== X-Forwarded-Encrypted: i=1; AJvYcCVVEwt2F5RlhbsuFmN9kG4YtTMffkj3xklXR7T9ND8D6dvdw3jlrVvxjvnuS0TAOqiYM0TuLl3seoeGZpI=@vger.kernel.org X-Gm-Message-State: AOJu0Yzj5TFUhzGWhGOXWGSMIBd90dtztkDS0/Uf9XHhzOHh/AfwJCwx aVuKgGxTr/mY+uAnE0ICtEvsagV337S0HIhC24pf9vvRiOng/yRv7OgDyHwGFg== X-Gm-Gg: ASbGnctpbBxQE7B27y/yrgWLd9r9lDRUXXBnjivSNrUZw2V29qVUBDH++Qi3qFU0Mvy cG7XYpPZSKjqUhxVAgAcuJApZhm+8kfvbsnQAQf4dqSPVPjn1f/EjjQuvfiO04jhLMNtefdy46i IMfV1czvyk86xTGhCqBxi/zlu20yAk7NK26J/YaOYhzcStGkBcZQm2YnM4mjCk7renAnZ+exUEB 8RId1MGKy5XOt1JySiogFpaEEytZ6ThSPqta7mgeucSUTYgMNxo+iZH8ZfkrtG7BrM= X-Google-Smtp-Source: AGHT+IErOGMGOBTDhoMb5sMI+tbIZM8OnhY8rY5ymngydpcsjHDnNoB1f38C+XkxGmBFsWOdKynIMw== X-Received: by 2002:a05:6a00:944a:b0:725:ef4b:de28 with SMTP id d2e1a72fcca58-72d22049137mr36477290b3a.17.1736960294303; Wed, 15 Jan 2025 08:58:14 -0800 (PST) Received: from thinkpad ([120.60.139.68]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d406a5a32sm9790093b3a.173.2025.01.15.08.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 08:58:12 -0800 (PST) Date: Wed, 15 Jan 2025 22:28:07 +0530 From: Manivannan Sadhasivam To: Hans Zhang <18255117159@163.com> Cc: kw@linux.com, kishon@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, rockswang7@gmail.com, Niklas Cassel Subject: Re: [v11 1/2] misc: pci_endpoint_test: Remove the "remainder" code Message-ID: <20250115165807.4m6y7p3arjmooh7y@thinkpad> References: <20250109094556.1724663-1-18255117159@163.com> <20250109094556.1724663-2-18255117159@163.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250109094556.1724663-2-18255117159@163.com> On Thu, Jan 09, 2025 at 05:45:55PM +0800, Hans Zhang wrote: > A BAR size is always a power of two. buf_size = min(SZ_1M, bar_size); > If the BAR size is <= 1MB, there will be 1 iteration, no remainder. If > the BAR size is > 1MB, there will be more than one iteration, but the > size will always be evenly divisible by 1MB, so no remainder. > > Signed-off-by: Hans Zhang <18255117159@163.com> Reviewed-by: Manivannan Sadhasivam - Mani > Reviewed-by: Niklas Cassel > --- > Changes since v9-v10: > https://lore.kernel.org/linux-pci/20250108072504.1696532-2-18255117159@163.com > > - Remove the remain variable declaration. > --- > drivers/misc/pci_endpoint_test.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c > index 3aaaf47fa4ee..f78c7540c52c 100644 > --- a/drivers/misc/pci_endpoint_test.c > +++ b/drivers/misc/pci_endpoint_test.c > @@ -280,7 +280,7 @@ static int pci_endpoint_test_bar_memcmp(struct pci_endpoint_test *test, > static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, > enum pci_barno barno) > { > - int j, bar_size, buf_size, iters, remain; > + int j, bar_size, buf_size, iters; > void *write_buf __free(kfree) = NULL; > void *read_buf __free(kfree) = NULL; > struct pci_dev *pdev = test->pdev; > @@ -313,12 +313,6 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, > write_buf, read_buf, buf_size)) > return false; > > - remain = bar_size % buf_size; > - if (remain) > - if (pci_endpoint_test_bar_memcmp(test, barno, buf_size * iters, > - write_buf, read_buf, remain)) > - return false; > - > return true; > } > > -- > 2.25.1 > -- மணிவண்ணன் சதாசிவம்