lkml.org 
[lkml]   [2008]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/5] Clocklib: add generic framework for managing clocks.
    On Tue, 15 Apr 2008 13:34:51 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:

    > On Mon, Apr 14, 2008 at 11:13:30PM -0700, Andrew Morton wrote:
    > > On Sun, 13 Apr 2008 18:43:12 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
    > >
    > > > +#define FUNC_TO_CLK(func) &(&(struct clk_function) func)->clk
    > >
    > > scratched my head for a while, was unable to work out what this does.
    > > It is unused, so I think it can be zapped?
    >
    > It take clk_function and returns pointer to the contained struct clk.

    Then why does it cast a clk_function to a clk_function?

    The innermost `&' hurts my brain.

    > I used it to be able to write things like:
    >
    > static struct clk *clks[] = {
    > [TC6387XB_CLK_MMC] = FUNC_TO_CLK(MFD_CLK_FUNC(NULL, "MMCCLK",
    > &tc6387xb_cells[TC6387XB_CELL_MMC])),
    > };
    >

    erm, if you say so. Is this as simple and clear as we can possibly make it?


    \
     
     \ /
      Last update: 2008-04-15 11:51    [W:0.019 / U:49.088 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site