From patchwork Sat Dec 9 12:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 176168 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6024609vqy; Sat, 9 Dec 2023 04:37:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJJ0L81kHawMm4M5PPdb/c2kBf9K5etCUsQ+Cr8Tg0rQDgyKvIfS9qPD0VHbm5znJiT21J X-Received: by 2002:a05:6870:d90:b0:1fa:dd91:1839 with SMTP id mj16-20020a0568700d9000b001fadd911839mr2198662oab.13.1702125430520; Sat, 09 Dec 2023 04:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702125430; cv=none; d=google.com; s=arc-20160816; b=Efql3bcOQcXQxUCx0qsJFD1m/dmHcGjgVYlD03e7CZE086VBjUpoa7zfMDBNdA6yaV bTGxv7Hl1cV1LO06+099j1DbetvnUYryVf+u6Rn+mQgU+lyRn4bkFd30OJXOIQi3G4hk A6lttohaPtiXy+K/HfikQOYn7xMLC6SVUC2Mu0CPAtLzpRVsJXXVsEjnbEbqeUnrnpHJ 4DWB33uEwz6X4lm9fR/K1o17p3D2jHUxTICm/coVcbUQH8h9F6zMdMX4AgOhUxI/9jNX qnBzILgDkAGOQAurZVwGRSjfP3CSUVgZN8mLd3p1LgEWA0Asx2uIp6UJbvAUab+Dtw2B 61cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8H4ZD3O2zM53FOpfQ60afkiHrSEs0SVvh7G9x7C42wA=; fh=3wOtCVUcvBrsL51U+yUhlochyUa73CpX1FOSR+cseNE=; b=Sw+sFIhKhYDwBwF4KDsVy/0vkSngxKF5aW59hbS07RYhbD5jDuHaYaKh7Vfbdkd3WP nPiaBgsjJDZRBH/Qomlht93Dp0j/DG70l7sBh8s7HylKWjP5SF45+rj7P9ZMOXAnGWbG wOFlIYvMnz4rnCPhRTbGbdHUq4G1bbuaiQmaDgl+Kh70Iey72JYkzHsTpDc49/ILehjC 1TK+GMh5+awPyg/KZpIJoVezeRsymFAuINpd0/ov/b3Rg7n4tptqLvG551rO3bnTO/eS ZTWv6mt1fP13QAJ3NCAsXQzhdPTyXEZSXuROVXTKISXyG5ES0Wlpus0gP5fXr9nna5pT 4z8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=R0ivJdUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z23-20020a656657000000b005c6b544c3d0si2980939pgv.534.2023.12.09.04.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 04:37:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=R0ivJdUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3DAB28061CEC; Sat, 9 Dec 2023 04:37:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbjLIMgk (ORCPT + 99 others); Sat, 9 Dec 2023 07:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbjLIMg0 (ORCPT ); Sat, 9 Dec 2023 07:36:26 -0500 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7DD10DF for ; Sat, 9 Dec 2023 04:36:31 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id BwZ7rbI0E6wd8BwZFre9vu; Sat, 09 Dec 2023 13:36:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702125391; bh=8H4ZD3O2zM53FOpfQ60afkiHrSEs0SVvh7G9x7C42wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R0ivJdUOrY6nEVb3Z2TcN+w3sallr2i/MWL/1LqnVQhXgXfiaYQPJTsEblBGh6LYw jCOhxqfxgkYyGsYcexTGlh+Gtg5aH+THs0dTjbssiif/t81aC6vuPLtzJTQWZaTB/8 iiCtD/mnGj7kUxMgASTZmka7MpYUB0J8sbHopyG9Am/VRPqRQKjOHSjfL8gRKkhMgo FpPy/OpDlOZ2SLxTejJ9TVw+JYWolOCknirLcQ610e3MRTgASocZ9TeCdbNyXK8WUs 49mJ1Bo5D1g8JUUyxDVY6XQDZGElEwL44q8mAghOKQibFDNB+Ry1dvd9sTv5LiV7yu PjHiT91ixwZng== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 09 Dec 2023 13:36:28 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Kees Cook Subject: [PATCH v2 2/2] VMCI: Remove VMCI_HANDLE_ARRAY_HEADER_SIZE and VMCI_HANDLE_ARRAY_MAX_CAPACITY Date: Sat, 9 Dec 2023 13:36:15 +0100 Message-Id: <00547fe74efe329b266eb8074c41f286758a3c64.1702125347.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <84e7f2d8e7c4c2eab68f958307d56546978f76e3.1702125347.git.christophe.jaillet@wanadoo.fr> References: <84e7f2d8e7c4c2eab68f958307d56546978f76e3.1702125347.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 09 Dec 2023 04:37:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784807875667191371 X-GMAIL-MSGID: 1784807875667191371 Remove VMCI_HANDLE_ARRAY_HEADER_SIZE and VMCI_HANDLE_ARRAY_MAX_CAPACITY that are unused. Suggested-by: Kees Cook Signed-off-by: Christophe JAILLET Reviewed-by: Kees Cook --- Changes in v2: - no change in code - add R-b v1: https://lore.kernel.org/all/c2a231a5ea127b28b5d8c4e86ef471dd01069d47.1702068153.git.christophe.jaillet@wanadoo.fr/ --- drivers/misc/vmw_vmci/vmci_handle_array.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/misc/vmw_vmci/vmci_handle_array.h b/drivers/misc/vmw_vmci/vmci_handle_array.h index b0e6b1956014..27a38b97e8a8 100644 --- a/drivers/misc/vmw_vmci/vmci_handle_array.h +++ b/drivers/misc/vmw_vmci/vmci_handle_array.h @@ -20,14 +20,8 @@ struct vmci_handle_arr { struct vmci_handle entries[] __counted_by(capacity); }; -#define VMCI_HANDLE_ARRAY_HEADER_SIZE \ - offsetof(struct vmci_handle_arr, entries) /* Select a default capacity that results in a 64 byte sized array */ #define VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY 6 -/* Make sure that the max array size can be expressed by a u32 */ -#define VMCI_HANDLE_ARRAY_MAX_CAPACITY \ - ((U32_MAX - VMCI_HANDLE_ARRAY_HEADER_SIZE - 1) / \ - sizeof(struct vmci_handle)) struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity); void vmci_handle_arr_destroy(struct vmci_handle_arr *array);