Re: PCI: mvebu: return NULL instead of ERR_PTR(ret)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 26, 2013 at 02:31:44PM +0900, Jingoo Han wrote:

> Previously, I sent the patch in order to fix sparse warning as below:
> How about this?
> 
> static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
> 			struct device_node *np, struct mvebu_pcie_port *port)
> {
> 	struct resource regs;
> 	int ret = 0;
> 
> 	ret = of_address_to_resource(np, 0, &regs);
> 	if (ret)
> -		return ERR_PTR(ret);
> +		return (void __iomem *)ERR_PTR(ret);

You should probably ask the sparse folks for guidance 'git grep
iomem.*ERR_PTR' returns nothing, so this isn't an established pattern.

It seems like sparse should know that ERR_PTR functions can work with
any pointer no matter the type? IS_ERR_PTR will have the same problem
with implicitly dropping the iomem tag.

Regards,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux