]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine/amba-pl08x: pass (*ptr) to sizeof() instead of (struct xyz)
authorViresh Kumar <viresh.kumar@st.com>
Fri, 5 Aug 2011 10:02:29 +0000 (15:32 +0530)
committerVinod Koul <vinod.koul@intel.com>
Thu, 25 Aug 2011 14:03:37 +0000 (19:33 +0530)
commit82720b1dd4ef4c4984ea18137168c081db713c4b
tree5050103fd6bb6eff77c6c0c7ce7ee51d25a78bcb
parent2f3c1fe2f577c6ab5f266aa0b01f36e851a13f7a
dmaengine/amba-pl08x: pass (*ptr) to sizeof() instead of (struct xyz)

As mentioned in Documentation/CodingStyle,

The preferred form for passing a size of a struct is the following:
   p = kmalloc(sizeof(*p), ...);

The alternative form where struct name is spelled out hurts readability and
introduces an opportunity for a bug when the pointer variable type is changed
but the corresponding sizeof that is passed to a memory allocator is not.

This patch replaces (struct xyz) with *ptr at several occurrences in driver.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/amba-pl08x.c