From patchwork Fri Dec 8 20:46:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 176029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5710683vqy; Fri, 8 Dec 2023 12:47:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHD9Fc177SjE6AWANmhDL2bTLjuVEIW9aBWxaIjkWrrtiqYl91iRhr9M7MpuYVs1ThD0ULG X-Received: by 2002:a05:6a21:3298:b0:18f:97c:6149 with SMTP id yt24-20020a056a21329800b0018f097c6149mr664636pzb.70.1702068424765; Fri, 08 Dec 2023 12:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702068424; cv=none; d=google.com; s=arc-20160816; b=AJ74B2ttCB3ryJZ+0+lDZFWgw47WxRi4mKHEsOehfsbtMN98/TRfAQ5EWd/3cZ8PXM IjDz+G4vpx/pbYmnThhGv0xKYSkfZ8z8KYeUB8V5WXY+gNj6vVD2sRZ7KuZEucQArPJr qYbMibTZALdEYt1ElkXG/N/hgdYm1VnJoYj+0f8CZxXjrKzhXHgIwGtbTw4ZNok1Fp29 F2vEQWtMP/KVuLKP8QxwVg5TiXPA0yBW/XbJDjWs6t8DpfEuPXHe9xCN5OISWUKLI24g 3la4XrEOkdjSGI5fyq33GoXUhZw6FWt8wfyeRMekuw3S0m8v1XY+Drh2xJ3JxLfPffsM 8ekw== 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=OUm2hzTidMbVdw5ax/yHOZYECAzHPDWlYlnEDUQbJ6E=; fh=3wOtCVUcvBrsL51U+yUhlochyUa73CpX1FOSR+cseNE=; b=eVpz44gOvuMrtLn1UQ/e8JJ+bvb3pFBlc+nMU5U6k5jYo9QqTQqycEKMbryBJRaWUk mZY6AZDtI1YgjRB1puUGV2xOHoezqOrXyp0XKNUdwDpMOCYmAoEo74dUkEdXOOrAkH41 tCpl97fnh0dVAYorVY+lb69DG6hUXUo3MXmvg4I1Gz0C3WrWgairaBMyN5skfBdc0vT4 tqnkAS0XQgJm+UaRnl526gn2rUSoQgPYwGFe0dQLYgDAku8rq4POwe7yTKhkepIXVKR2 uqQGhq2PlpwrAUrCJjYcFXVMHYzcfG3DId+w+6s0EhLBd67VTueaKa4xOuz7QRkenFPX iWLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=eDRVITlZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v7-20020a655687000000b00589884fef91si2020271pgs.740.2023.12.08.12.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 12:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=eDRVITlZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id C8BF880E6F9B; Fri, 8 Dec 2023 12:47:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574757AbjLHUqW (ORCPT + 99 others); Fri, 8 Dec 2023 15:46:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235943AbjLHUqS (ORCPT ); Fri, 8 Dec 2023 15:46:18 -0500 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349F119A3 for ; Fri, 8 Dec 2023 12:46:24 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id BhjkrXIBfToaHBhjrr2fhc; Fri, 08 Dec 2023 21:46:23 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702068384; bh=OUm2hzTidMbVdw5ax/yHOZYECAzHPDWlYlnEDUQbJ6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eDRVITlZravmpDCqVEtKjoVG/CMGGLp20GLTLwVo/LflmiG3NNaPOOQlAGfd29KCP wgg8XW//4KTUZVX0hVOcxlorSgosDdTLSuvmDIgpAEB7BoZ2rZHQowvuGfCEObI/vm f0Nw4O9zwclo1iVHjfeUYWKqFl1UwiM9tOhF5cVHRUUBcibJW7wVipBdIfNDPg9sTz 8JSFq3LaLDdsi4HBpFOnlFo6Xv9ptREmVJuZDHOaxI+HCxDCx5icQwjkA7yf/KeNAD al34aO70NpNPYuUUkmdOgk2P98Vzfdwu8RZ1J1btEqLIHqMZ/GfqSDej9fs7j9ujBI fTdnw4DoPdM4g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 08 Dec 2023 21:46:24 +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 2/2] VMCI: Remove VMCI_HANDLE_ARRAY_HEADER_SIZE and VMCI_HANDLE_ARRAY_MAX_CAPACITY Date: Fri, 8 Dec 2023 21:46:10 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 12:47:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784748100753339953 X-GMAIL-MSGID: 1784748100753339953 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 --- 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);