From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 010A9C369C2 for ; Mon, 21 Apr 2025 14:08:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9FCE140355; Mon, 21 Apr 2025 14:08:47 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tw3vuQHaxKVh; Mon, 21 Apr 2025 14:08:47 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0B14C403C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1745244527; bh=YrTSPXG4k0Hzwi1ZGTug3BljLO15RmvDpt449VgiKKU=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aGcedaLCQFqK9zYici/LQ3x0gQhjQj7i9z4qCg87xuGMRjcW9WJxJNKSJ53cX3dPp LOfjsYW4bPXRmGWgR/Lfmdtl01Yn39CiHCmMvSQ4+HhIsXR7smvx/j7r32sg9ovqWf 0b2imqoVO3wxOnKv0xj6tlvekJcNlWOqhrINrBH88TEowYGqFkfHU+n9wRrNTY6M1r uKeu9QwPGUDhrSjx8T+lJkYJCAEWVYWuah7QPxbR/+6cB0XZJujuBFEIudg7ZE4avP TRl6rsAeqfV0c4SHBGYfmqnQgzM6ncu6J72fmPiTr0wNZOiHMf8m5OpS2oL8cyrIrA tF1Kph9dM36fw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 0B14C403C1; Mon, 21 Apr 2025 14:08:47 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 6EDF91A0 for ; Mon, 21 Apr 2025 14:08:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 604D740355 for ; Mon, 21 Apr 2025 14:08:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YHpp3ZEjP4u6 for ; Mon, 21 Apr 2025 14:08:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 94EBD403C1 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 94EBD403C1 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp4.osuosl.org (Postfix) with ESMTPS id 94EBD403C1 for ; Mon, 21 Apr 2025 14:08:45 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C1BF060008; Mon, 21 Apr 2025 14:08:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EA64C4CEE4; Mon, 21 Apr 2025 14:08:38 +0000 (UTC) Date: Mon, 21 Apr 2025 15:08:36 +0100 From: Simon Horman To: Larysa Zaremba Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Przemek Kitszel , Jiri Pirko , Mustafa Ismail , Tatyana Nikolova , Andrew Lunn , Alexander Lobakin , Michael Ellerman , Maciej Fijalkowski , Lee Trager , Madhavan Srinivasan , Sridhar Samudrala , Jacob Keller , Michal Swiatkowski , Mateusz Polchlopek , Wenjun Wu , Ahmed Zaki , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Emil Tantilov , Madhu Chittim , Josh Hay , Milena Olech , pavan.kumar.linga@intel.com, "Singhai, Anjali" , Phani R Burra Message-ID: <20250421140836.GH2789685@horms.kernel.org> References: <20250408124816.11584-1-larysa.zaremba@intel.com> <20250408124816.11584-4-larysa.zaremba@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250408124816.11584-4-larysa.zaremba@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745244524; bh=y+u9o3uYT+ExmvtSXbLZr8bAFVgoBqK/gneBhs8PZLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ee9IrGNVBY468I0nIZFGOEwSSO4iJvmV3Vd8XmWujePOkW+RQw0qoTf5gPE74TnZX C8qwUs7dBOH7vUuZLAMHPY+whZ5y16Alj+g6qhK4NH9aSW8/lQwyAugMGUmHKBPgkX Ts1mQDeM8F3kFazN6V7zQoAIWI9/BkSajNLajuJFM0ROiLpWxVBeDRz0eNKGLZmJSl jLi7vAzRyzF0K2AP8N2qSWfhDO6AFW5+6nFbaFugRIYCz8i1SYJEZgZLK5F91i+MwP 7PLXue2MFhNahQ6ie5tjBbSvEt2QfpqOrxjN8pZJABKrBwRH6YHk0J4IJEkLmDcQTW sZljmP2HBMWYw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ee9IrGNV Subject: Re: [Intel-wired-lan] [PATCH iwl-next 03/14] libeth: add PCI device initialization helpers to libeth X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Apr 08, 2025 at 02:47:49PM +0200, Larysa Zaremba wrote: > From: Phani R Burra > > Add memory related support functions for drivers to access MMIO space and > allocate/free dma buffers. > > Reviewed-by: Maciej Fijalkowski > Signed-off-by: Phani R Burra > Co-developed-by: Victor Raj > Signed-off-by: Victor Raj > Co-developed-by: Sridhar Samudrala > Signed-off-by: Sridhar Samudrala > Co-developed-by: Pavan Kumar Linga > Signed-off-by: Pavan Kumar Linga > Co-developed-by: Larysa Zaremba > Signed-off-by: Larysa Zaremba ... > diff --git a/drivers/net/ethernet/intel/libeth/pci.c b/drivers/net/ethernet/intel/libeth/pci.c ... > +/** > + * __libeth_pci_map_mmio_region - map PCI device MMIO region > + * @mmio_info: struct to store the mapped MMIO region > + * @offset: MMIO region start offset > + * @size: MMIO region size > + * @num_args: number of additional arguments present > + * > + * Return: true on success, false on memory map failure. > + */ > +bool __libeth_pci_map_mmio_region(struct libeth_mmio_info *mmio_info, > + resource_size_t offset, > + resource_size_t size, int num_args, ...) > +{ > + struct pci_dev *pdev = mmio_info->pdev; > + struct libeth_pci_mmio_region *mr; > + resource_size_t pa; > + void __iomem *va; > + int bar_idx = 0; > + va_list args; > + > + if (num_args) { > + va_start(args, num_args); > + bar_idx = va_arg(args, int); > + va_end(args); > + } > + > + mr = libeth_find_mmio_region(&mmio_info->mmio_list, offset, bar_idx); > + if (mr) { > + pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", > + bar_idx, offset); Hi Phani, Larysa, all, I think that the format specifier here should be %zu rather than %llu. On ARM W=1 builds gcc 14.2.0 flags this as follows: CALL scripts/checksyscalls.sh CC drivers/net/ethernet/intel/libeth/pci.o In file included from ./include/linux/device.h:15, from ./include/linux/pci.h:37, from ./include/net/libeth/pci.h:7, from drivers/net/ethernet/intel/libeth/pci.c:4: .../pci.c: In function '__libeth_pci_map_mmio_region': .../pci.c:92:32: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~ .../dev_printk.h:156:61: note: in expansion of macro 'dev_fmt' 156 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ .../pci.h:2704:41: note: in expansion of macro 'dev_warn' 2704 | #define pci_warn(pdev, fmt, arg...) dev_warn(&(pdev)->dev, fmt, ##arg) | ^~~~~~~~ .../pci.c:92:17: note: in expansion of macro 'pci_warn' 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ^~~~~~~~ .../pci.c:92:65: note: format string is defined here 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ~~~^ | | | long long unsigned int | %u From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2742DDBE; Mon, 21 Apr 2025 14:08:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745244525; cv=none; b=KdJedJzrhSfbWxOl86KZicaLU6Hsaj72euK8AaaqSndbLpR8VLEG+SHH3Kc97RQG1u/5TdNF5vPOftCsUsMQFxPzJZwaYRI3i8IO/AhV9sqjNZ/Vgz0LwN7jv6hCO/DCi5Ha3CWFEwl9FInruuUvuanXJSENI0bgt5pdhsSC0a0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745244525; c=relaxed/simple; bh=y+u9o3uYT+ExmvtSXbLZr8bAFVgoBqK/gneBhs8PZLk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=glRW3uMvVRee8JF1emTXrCF5XeV5m+hVP74PWYsOkaOmK2cXAXigSCefr69wbOxf3Hjf3eiJewMWP+k+3Jsg6k10nNC8b0ZJYCyYZHnLjGL4lTPYYAJ0xqtem8nQ0YrJyn9ZIv0a7Z0lv/ILLbp3jUP7bX+sN7QYadMaNKjmi+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ee9IrGNV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ee9IrGNV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EA64C4CEE4; Mon, 21 Apr 2025 14:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745244524; bh=y+u9o3uYT+ExmvtSXbLZr8bAFVgoBqK/gneBhs8PZLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ee9IrGNVBY468I0nIZFGOEwSSO4iJvmV3Vd8XmWujePOkW+RQw0qoTf5gPE74TnZX C8qwUs7dBOH7vUuZLAMHPY+whZ5y16Alj+g6qhK4NH9aSW8/lQwyAugMGUmHKBPgkX Ts1mQDeM8F3kFazN6V7zQoAIWI9/BkSajNLajuJFM0ROiLpWxVBeDRz0eNKGLZmJSl jLi7vAzRyzF0K2AP8N2qSWfhDO6AFW5+6nFbaFugRIYCz8i1SYJEZgZLK5F91i+MwP 7PLXue2MFhNahQ6ie5tjBbSvEt2QfpqOrxjN8pZJABKrBwRH6YHk0J4IJEkLmDcQTW sZljmP2HBMWYw== Date: Mon, 21 Apr 2025 15:08:36 +0100 From: Simon Horman To: Larysa Zaremba Cc: intel-wired-lan@lists.osuosl.org, Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Przemek Kitszel , Jiri Pirko , Mustafa Ismail , Tatyana Nikolova , Andrew Lunn , Alexander Lobakin , Michael Ellerman , Maciej Fijalkowski , Lee Trager , Madhavan Srinivasan , Sridhar Samudrala , Jacob Keller , Michal Swiatkowski , Mateusz Polchlopek , Wenjun Wu , Ahmed Zaki , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Emil Tantilov , Madhu Chittim , Josh Hay , Milena Olech , pavan.kumar.linga@intel.com, "Singhai, Anjali" , Phani R Burra Subject: Re: [PATCH iwl-next 03/14] libeth: add PCI device initialization helpers to libeth Message-ID: <20250421140836.GH2789685@horms.kernel.org> References: <20250408124816.11584-1-larysa.zaremba@intel.com> <20250408124816.11584-4-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250408124816.11584-4-larysa.zaremba@intel.com> On Tue, Apr 08, 2025 at 02:47:49PM +0200, Larysa Zaremba wrote: > From: Phani R Burra > > Add memory related support functions for drivers to access MMIO space and > allocate/free dma buffers. > > Reviewed-by: Maciej Fijalkowski > Signed-off-by: Phani R Burra > Co-developed-by: Victor Raj > Signed-off-by: Victor Raj > Co-developed-by: Sridhar Samudrala > Signed-off-by: Sridhar Samudrala > Co-developed-by: Pavan Kumar Linga > Signed-off-by: Pavan Kumar Linga > Co-developed-by: Larysa Zaremba > Signed-off-by: Larysa Zaremba ... > diff --git a/drivers/net/ethernet/intel/libeth/pci.c b/drivers/net/ethernet/intel/libeth/pci.c ... > +/** > + * __libeth_pci_map_mmio_region - map PCI device MMIO region > + * @mmio_info: struct to store the mapped MMIO region > + * @offset: MMIO region start offset > + * @size: MMIO region size > + * @num_args: number of additional arguments present > + * > + * Return: true on success, false on memory map failure. > + */ > +bool __libeth_pci_map_mmio_region(struct libeth_mmio_info *mmio_info, > + resource_size_t offset, > + resource_size_t size, int num_args, ...) > +{ > + struct pci_dev *pdev = mmio_info->pdev; > + struct libeth_pci_mmio_region *mr; > + resource_size_t pa; > + void __iomem *va; > + int bar_idx = 0; > + va_list args; > + > + if (num_args) { > + va_start(args, num_args); > + bar_idx = va_arg(args, int); > + va_end(args); > + } > + > + mr = libeth_find_mmio_region(&mmio_info->mmio_list, offset, bar_idx); > + if (mr) { > + pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", > + bar_idx, offset); Hi Phani, Larysa, all, I think that the format specifier here should be %zu rather than %llu. On ARM W=1 builds gcc 14.2.0 flags this as follows: CALL scripts/checksyscalls.sh CC drivers/net/ethernet/intel/libeth/pci.o In file included from ./include/linux/device.h:15, from ./include/linux/pci.h:37, from ./include/net/libeth/pci.h:7, from drivers/net/ethernet/intel/libeth/pci.c:4: .../pci.c: In function '__libeth_pci_map_mmio_region': .../pci.c:92:32: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=] 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~ .../dev_printk.h:156:61: note: in expansion of macro 'dev_fmt' 156 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ .../pci.h:2704:41: note: in expansion of macro 'dev_warn' 2704 | #define pci_warn(pdev, fmt, arg...) dev_warn(&(pdev)->dev, fmt, ##arg) | ^~~~~~~~ .../pci.c:92:17: note: in expansion of macro 'pci_warn' 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ^~~~~~~~ .../pci.c:92:65: note: format string is defined here 92 | pci_warn(pdev, "Mapping of BAR%u with offset %llu already exists\n", | ~~~^ | | | long long unsigned int | %u