Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp94290lqt; Wed, 5 Jun 2024 19:02:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjddhVTTbFW1HBSqyVHAftiaIrg6r/on8OTZ08hJFFGgkVu56sov6wVSB2W42aO1OH3idN9YaiqVo+4IRY2Dl0P6XhTyjG5jOwbkJ65A== X-Google-Smtp-Source: AGHT+IHsAyqczeIkV5TiUcNcxkaeCP6W+IMo0Mh80UQH8BhhD0iH2vHhwH77HP7AmRe3YFLDXGhG X-Received: by 2002:a05:622a:134a:b0:43a:fce1:f520 with SMTP id d75a77b69052e-4402b6e6fb2mr56150901cf.65.1717639369639; Wed, 05 Jun 2024 19:02:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717639369; cv=pass; d=google.com; s=arc-20160816; b=ighSmIiFqsTf46ccRMslC7FVBi1+Ay8CaSoN7vt/uyDJ8VDwRlWwUiusBlcNShkfIj qFVpN2hDv2PjPsRRi+BP8oXfvewWaxWHoWVWp9yavnuaPWPh2uP+5smy2gVj38sMis5O kg6rNBjdF51PpcwyFIASEs1iWCv+hZVmgxm2qIW6Sdce616fSTCPXP+5fLNacfGZZZlE IW0qwBq3/b70XAo85NgnJ8mRrttc9/Sg0esl8bm8LfwT+daDDm16Db8z7Oxa3N3SRJf6 09sz+0gsWtarisghwPcmk8km81OrqOy5mHK2L1Pp3hNypbdAHDtJVBSckSBydfY6H5tf L4Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=y2QdOJgbAl50VR+ODfvH7gZ+/T+swJOLHiP22D6L4FU=; fh=B3ZVVcoCFkdAoq0GeF+68eGRlpQ7ZMgPqV26gr9x+OQ=; b=QDwTTE0Rudj9BZp8TGwfaC7xouPDuBoIiEkEObhoUR0/Sd1D5xVN0/9lsfYHELXwr1 xMNPbRyhQBCuHHv25aTGFLFFHo8UKYxy/Icb5OyXLN4KMTlqNPxXzISTNls1IalXJJ+F UDyH9nC6OW/6jZb0PCSduNYdUh4TQyF6aPJIvABrRxm1ybLFgdufXUDCMaS5LUjgzVLC h4EGkjRWzeYtT/sywEUHfdEn7iW6Cn7JGMlBZ7yqq9sHVUxNbb3Xo/dvJSx4ZRTMI5c/ o7Zk1MiCo34ORRmh41A3BfOQFnzpeqw+YZ7ipnESRvWiiAXuny5aQuL9mTzu9grxbL62 XYhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UZ4Y8s4E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038a6ee32si5087831cf.124.2024.06.05.19.02.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 19:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UZ4Y8s4E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 5E1B01C216AF for ; Thu, 6 Jun 2024 02:02:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B784175AB; Thu, 6 Jun 2024 02:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UZ4Y8s4E" Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 24D3719D888; Thu, 6 Jun 2024 02:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717639361; cv=none; b=CAHI9szmjfOElTcvC2i5NeLndMMHNsBm1JPo5zDrxT5wurmhkEWWCUpHd0ovpml8/lKCZAoUsuo0u9l1itjVSjVWaBwOWfo+8gk7JX+fjQiYLwMmRuda7fAYrSAR+K7ktBuFsZ85w6AxdMu2yTgB8X9vSCMHbbyCMUwFCOkerWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717639361; c=relaxed/simple; bh=HnwwfAUgc11cwTfF//zRNuCOXe/nsNHF5nif1iH6+jM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LOtwmbs4QrAOdeFDPNeStyZiMask1vw1AYOriKLgWV2ZMhaaBAsYA5mdZGG551AmHZPGZ2GCux6SkvmB0YvDqxwLM0aUMsU8TcmERIsmYbxdMuuXO7mSQxXnSNxqd3gpY3vLU/JSqd7KwDA1NBEZpcy6wuSuC3CoAyC0BgAyLGA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UZ4Y8s4E; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-374a817a1efso879575ab.2; Wed, 05 Jun 2024 19:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717639359; x=1718244159; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y2QdOJgbAl50VR+ODfvH7gZ+/T+swJOLHiP22D6L4FU=; b=UZ4Y8s4EOegVNBR3Jk/S3WEQ0V/g9pk+coMMNr4yXBK3Om8vTA/qIQjdyvvdtv9/CN iesDWowlfBTxmf23jNIUtMkEeEuEqz6NsdyHr0IlU068v+QiGGzPtXQuPUx3sORIDQ0F hmQs/gSkqQW9murVKFIMubOxEcGoDBGbzw7bhD5VWJkbTj6b7nLXqAP33G9J/DvEgjw2 53HaxZBukoDhlNCtcBelCfrj+eV46rLwFFddslc8jxsAfb6PMJTGjVYqS7DTUJch4XnC qR0cSzXNt+z7AW+4kf5+LnKq2z2rMN07wY3pQOkPCWP49FUWQN09S3NZiFO1RG04xE37 2wcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717639359; x=1718244159; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y2QdOJgbAl50VR+ODfvH7gZ+/T+swJOLHiP22D6L4FU=; b=uOpX2kGuxB8JUUTtPEuy7xHbIcxFV1U4XbD5hdaci02JPZwmpy80/Pf53gBziEau6S 5oLA/KZtxCL6Ny2LnVb6tNUQoS+m6k1s+XcjOTfYxoDR0SutguHfknmIrXS16s0bhYTR B/IniYCnYO8NbbhnlyXAatm1YmF+/8JGnQKwp0PGnyHIJWIx3mSo1JdC3ZlSSjG3dr/9 Zq4HxjnfMmdl8e6xIdF3dYSUiEU9MgiWgNxxXMGHpC3BWfqPsnRDVbRkws1KejwxJEI6 YmWV5nllIcBh9BGyhIa5ssSVcKkN6iFx6vt4F9jICW9Xhq9HNtnKeaZOAVmZCAM+c8u1 blGQ== X-Forwarded-Encrypted: i=1; AJvYcCVs7+qxB8V+zKgzgqwxz4a0RXagi5Fq2p3UK+6TIBsu5oYd67W0REKvDFeyyzaYLSIh3sM6LTN4JGg4knMCMn/HgSfdwG2yiGa3R3B8xBKXkEq7n8Eq9CDIC1c80m86nKKJZJkPQmSym+c= X-Gm-Message-State: AOJu0Yx+r0b46tSBpNWiW00socqZ9TxABXaL6gUygz7kxLMdJ59bteYD WwMw7VmaVIBfHFEM8oTLZIUMZm9AZypi9dDofachNXfO2igHtFxt X-Received: by 2002:a92:ca0b:0:b0:374:a7d0:b0bc with SMTP id e9e14a558f8ab-374b1f3ee14mr47382305ab.23.1717639359104; Wed, 05 Jun 2024 19:02:39 -0700 (PDT) Received: from localhost.localdomain ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6de28f37482sm164515a12.94.2024.06.05.19.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 19:02:38 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, sumit.semwal@linaro.org Cc: Brian.Starkey@arm.com, benjamin.gaignard@collabora.com, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, jstultz@google.com, linux-kernel@vger.kernel.org, tjmercier@google.com, v-songbaohua@oppo.com, hailong.liu@oppo.com Subject: [PATCH] dma-buf/heaps: Correct the types of fd_flags and heap_flags Date: Thu, 6 Jun 2024 14:02:13 +1200 Message-Id: <20240606020213.49854-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Barry Song dma_heap_allocation_data defines the UAPI as follows: struct dma_heap_allocation_data { __u64 len; __u32 fd; __u32 fd_flags; __u64 heap_flags; }; But dma heaps are casting both fd_flags and heap_flags into unsigned long. This patch makes dma heaps - cma heap and system heap have consistent types with UAPI. Signed-off-by: Barry Song --- drivers/dma-buf/heaps/cma_heap.c | 4 ++-- drivers/dma-buf/heaps/system_heap.c | 4 ++-- include/linux/dma-heap.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 4a63567e93ba..c384004b918e 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -274,8 +274,8 @@ static const struct dma_buf_ops cma_heap_buf_ops = { static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, unsigned long len, - unsigned long fd_flags, - unsigned long heap_flags) + u32 fd_flags, + u64 heap_flags) { struct cma_heap *cma_heap = dma_heap_get_drvdata(heap); struct cma_heap_buffer *buffer; diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 9076d47ed2ef..d78cdb9d01e5 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -333,8 +333,8 @@ static struct page *alloc_largest_available(unsigned long size, static struct dma_buf *system_heap_allocate(struct dma_heap *heap, unsigned long len, - unsigned long fd_flags, - unsigned long heap_flags) + u32 fd_flags, + u64 heap_flags) { struct system_heap_buffer *buffer; DEFINE_DMA_BUF_EXPORT_INFO(exp_info); diff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h index 0c05561cad6e..064bad725061 100644 --- a/include/linux/dma-heap.h +++ b/include/linux/dma-heap.h @@ -23,8 +23,8 @@ struct dma_heap; struct dma_heap_ops { struct dma_buf *(*allocate)(struct dma_heap *heap, unsigned long len, - unsigned long fd_flags, - unsigned long heap_flags); + u32 fd_flags, + u64 heap_flags); }; /** -- 2.34.1