[alsa-devel] [PATCH 14/39] firewire-lib: Add handling output connection by CMP
Takashi Sakamoto
o-takashi at sakamocchi.jp
Mon Mar 10 13:30:10 CET 2014
(Mar 10 2014 06:27), Clemens Ladisch wrote:
> This function is always used with a constant master parameter, and the
> two branches don't really share much code. Two functions would be simpler:
>
> static u64 mpr_address(struct cmp_connection *c)
> {
> if (c->direction == CMP_INPUT)
> return CSR_REGISTER_BASE + CSR_IMPR;
> else
> return CSR_REGISTER_BASE + CSR_OMPR;
> }
>
> static u64 pcr_address(struct cmp_connection *c)
> {
> if (c->direction == CMP_INPUT)
> return CSR_REGISTER_BASE + CSR_IPCR(c->pcr_index);
> else
> return CSR_REGISTER_BASE + CSR_OPCR(c->pcr_index);
> }
This is a good idea.
Takashi Sakamoto
o-takashi at sakamocchi.jp
More information about the Alsa-devel
mailing list