lkml.org 
[lkml]   [2007]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH 2.6.20] isdn-capi: Use ARRAY_SIZE macro when appropriate
    From
    Hi all,

    A patch to use ARRAY_SIZE macro already defined in kernel.h

    Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
    ---
    capi.c | 4 ++--
    capidrv.c | 4 ++--
    2 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
    index d22c022..3804591 100644
    --- a/drivers/isdn/capi/capi.c
    +++ b/drivers/isdn/capi/capi.c
    @@ -1456,7 +1456,7 @@ static struct procfsentries {

    static void __init proc_init(void)
    {
    - int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
    + int nelem = ARRAY_SIZE(procfsentries);
    int i;

    for (i=0; i < nelem; i++) {
    @@ -1468,7 +1468,7 @@ static void __init proc_init(void)

    static void __exit proc_exit(void)
    {
    - int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
    + int nelem = ARRAY_SIZE(procfsentries);
    int i;

    for (i=nelem-1; i >= 0; i--) {
    diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
    index c4d438c..8cec9c3 100644
    --- a/drivers/isdn/capi/capidrv.c
    +++ b/drivers/isdn/capi/capidrv.c
    @@ -2218,7 +2218,7 @@ static struct procfsentries {

    static void __init proc_init(void)
    {
    - int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
    + int nelem = ARRAY_SIZE(procfsentries);
    int i;

    for (i=0; i < nelem; i++) {
    @@ -2230,7 +2230,7 @@ static void __init proc_init(void)

    static void __exit proc_exit(void)
    {
    - int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]);
    + int nelem = ARRAY_SIZE(procfsentries);
    int i;

    for (i=nelem-1; i >= 0; i--) {
    --
    Ahmed S. Darwish
    http://darwish-07.blogspot.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-02-06 17:07    [W:0.024 / U:0.316 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site