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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A6921CD11C2 for ; Fri, 5 Apr 2024 08:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=3tHguLIAV3xW9u6LIGiUanYV7Q2BS8swvENc6oqpm+0=; b=QCwiGjR21CuWpI 0bRQqLizLvumhVQhE6E6mIGHnxXip58CiG1VSROxIzI2yuRMSwgE/BguJgelA5aoEpQtG/W3gm60F d1hCyZ7IMJC0hrYmlk2pfOV8OBbe0D0boAoW5yBTIbxgU6hf6WmQ01y5mk0pX9ky1SbS249o6lphZ bgAESwVYqs1QGroUVL5P7oTJOHhtbgmcGb7RSo7a2aZPTIKta2FNIyyFZWkutLtu54EWL4P1YPta/ 9i6/ErWg8vQ7F0Q9wxvsO5aFgcqbPwSFyz+zPxRJ6RFP+5DwnIXIsIApBM49yST7xhhBDrxHyvx76 zO2Hz0evAvyFlOi6LhNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsf62-00000005yXj-1YPO; Fri, 05 Apr 2024 08:38:50 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsf5x-00000005yTH-3vgD for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2024 08:38:47 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-56c5d05128dso2262491a12.0 for ; Fri, 05 Apr 2024 01:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712306320; x=1712911120; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ubTb0fgVnrfBS5bggRD1QN9w4aDFQXkPd91AMrgys1Q=; b=Z/Dq8ZSDlBw04SF9RpwvxP42MM/tootGf2yergabugnqP+Ar2LTuj2Sj6bWb/uIkra IpOu7HPdX1tVFvnlI4RF8eL3d1nIerUyVfgA6mTHfJBIvVNfFfIvIiZ/YQMZP/aM5M0n BirYt+vscZ54MPSG9+yPLBrVSHoKSgTXRB+LKw/jqjtOp1ABeJt20fwSkb+BQzCPKLUT /bwhYp0XBzirPDAvPVl7LJJqAeBFpE1YCxTqLQpoHfTi53airkrGWVLdjYp6bJniqNvz GjaM/pIP2jetyTT00Avb3QU0+VWEMA66V3jT4UXrtt8T+ZpilsrfB3sLQ7Bt1RBU+Pfl yhqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712306320; x=1712911120; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ubTb0fgVnrfBS5bggRD1QN9w4aDFQXkPd91AMrgys1Q=; b=WExOMjaa9cak2BlCbtvYuLBToCn9/0elk6wwxD9WVrZql8u8Kh0OAx82j5k7Y0PfYs heTdLZAJcwp84V+bG6TIrqksgIjnSVZy7+BbldPEaoRJj59rzsFVGjRysQHeDtCESrVr 0lGqO/JB+2YrJIGVAPG2iqyvxe0IixfavSyNOqnxC3Q9ddhlaPS9BfvWI3WwBNJuBCzl 0M2tPeIHv8VFdBIVOnZI/hQ7evkSQq758B8HFApINPo6FzTDtlNqGd4g5v5Jl3K7c2OO t0ZAQpxXARtKHBQ3eF4dzUpnfRL8tk57lBO5DE0VosoF67R6SzaeDJoIIFiGq2HF8GUc 03SQ== X-Forwarded-Encrypted: i=1; AJvYcCVd+VYLsJp4rXjnpsSNvn2umUqA/u6+HJpFkr4m6SadRRcyyJEJYpNj6v7keDd4dygqVgTJtz68/nlbYIN2VWRh8tUqDst5OYJHSVkXPwfTrTTY4gY= X-Gm-Message-State: AOJu0YzDILvBdne8IE0ah2XUVjkh6CRSCFq6jHjKmSOyIcPR9JzTSJtC RfqaPnRuSLYzxLOiRzVl7ma9iqf4oFp3FYRgwFUuQLLCGB0tYYTTC48Q433NLOCY8AZ4QmYQ/hs k X-Google-Smtp-Source: AGHT+IEbsXOh/N7WNWmlYpCZzHx5wkzHFgy5SzPZtE5tZZGTZhrkAvGSYXBlZD3FtsmRpsA6biQgGQ== X-Received: by 2002:a17:906:2798:b0:a45:e3ab:152f with SMTP id j24-20020a170906279800b00a45e3ab152fmr499838ejc.21.1712306319804; Fri, 05 Apr 2024 01:38:39 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ci25-20020a170906c35900b00a4e2ad2cef0sm570122ejb.203.2024.04.05.01.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 01:38:39 -0700 (PDT) Date: Fri, 5 Apr 2024 11:38:35 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Damien Le Moal , Manivannan Sadhasivam , Lorenzo Pieralisi , Kishon Vijay Abraham I , Shawn Lin , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Heiko Stuebner , linux-pci@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Rick Wertenbroek , Wilfred Mallawa , Niklas Cassel Subject: Re: [PATCH v2 02/18] PCI: endpoint: Introduce pci_epc_map_align() Message-ID: <2b9ad9b2-c5df-4364-99cb-c2b41cdfee52@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240330041928.1555578-3-dlemoal@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240405_013846_072209_F74C22E7 X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Damien, kernel test robot noticed the following build warnings: https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Damien-Le-Moal/PCI-endpoint-Introduce-pci_epc_function_is_valid/20240330-122311 base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next patch link: https://lore.kernel.org/r/20240330041928.1555578-3-dlemoal%40kernel.org patch subject: [PATCH v2 02/18] PCI: endpoint: Introduce pci_epc_map_align() config: parisc-randconfig-r071-20240405 (https://download.01.org/0day-ci/archive/20240405/202404051508.hvNRDVZq-lkp@intel.com/config) compiler: hppa-linux-gcc (GCC) 13.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202404051508.hvNRDVZq-lkp@intel.com/ smatch warnings: drivers/pci/endpoint/pci-epc-core.c:493 pci_epc_map_align() error: we previously assumed 'features' could be null (see line 487) vim +/features +493 drivers/pci/endpoint/pci-epc-core.c 9d2f10d2ace040 Damien Le Moal 2024-03-30 458 int pci_epc_map_align(struct pci_epc *epc, u8 func_no, u8 vfunc_no, 9d2f10d2ace040 Damien Le Moal 2024-03-30 459 u64 pci_addr, size_t size, struct pci_epc_map *map) 9d2f10d2ace040 Damien Le Moal 2024-03-30 460 { 9d2f10d2ace040 Damien Le Moal 2024-03-30 461 const struct pci_epc_features *features; 9d2f10d2ace040 Damien Le Moal 2024-03-30 462 size_t mask; 9d2f10d2ace040 Damien Le Moal 2024-03-30 463 int ret; 9d2f10d2ace040 Damien Le Moal 2024-03-30 464 9d2f10d2ace040 Damien Le Moal 2024-03-30 465 if (!pci_epc_function_is_valid(epc, func_no, vfunc_no)) 9d2f10d2ace040 Damien Le Moal 2024-03-30 466 return -EINVAL; 9d2f10d2ace040 Damien Le Moal 2024-03-30 467 9d2f10d2ace040 Damien Le Moal 2024-03-30 468 if (!size || !map) 9d2f10d2ace040 Damien Le Moal 2024-03-30 469 return -EINVAL; 9d2f10d2ace040 Damien Le Moal 2024-03-30 470 9d2f10d2ace040 Damien Le Moal 2024-03-30 471 memset(map, 0, sizeof(*map)); 9d2f10d2ace040 Damien Le Moal 2024-03-30 472 map->pci_addr = pci_addr; 9d2f10d2ace040 Damien Le Moal 2024-03-30 473 map->pci_size = size; 9d2f10d2ace040 Damien Le Moal 2024-03-30 474 9d2f10d2ace040 Damien Le Moal 2024-03-30 475 if (epc->ops->map_align) { 9d2f10d2ace040 Damien Le Moal 2024-03-30 476 mutex_lock(&epc->lock); 9d2f10d2ace040 Damien Le Moal 2024-03-30 477 ret = epc->ops->map_align(epc, func_no, vfunc_no, map); 9d2f10d2ace040 Damien Le Moal 2024-03-30 478 mutex_unlock(&epc->lock); 9d2f10d2ace040 Damien Le Moal 2024-03-30 479 return ret; 9d2f10d2ace040 Damien Le Moal 2024-03-30 480 } 9d2f10d2ace040 Damien Le Moal 2024-03-30 481 9d2f10d2ace040 Damien Le Moal 2024-03-30 482 /* 9d2f10d2ace040 Damien Le Moal 2024-03-30 483 * Assume a fixed alignment constraint as specified by the controller 9d2f10d2ace040 Damien Le Moal 2024-03-30 484 * features. 9d2f10d2ace040 Damien Le Moal 2024-03-30 485 */ 9d2f10d2ace040 Damien Le Moal 2024-03-30 486 features = pci_epc_get_features(epc, func_no, vfunc_no); 9d2f10d2ace040 Damien Le Moal 2024-03-30 @487 if (!features || !features->align) { ^^^^^^^^^ Check for NULL 9d2f10d2ace040 Damien Le Moal 2024-03-30 488 map->map_pci_addr = pci_addr; 9d2f10d2ace040 Damien Le Moal 2024-03-30 489 map->map_size = size; 9d2f10d2ace040 Damien Le Moal 2024-03-30 490 map->map_ofst = 0; Missing return 0? 9d2f10d2ace040 Damien Le Moal 2024-03-30 491 } 9d2f10d2ace040 Damien Le Moal 2024-03-30 492 9d2f10d2ace040 Damien Le Moal 2024-03-30 @493 mask = features->align - 1; ^^^^^^^^^^ 9d2f10d2ace040 Damien Le Moal 2024-03-30 494 map->map_pci_addr = map->pci_addr & ~mask; 9d2f10d2ace040 Damien Le Moal 2024-03-30 495 map->map_ofst = map->pci_addr & mask; 9d2f10d2ace040 Damien Le Moal 2024-03-30 496 map->map_size = ALIGN(map->map_ofst + map->pci_size, features->align); 9d2f10d2ace040 Damien Le Moal 2024-03-30 497 9d2f10d2ace040 Damien Le Moal 2024-03-30 498 return 0; 9d2f10d2ace040 Damien Le Moal 2024-03-30 499 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel