[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/11] xen/arm: avoid repetitive checking in process_shm_node
- To: Luca Fancellu <luca.fancellu@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Michal Orzel <michal.orzel@xxxxxxx>
- Date: Tue, 19 Mar 2024 11:57:36 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xv7+b4BDoffw7pFU2AlG+AUJAjNM6iLHSd6PgPsx4XU=; b=GxENmxeoiz4OZnI6E1uNuAXmttvM5/kh8hLcw9Pac8pitQLQSUG1ZISKtOatVIu610kuyETkXravcncoErl/RRB3Fp6Nxse0GMCWGJly8zCSEm+QIIeTfTVXsW3d4T04wiyW65u84Qdy3omiVLnkv9aLQo1JVxQWNcW1WEt3ZU/Ml3oyQNX0Suc7oS9BQd0F36mr41r2QXX+xpll7ysewPCvnkPG23tolTG5vQJu03YHtQfD/bDz3WFqYytWak5ZK7Gb8qKFUd796b6gqxggfwW7WWXpR7FBCt0NCryGjQfnyjkOp4oIuib33l7AWmm4FyhwMfYf2sJHF6reCZo3lw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aiEUBhMuXQsQ5H/zVngpgD6cPLACSRlpL4Lxq/JxprihtupXnycWVdnU94bdurpNCLBoUbX1zUK4eKYW1CrZjTeRJ3qq4VyilVT5c1raofLKnYUINYCquRtVXxXCEGMruW/RbOJEf/UqSGBjBLV38lmNLrzpMTW2oL1pTfPrzXkEQ9xKvCrKUnX04Yndg+Ebcc52j5hJR4FUKcOWzWldjqlBxc3YzWPMD3pc51NWeb+flei1AeUE61Z280aBlYYsaT6Cj04zzxDgy6K5SSbYH3lQNjEwVRR87/J7is6u705XUjo2Lq38Jir9dJB5D4H5MaSANCR3eq+rW9/9zWYXTw==
- Cc: Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Tue, 19 Mar 2024 10:58:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Luca,
On 12/03/2024 14:03, Luca Fancellu wrote:
>
>
> From: Penny Zheng <Penny.Zheng@xxxxxxx>
>
> Putting overlap and overflow checking in the loop is causing repetitive
> operation, so this commit extracts both checking outside the loop.
>
> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> v1:
> - Rework of
> https://patchwork.kernel.org/project/xen-devel/patch/20231206090623.1932275-3-Penny.Zheng@xxxxxxx/
> - use strncmp to match the branch above
I don't understand why we need strncmp if we already validated that shm_id is
NULL terminated within MAX_SHM_ID_LENGTH
at the beginning of the function with strnlen.
Other than that:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|