[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1009021617500.410@eddie.linux-mips.org>
Date: Thu, 2 Sep 2010 16:20:34 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...ux-mips.org>
To: Grant Likely <grant.likely@...retlab.ca>
cc: Andy Fleming <afleming@...escale.com>,
netdev <netdev@...r.kernel.org>, linuxppc-dev@...ts.ozlabs.org
Subject: Re: ERR_PTR pattern in phylib
On Wed, 1 Sep 2010, Grant Likely wrote:
> I've been looking at the phylib code, and specifically at the use of
> the ERR_PTR() pattern. I'm personally not a big fan of ERR_PTR()
> because the compiler cannot type check the result and it runs
> completely counter to the pattern "if (!ptr)" than is common for
> testing a pointer return value.
Arguably using a union here would make things cleaner and any reasonable
ABI will place small unions used as arguments or return values in
registers, but I'm not sure if the cost of the rewrite is worth the
benefit. Probably not, but feel free to propose a change.
Maciej
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists