- Subject: Re: [PATCH V8 12/13] ptp: Added a clock driver for the IXP46x.
- From: Krzysztof Halasa <khc@xxxxxxxxx>
- Date: Sat, 08 Jan 2011 17:25:36 +0100
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Christoph Lameter <cl@xxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>, John Stultz <johnstul@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Rodolfo Giometti <giometti@xxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- In-reply-to: <20110107170752.GB8666@xxxxxxxxxxxxxxxxxxxxxx> (Richard Cochran's message of "Fri, 7 Jan 2011 18:07:52 +0100")
- References: <cover.1293820862.git.richard.cochran@xxxxxxxxxx> <8151196c018776704df34748f333bdb159497d0b.1293820862.git.richard.cochran@xxxxxxxxxx> <m3ei8plpa0.fsf@xxxxxxxxxxxxxxxxxxxx> <20110107170752.GB8666@xxxxxxxxxxxxxxxxxxxxxx>
Richard Cochran <richardcochran@xxxxxxxxx> writes:
> The time stamp code clones the skb, but the LE version frees the skb
> too early. Perhaps we can move that dev_kfree_skb(skb) in the LE case
> to be the last statement in eth_xmit(). What do you think?
I think so. Or something similar.
> Do you mean, you don't like the constant on the left hand side?
Yes.
> Is that prohibited by CodingStyle or similar?
I don't think so. It's just a personal taste. I think it's based on
things learned in primary school, they teach to write (comparisons)
X = 4 instead of the other way around, and my brain seems to shock
a bit on the opposite.
> I got into the habit of writing it that way to prevent a typo like:
>
> if (irq = NO_IRQ)
I see. Unfortunately it doesn't prevent typos like this when the right
side isn't a constant. Anyway gcc warns about them, even when both sides
are variable.
>> Also I don't like the ixp_read/ixp_write() trivial macros. Why not
>> simply call __raw_readl() and __raw_writel()?
>
> Well, I have had the experience back in 2.4 days of having my drivers
> ruined by the changing IO macros in the kernel. The wrappers are
> supposed to help if that ever happens again. Seeing *two* leading
> underscores in the macro names certainly makes me nervous.
Well, these two underscores mainly mean it's arch-dependent, but so are
the ixp4xx drivers. Using the __raw_read* directly is the preferred
method (or, perhaps, in such case, it's the only way).
Actually, I was thinking about changing the macros some time ago, and it
may eventually happen. But we'll fix all the code using them then.
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Home]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]