Category: Linux

Bluetooth: cmtp: Remove unnecessary null test

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the null test on ctrl. ctrl is initialized at the beginning of the function to &session->ctrl. Since session is dereferenced prior to the null test, session must be a valid pointer, and &session->ctrl cannot be null. The following Coccinelle script is used for detecting the change: @r@ expression …

Continue reading

net: set name_assign_type in alloc_netdev()

Author: Tom Gundersen <teg@jklm.no> Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert all users to pass NET_NAME_UNKNOWN. Coccinelle patch: @@ expression sizeof_priv, name, setup, txqs, rxqs, count; @@ ( -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs) +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs) | -alloc_netdev_mq(sizeof_priv, name, setup, count) +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count) | -alloc_netdev(sizeof_priv, name, setup) …

Continue reading

drm/i915: Make use of intel_fb_obj() (v2)

Author: Matt Roper <matthew.d.roper@intel.com> This should hopefully simplify the display code slightly and also solves at least one mistake in intel_pipe_set_base() where to_intel_framebuffer(fb)->obj is referenced during local variable initialization, before ‘if (!fb)’ gets checked. Potential uses of this macro were identified via the following Coccinelle patch: @@ expression E; @@ * to_intel_framebuffer(E)->obj @@ expression E; …

Continue reading

thunderbolt: Correct the size argument to devm_kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> nhi->rx_rings does not have type as struct tb_ring *, as it is a double pointer so the elements of the array should have pointer type, not structure type. The Coccinelle semantic patch that makes this change is as follows: // @disable sizeof_type_expr@ type T; T **x; @@ x = // Signed-off-by: …

Continue reading

drm/i915: Emphasize that ctx->obj & ctx->is_initialized refer to the legacy rcs ctx

Author: Oscar Mateo <oscar.mateo@intel.com> We have already advanced that Logical Ring Contexts have their own kind of backing objects, but everything will be better explained in the Execlists series. For now, suffice it to say that the current backing object is only ever used with the render ring, so we’re making this fact more explicit …

Continue reading

staging: ced1401: Add void declarations in zero-arg functions.

Author: Chi Pham <fempsci@gmail.com> Added explicit void declarations to zero-argument function headers. The following coccinelle script was used: @addvoid@ identifier f; @@ f( + void ) { … } Signed-off-by: Chi Pham Signed-off-by: Greg Kroah-Hartman — drivers/staging/ced1401/userspace/use1401.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/ced1401/userspace/use1401.c b/drivers/staging/ced1401/userspace/use1401.c index 9ebddbd..d589311 100644 …

Continue reading

iommu/fsl: Add void declarations in zero-arg functions.

Author: Chi Pham <fempsci@gmail.com> Added explicit void declarations to zero-argument function headers. The following coccinelle script was used: @addvoid@ identifier f; @@ f( + void ) { … } Signed-off-by: Chi Pham Signed-off-by: Joerg Roedel — drivers/iommu/fsl_pamu.c | 2 +- drivers/iommu/fsl_pamu_domain.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/iommu/fsl_pamu.c …

Continue reading

netfilter: nft_log: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> net/netfilter/nft_log.c:79:44-45: Unneeded semicolon Removes unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci CC: Pablo Neira Ayuso Signed-off-by: Fengguang Wu Signed-off-by: Pablo Neira Ayuso — net/netfilter/nft_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/net/netfilter/nft_log.c b/net/netfilter/nft_log.c index 5b1a4f5..bde05f28 100644 — a/net/netfilter/nft_log.c +++ b/net/netfilter/nft_log.c @@ -76,7 +76,7 @@ static int nft_log_init(const …

Continue reading

ecryptfs: Drop cast

Author: Himangi Saraogi <himangi774@gmail.com> This patch does away with cast on void * and the if as it is unnecessary. The following Coccinelle semantic patch was used for making the change: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[…] | ((T *)x)->f | – (T *) e …

Continue reading

NFSv4: Drop cast

Author: Himangi Saraogi <himangi774@gmail.com> This patch does away with the cast on void * as it is unnecessary. The following Coccinelle semantic patch was used for making the change: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[…] | ((T *)x)->f | – (T *) e ) Signed-off-by: …

Continue reading