Catégorie : Linux

ARRAY_SIZE changes

Author: Stoyan Gaydarov <sgayda2@uiuc.edu> These changes were a direct result of using a semantic patch More information can be found at http://www.emn.fr/x-info/coccinelle/ Signed-off-by: Stoyan Gaydarov Signed-off-by: Jesper Nilsson — arch/cris/arch-v32/mach-a3/io.c | 2 +- arch/cris/arch-v32/mach-fs/io.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)   diff –git a/arch/cris/arch-v32/mach-a3/io.c b/arch/cris/arch-v32/mach-a3/io.c index c22f67e..090ceb9 100644 — a/arch/cris/arch-v32/mach-a3/io.c +++ …

Lire la suite

V4L/DVB (12478): ARRAY_SIZE changes

Author: Mauro Carvalho Chehab <mchehab@redhat.com> These changes were a direct result of using a semantic patch More information can be found at http://www.emn.fr/x-info/coccinelle/ [mchehab@redhat.com: fix a merge conflict] Signed-off-by: Stoyan Gaydarov Signed-off-by: Mauro Carvalho Chehab — drivers/media/video/gspca/conex.c | 2 +- drivers/media/video/gspca/etoms.c | 4 ++– drivers/media/video/gspca/spca501.c | 2 +- drivers/media/video/gspca/spca506.c | 2 +- drivers/media/video/gspca/sunplus.c | 4 …

Lire la suite

Staging: ARRAY_SIZE changes

Author: Stoyan Gaydarov <sgayda2@uiuc.edu> These changes were a direct result of using a semantic patch More information can be found at http://www.emn.fr/x-info/coccinelle/ Signed-off-by: Stoyan Gaydarov Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/amplc_pci230.c | 2 +- drivers/staging/comedi/drivers/cb_das16_cs.c | 2 +- drivers/staging/comedi/drivers/das08_cs.c | 3 +– drivers/staging/comedi/drivers/ni_6527.c | 2 +- drivers/staging/comedi/drivers/ni_65xx.c | 2 +- drivers/staging/comedi/drivers/ni_660x.c | 2 +- drivers/staging/comedi/drivers/ni_670x.c | …

Lire la suite

powerpc: ARRAY_SIZE changes in pasemi and powermac code

Author: Stoyan Gaydarov <sgayda2@uiuc.edu> These changes were a direct result of using a semantic patch More information can be found at http://www.emn.fr/x-info/coccinelle/ Signed-off-by: Stoyan Gaydarov Signed-off-by: Benjamin Herrenschmidt — arch/powerpc/platforms/pasemi/idle.c | 2 +- arch/powerpc/platforms/powermac/feature.c | 4 ++– 2 files changed, 3 insertions(+), 3 deletions(-)   diff –git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c index 43911d8..75b296b 100644 — a/arch/powerpc/platforms/pasemi/idle.c +++ …

Lire la suite

V4L/DVB (12477): Use dst_type field instead of type_flags

Author: Julia Lawall <julia@diku.dk> It seems from other code that it is the dst_type field rather than the type_flags field that contains values of the form DST_TYPE_IS… The type_flags field contains values of the form DST_TYPE_HAS… The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct dst_state E; @@ ( *E.type_flags …

Lire la suite

specialix.c: convert nested spin_lock_irqsave to spin_lock

Author: Julia Lawall <julia@diku.dk> If spin_lock_irqsave is called twice in a row with the same second argument, the interrupt state at the point of the second call overwrites the value saved by the first call. Indeed, the second call does not need to save the interrupt state, so it is changed to a simple spin_lock. …

Lire la suite

USB: storage: Drop an unneeded a NULL test

Author: Julia Lawall <julia@diku.dk> In each case, the NULL test is not necessary because the function is static and at the only places where it is called, the us argument has already been dereferenced. The semantic patch that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; expression E,E1; identifier i,fld; statement S; …

Lire la suite

HID: Move dereferences below a NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test is necessary, then the dereferences should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; expression E,E1; identifier i,fld; statement S; @@ – T i = E->fld; + T i; … when != E=E1 when …

Lire la suite

drivers/net: Move a dereference below a NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test is necessary, then the dereferences should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; expression E,E1; identifier i,fld; statement S; @@ – T i = E->fld; + T i; … when != E=E1 when …

Lire la suite

drivers/net/mlx4: Adjust constant

Author: Julia Lawall <julia@diku.dk> The values in the advertising field are typically ADVERTISED_xxx, not SUPPORTED_xxx. Both SUPPORTED_10000baseT_Full and ADVERTISED_1000baseT_Full have the same value. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct ethtool_cmd E; @@ *E.advertising = SUPPORTED_10000baseT_Full // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — drivers/net/mlx4/en_ethtool.c | 2 …

Lire la suite