[PATCH] staging: ccree: Fix Kernel coding style issues
From: Karthik Tummala Fixed following checkpatch warnings & checks: CHECK: Unnecessary parentheses WARNING: suspect code indent for conditional statements WARNING: Missing a blank line after declarations Signed-off-by: Karthik Tummala --- Note: - Patch was tested & built (ARCH=arm) on staging, next trees. - No build issues reported. --- drivers/staging/ccree/ssi_cipher.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index a462075..24dbe98 100644 --- a/drivers/staging/ccree/ssi_cipher.c +++ b/drivers/staging/ccree/ssi_cipher.c @@ -76,18 +76,18 @@ static int validate_keys_sizes(struct ssi_ablkcipher_ctx *ctx_p, u32 size) switch (size) { case CC_AES_128_BIT_KEY_SIZE: case CC_AES_192_BIT_KEY_SIZE: - if (likely((ctx_p->cipher_mode != DRV_CIPHER_XTS) && - (ctx_p->cipher_mode != DRV_CIPHER_ESSIV) && - (ctx_p->cipher_mode != DRV_CIPHER_BITLOCKER))) + if (likely(ctx_p->cipher_mode != DRV_CIPHER_XTS && + ctx_p->cipher_mode != DRV_CIPHER_ESSIV && + ctx_p->cipher_mode != DRV_CIPHER_BITLOCKER)) return 0; break; case CC_AES_256_BIT_KEY_SIZE: return 0; case (CC_AES_192_BIT_KEY_SIZE * 2): case (CC_AES_256_BIT_KEY_SIZE * 2): - if (likely((ctx_p->cipher_mode == DRV_CIPHER_XTS) || - (ctx_p->cipher_mode == DRV_CIPHER_ESSIV) || - (ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER))) + if (likely(ctx_p->cipher_mode == DRV_CIPHER_XTS || + ctx_p->cipher_mode == DRV_CIPHER_ESSIV || + ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER)) return 0; break; default: @@ -115,8 +115,8 @@ static int validate_data_size(struct ssi_ablkcipher_ctx *ctx_p, unsigned int siz case S_DIN_to_AES: switch (ctx_p->cipher_mode) { case DRV_CIPHER_XTS: - if ((size >= SSI_MIN_AES_XTS_SIZE) && - (size <= SSI_MAX_AES_XTS_SIZE) && + if (size >= SSI_MIN_AES_XTS_SIZE && + size <= SSI_MAX_AES_XTS_SIZE && IS_ALIGNED(size, AES_BLOCK_SIZE)) return 0; break; @@ -140,7 +140,7 @@ static int validate_data_size(struct ssi_ablkcipher_ctx *ctx_p, unsigned int siz break; case S_DIN_to_DES: if (likely(IS_ALIGNED(size, DES_BLOCK_SIZE))) - return 0; + return 0; break; #if SSI_CC_HAS_MULTI2 case S_DIN_to_MULTI2: @@ -337,9 +337,9 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, return -EINVAL; } - if ((ctx_p->cipher_mode == DRV_CIPHER_XTS) || - (ctx_p->cipher_mode == DRV_CIPHER_ESSIV) || - (ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER)) { + if (ctx_p->cipher_mode == DRV_CIPHER_XTS || + ctx_p->cipher_mode == DRV_CIPHER_ESSIV || + ctx_p->cipher_mode == DRV_CIPHER_BITLOCKER) { if (unlikely(hki->hw_key1 == hki->hw_key2)) { SSI_LOG_ERR("Illegal hw key numbers (%d,%d)\n", hki->hw_key1, hki->hw_key2); return -EINVAL; @@ -366,13 +366,13 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, return -EINVAL; } } - if ((ctx_p->cipher_mode == DRV_CIPHER_XTS) && + if (ctx_p->cipher_mode == DRV_CIPHER_XTS && xts_check_key(tfm, key, keylen) != 0) { SSI_LOG_DEBUG("weak XTS key"); return -EINVAL; } - if ((ctx_p->flow_mode == S_DIN_to_DES) && - (keylen == DES3_EDE_KEY_SIZE) && + if (ctx_p->flow_mode == S_DIN_to_DES && + keylen == DES3_EDE_KEY_SIZE && ssi_verify_3des_keys(key, keylen) != 0) { SSI_LOG_DEBUG("weak 3DES key"); return -EINVAL; @@ -401,6 +401,7 @@ static int ssi_blkcipher_setkey(struct crypto_tfm *tfm, /* sha256 for key2 - use sw implementation
[PATCH] Staging: greybus: Prefer kcalloc over kzalloc
From: Karthik Tummala Fixed following checkpatch.pl warning: * WARNING: Prefer kcalloc over kzalloc with multiply Instead of specifying no.of bytes * size as arugment in kzalloc, prefer kcalloc. Signed-off-by: Karthik Tummala --- drivers/staging/greybus/light.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 1681362..861a249 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->channels_count = conf.channel_count; light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); - light->channels = kzalloc(light->channels_count * + light->channels = kcalloc(light->channels_count, sizeof(struct gb_channel), GFP_KERNEL); if (!light->channels) return -ENOMEM; @@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights) if (ret < 0) goto out; - glights->lights = kzalloc(glights->lights_count * + glights->lights = kcalloc(glights->lights_count, sizeof(struct gb_light), GFP_KERNEL); if (!glights->lights) { ret = -ENOMEM; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] Staging: greybus: light: Prefer kcalloc over kzalloc
From: Karthik Tummala Fixed following checkpatch.pl warning: * WARNING: Prefer kcalloc over kzalloc with multiply Instead of specifying no.of bytes * size as argument in kzalloc, prefer kcalloc. Signed-off-by: Karthik Tummala Reviewed-by: Rui Miguel Silva --- Changes for v2: - Changed subject line & fixed typo as suggested by Rui Miguel Silva --- drivers/staging/greybus/light.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 1681362..861a249 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -1030,7 +1030,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->channels_count = conf.channel_count; light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); - light->channels = kzalloc(light->channels_count * + light->channels = kcalloc(light->channels_count, sizeof(struct gb_channel), GFP_KERNEL); if (!light->channels) return -ENOMEM; @@ -1167,7 +1167,7 @@ static int gb_lights_create_all(struct gb_lights *glights) if (ret < 0) goto out; - glights->lights = kzalloc(glights->lights_count * + glights->lights = kcalloc(glights->lights_count, sizeof(struct gb_light), GFP_KERNEL); if (!glights->lights) { ret = -ENOMEM; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: ccree: Use __func__ instead of function name
From: Karthik Tummala Fixed following checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using the function's name, in a string It is prefered to use '%s & __func__' instead of function name for logging. Signed-off-by: Karthik Tummala --- drivers/staging/ccree/ssi_aead.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index c70e450..4004d69 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -1899,7 +1899,7 @@ static int config_gcm_context(struct aead_request *req) (req->cryptlen - ctx->authsize); __be32 counter = cpu_to_be32(2); - SSI_LOG_DEBUG("config_gcm_context() cryptlen = %d, req->assoclen = %d ctx->authsize = %d \n", cryptlen, req->assoclen, ctx->authsize); + SSI_LOG_DEBUG("%s() cryptlen = %d, req->assoclen = %d ctx->authsize = %d \n", __func__, cryptlen, req->assoclen, ctx->authsize); memset(req_ctx->hkey, 0, AES_BLOCK_SIZE); @@ -2220,7 +2220,7 @@ static int ssi_rfc4106_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); int rc = 0; - SSI_LOG_DEBUG("ssi_rfc4106_gcm_setkey() keylen %d, key %p \n", keylen, key); + SSI_LOG_DEBUG("%s() keylen %d, key %p \n", __func__, keylen, key); if (keylen < 4) return -EINVAL; @@ -2238,7 +2238,7 @@ static int ssi_rfc4543_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); int rc = 0; - SSI_LOG_DEBUG("ssi_rfc4543_gcm_setkey() keylen %d, key %p \n", keylen, key); + SSI_LOG_DEBUG("%s() keylen %d, key %p \n", __func__, keylen, key); if (keylen < 4) return -EINVAL; @@ -2273,7 +2273,7 @@ static int ssi_gcm_setauthsize(struct crypto_aead *authenc, static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead *authenc, unsigned int authsize) { - SSI_LOG_DEBUG("ssi_rfc4106_gcm_setauthsize() authsize %d \n", authsize); + SSI_LOG_DEBUG("%s() authsize %d \n", __func__, authsize); switch (authsize) { case 8: @@ -2290,7 +2290,7 @@ static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead *authenc, static int ssi_rfc4543_gcm_setauthsize(struct crypto_aead *authenc, unsigned int authsize) { - SSI_LOG_DEBUG("ssi_rfc4543_gcm_setauthsize() authsize %d \n", authsize); + SSI_LOG_DEBUG("%s() authsize %d \n", __func__, authsize); if (authsize != 16) return -EINVAL; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: ccree: Fix coding style and remove warnings
From: Karthik Tummala This patch series fixes coding style and removes the following checkpatch.pl warnings: Prefer using '"%s...", __func__' to using the function's name, in a string. Braces {} are not necessary for single statement blocks. Rebased on top of next-20170627. Patches were tested and built on next-20170627 Karthik Tummala (2): staging: ccree: Use __func__ instead of function name staging: ccree: Remove braces {} for single statement blocks drivers/staging/ccree/ssi_aead.c | 48 1 file changed, 19 insertions(+), 29 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: ccree: Remove braces {} for single statement blocks
From: Karthik Tummala Fixed following checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks. Signed-off-by: Karthik Tummala --- drivers/staging/ccree/ssi_aead.c | 38 ++ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 4004d69..1a4664f 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -243,11 +243,10 @@ static void ssi_aead_complete(struct device *dev, void *ssi_req, void __iomem *c /* If an IV was generated, copy it back to the user provided buffer. */ if (areq_ctx->backup_giv != NULL) { - if (ctx->cipher_mode == DRV_CIPHER_CTR) { + if (ctx->cipher_mode == DRV_CIPHER_CTR) memcpy(areq_ctx->backup_giv, areq_ctx->ctr_iv + CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_IV_SIZE); - } else if (ctx->cipher_mode == DRV_CIPHER_CCM) { + else if (ctx->cipher_mode == DRV_CIPHER_CCM) memcpy(areq_ctx->backup_giv, areq_ctx->ctr_iv + CCM_BLOCK_IV_OFFSET, CCM_BLOCK_IV_SIZE); - } } } @@ -521,9 +520,8 @@ static int validate_keys_sizes(struct ssi_aead_ctx *ctx) if (unlikely(rc != 0)) SSI_LOG_ERR("send_request() failed (rc=%d)\n", rc); - if (likely(key_dma_addr != 0)) { + if (likely(key_dma_addr != 0)) dma_unmap_single(dev, key_dma_addr, keylen, DMA_TO_DEVICE); - } return rc; } @@ -928,11 +926,10 @@ static inline void ssi_aead_setup_cipher_desc( set_flow_mode(&desc[idx], ctx->flow_mode); set_din_type(&desc[idx], DMA_DLLI, req_ctx->gen_ctx.iv_dma_addr, hw_iv_size, NS_BIT); - if (ctx->cipher_mode == DRV_CIPHER_CTR) { + if (ctx->cipher_mode == DRV_CIPHER_CTR) set_setup_mode(&desc[idx], SETUP_LOAD_STATE1); - } else { + else set_setup_mode(&desc[idx], SETUP_LOAD_STATE0); - } set_cipher_mode(&desc[idx], ctx->cipher_mode); idx++; @@ -1375,9 +1372,9 @@ static int validate_data_size(struct ssi_aead_ctx *ctx, static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize) { unsigned int len = 0; - if (headerSize == 0) { + if (headerSize == 0) return 0; - } + if (headerSize < ((1UL << 16) - (1UL << 8))) { len = 2; @@ -1498,9 +1495,8 @@ static inline int ssi_aead_ccm( } /* process the cipher */ - if (req_ctx->cryptlen != 0) { + if (req_ctx->cryptlen != 0) ssi_aead_process_cipher_data_desc(req, cipher_flow_mode, desc, &idx); - } /* Read temporal MAC */ hw_desc_init(&desc[idx]); @@ -1579,9 +1575,8 @@ static int config_ccm_adata(struct aead_request *req) *b0 |= 64; /* Enable bit 6 if Adata exists. */ rc = set_msg_len(b0 + 16 - l, cryptlen, l); /* Write L'. */ - if (rc != 0) { + if (rc != 0) return rc; - } /* END of "taken from crypto/ccm.c" */ /* l(a) - size of associated data. */ @@ -1861,9 +1856,8 @@ static inline void ssi_aead_dump_gcm( SSI_LOG_DEBUG("cipher_mode %d, authsize %d, enc_keylen %d, assoclen %d, cryptlen %d \n", \ ctx->cipher_mode, ctx->authsize, ctx->enc_keylen, req->assoclen, req_ctx->cryptlen); - if (ctx->enckey != NULL) { + if (ctx->enckey != NULL) dump_byte_array("mac key", ctx->enckey, 16); - } dump_byte_array("req->iv", req->iv, AES_BLOCK_SIZE); @@ -1877,13 +1871,11 @@ static inline void ssi_aead_dump_gcm( dump_byte_array("gcm_len_block", req_ctx->gcm_len_block.lenA, AES_BLOCK_SIZE); - if (req->src != NULL && req->cryptlen) { + if (req->src != NULL && req->cryptlen) dump_byte_array("req->src", sg_virt(req->src), req->cryptlen+req->assoclen); - } - if (req->dst != NULL) { + if (req->dst != NULL) dump_byte_array("req->dst", sg_virt(req->dst), req->cryptlen+ctx->authsize+req->assoclen); -} } #endif @@ -2084,14 +2076,12 @@ static int ssi_aead_process(struct aead_request *req, enum drv_crypto_direction #if (SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM) case DRV_HASH_NULL: #if SSI_CC_HAS_AES_CCM - if (ctx->cipher_mode == DRV_CIPHER_CCM) { + if (ctx->cipher_mode == DRV_CIPHER_CCM) ssi_
Re: [PATCH 0/2] staging: ccree: Fix coding style and remove warnings
On Wednesday 28 June 2017 03:15 PM, Gilad Ben-Yossef wrote: Thank you Karthik, On Wed, Jun 28, 2017 at 12:37 PM, wrote: From: Karthik Tummala This patch series fixes coding style and removes the following checkpatch.pl warnings: Prefer using '"%s...", __func__' to using the function's name, in a string. This one is good. Braces {} are not necessary for single statement blocks. I have already sent a patch addressing this and some other things yesterday/ Rebased on top of next-20170627. Patches were tested and built on next-20170627 Can you please check patch 1 still applies after yesterdays patch series? Hi, I have applied your patch series and then tried to apply patch 1 and it failed. Should I wait until the patch series gets accepted and then continue my work on the new linux-next release ? or is there any other option ? Karthik Tummala (2): staging: ccree: Use __func__ instead of function name staging: ccree: Remove braces {} for single statement blocks drivers/staging/ccree/ssi_aead.c | 48 1 file changed, 19 insertions(+), 29 deletions(-) -- 1.9.1 Thanks, Gilad Thanks karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: ccree: Use __func__ instead of function name
From: Karthik Tummala Fixed following checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using the function's name, in a string It is prefered to use '%s & __func__' instead of function name for logging. Signed-off-by: Karthik Tummala --- Changes for v2: v1 was a patch series, which consisted of two patches in which second one was already submitted by Gilad Ben-Yossef, so dropped that one. Patch generated on staging-testing as suggested by Greg-K H. --- drivers/staging/ccree/ssi_aead.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 1fc0b05..1168161 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -1886,7 +1886,7 @@ static int config_gcm_context(struct aead_request *req) (req->cryptlen - ctx->authsize); __be32 counter = cpu_to_be32(2); - SSI_LOG_DEBUG("config_gcm_context() cryptlen = %d, req->assoclen = %d ctx->authsize = %d\n", cryptlen, req->assoclen, ctx->authsize); + SSI_LOG_DEBUG("%s() cryptlen = %d, req->assoclen = %d ctx->authsize = %d\n", __func__, cryptlen, req->assoclen, ctx->authsize); memset(req_ctx->hkey, 0, AES_BLOCK_SIZE); @@ -2198,7 +2198,7 @@ static int ssi_rfc4106_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); int rc = 0; - SSI_LOG_DEBUG("ssi_rfc4106_gcm_setkey() keylen %d, key %p\n", keylen, key); + SSI_LOG_DEBUG("%s() keylen %d, key %p\n", __func__, keylen, key); if (keylen < 4) return -EINVAL; @@ -2216,7 +2216,7 @@ static int ssi_rfc4543_gcm_setkey(struct crypto_aead *tfm, const u8 *key, unsign struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); int rc = 0; - SSI_LOG_DEBUG("ssi_rfc4543_gcm_setkey() keylen %d, key %p\n", keylen, key); + SSI_LOG_DEBUG("%s() keylen %d, key %p\n", __func__, keylen, key); if (keylen < 4) return -EINVAL; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: greybus: loopback: Enclose multiple macro statements in do-while loop
From: Karthik Tummala Enclosed multiple macro statements in a do - while loop as per kernel coding standard, pointed by checkpatch. Signed-off-by: Karthik Tummala --- drivers/staging/greybus/loopback.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 08e2558..c616555 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -176,10 +176,12 @@ static DEVICE_ATTR_RO(name##_##field) } \ static DEVICE_ATTR_RO(name##_avg) -#define gb_loopback_stats_attrs(field) \ - gb_loopback_ro_stats_attr(field, min, u); \ - gb_loopback_ro_stats_attr(field, max, u); \ - gb_loopback_ro_avg_attr(field) +#define gb_loopback_stats_attrs(field) \ +do { \ + gb_loopback_ro_stats_attr(field, min, u); \ + gb_loopback_ro_stats_attr(field, max, u); \ + gb_loopback_ro_avg_attr(field); \ +} while (0) #define gb_loopback_attr(field, type) \ static ssize_t field##_show(struct device *dev, \ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: greybus: loopback: Enclose multiple macro statements in do-while loop
On Tuesday 18 July 2017 04:41 PM, Bryan O'Donoghue wrote: On 18/07/17 11:56, kart...@techveda.org wrote: From: Karthik Tummala Enclosed multiple macro statements in a do - while loop as per kernel coding standard, pointed by checkpatch. Signed-off-by: Karthik Tummala --- drivers/staging/greybus/loopback.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 08e2558..c616555 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -176,10 +176,12 @@ static DEVICE_ATTR_RO(name##_##field) }\ static DEVICE_ATTR_RO(name##_avg) -#define gb_loopback_stats_attrs(field)\ -gb_loopback_ro_stats_attr(field, min, u);\ -gb_loopback_ro_stats_attr(field, max, u);\ -gb_loopback_ro_avg_attr(field) +#define gb_loopback_stats_attrs(field)\ +do {\ +gb_loopback_ro_stats_attr(field, min, u);\ +gb_loopback_ro_stats_attr(field, max, u);\ +gb_loopback_ro_avg_attr(field);\ +} while (0) #define gb_loopback_attr(field, type)\ static ssize_t field##_show(struct device *dev,\ Macros with multiple statements should be enclosed in a do - while block: .. code-block:: c #define macrofun(a, b, c) \ do {\ if (a == 5) \ do_this(b, c); \ } while (0) I don't think it really applies. We're declaring functions not inlining executable code.Hi, It makes sense, thanks for the insight. Please drop this patch Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Fix clang warning -Wpointer-bool-conversion by removing unnecessary check in regd.c
The member regd of the struct rtl_priv is true in a boolean context. drivers/staging/rtlwifi/regd.c:413:27: warning: address of 'rtlpriv->regd' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!wiphy || !&rtlpriv->regd) ~ ~^~~~ 1 warning generated. Link: https://github.com/ClangBuiltLinux/linux/issues/170 Signed-off-by: Karthik Nishanth --- drivers/staging/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtlwifi/regd.c b/drivers/staging/rtlwifi/regd.c index 3afd206ce4b1..5213ca771175 100644 --- a/drivers/staging/rtlwifi/regd.c +++ b/drivers/staging/rtlwifi/regd.c @@ -410,7 +410,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, struct wiphy *wiphy = hw->wiphy; struct country_code_to_enum_rd *country = NULL; - if (!wiphy || !&rtlpriv->regd) + if (!wiphy) return -EINVAL; /* init country_code from efuse channel plan */ -- 2.19.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Fix clang warning -Wpointer-bool-conversion by removing unnecessary check in regd.c
Do I submit a new patch with the modified subject? On Sat, Sep 22, 2018 at 03:44:32PM +0300, Dan Carpenter wrote: >The subject needs a subsystem prefix. It's also slightly long. > >[PATCH] Staging: rtlwifi: remove unnecessary NULL check > >regards, >dan carpenter > Karthik Nishanth ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] Staging: rtlwifi: remove unnecessary NULL check
The member regd of the struct rtl_priv is true in a boolean context. drivers/staging/rtlwifi/regd.c:413:27: warning: address of 'rtlpriv->regd' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!wiphy || !&rtlpriv->regd) ~ ~^~~~ 1 warning generated. Link: https://github.com/ClangBuiltLinux/linux/issues/170 Signed-off-by: Karthik Nishanth --- v2: changed the subject drivers/staging/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtlwifi/regd.c b/drivers/staging/rtlwifi/regd.c index 3afd206ce4b1..5213ca771175 100644 --- a/drivers/staging/rtlwifi/regd.c +++ b/drivers/staging/rtlwifi/regd.c @@ -410,7 +410,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, struct wiphy *wiphy = hw->wiphy; struct country_code_to_enum_rd *country = NULL; - if (!wiphy || !&rtlpriv->regd) + if (!wiphy) return -EINVAL; /* init country_code from efuse channel plan */ -- 2.19.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: fix block comments alignment
fix checkpatch.pl warning for "block comments should align the * on each line" Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 204 +- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index cf23414d7..003f954c2 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -20,16 +20,16 @@ #define MAX_DOZE_WAITING_TIMES_9x 64 /** -* Function:phy_CalculateBitShift -* -* OverView:Get shifted position of the BitMask -* -* Input: -* u32 BitMask, -* -* Output: none -* Return: u32 Return the shift bit bit position of the mask -*/ + * Function: phy_CalculateBitShift + * + * OverView: Get shifted position of the BitMask + * + * Input: + * u32 BitMask, + * + * Output: none + * Return: u32 Return the shift bit bit position of the mask + */ static u32 phy_CalculateBitShift(u32 BitMask) { u32 i; @@ -43,19 +43,19 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** -* Function:PHY_QueryBBReg -* -* OverView:Read "specific bits" from BB register -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be readback -* u32 BitMask The target bit position in the target address -* to be readback -* Output: None -* Return: u32 DataThe readback register value -* Note:This function is equal to "GetRegSetting" in PHY programming guide -*/ + * Function: PHY_QueryBBReg + * + * OverView: Read "specific bits" from BB register + * + * Input: + * struct adapter *Adapter, + * u32 RegAddr,The target address to be readback + * u32 BitMask The target bit position in the target address + * to be readback + * Output: None + * Return: u32 DataThe readback register value + * Note: This function is equal to "GetRegSetting" in PHY programming guide + */ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) { u32 OriginalValue, BitShift; @@ -75,22 +75,22 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** -* Function:PHY_SetBBReg -* -* OverView:Write "Specific bits" to BB register (page 8~) -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be modified -* u32 BitMask The target bit position in the target address -* to be modified -* u32 DataThe new register value in the target bit position -* of the target address -* -* Output: None -* Return: None -* Note:This function is equal to "PutRegSetting" in PHY programming guide -*/ + * Function: PHY_SetBBReg + * + * OverView: Write "Specific bits" to BB register (page 8~) + * + * Input: + * struct adapter *Adapter, + * u32 RegAddr,The target address to be modified + * u32 BitMask The target bit position in the target address + * to be modified + * u32 DataThe new register value in the target bit position + * of the target address + * + * Output: None + * Return: None + * Note: This function is equal to "PutRegSetting" in PHY programming guide + */ void PHY_SetBBReg_8723B( struct adapter *Adapter, @@ -184,25 +184,25 @@ static u32 phy_RFSerialRead_8723B( } /** -* Function:phy_RFSerialWrite_8723B -* -* OverView:Write data to RF register (page 8~) -* -* Input: -* struct adapter *Adapter, -* RF_PATH eRFPath,Radio path of A/B/C/D -* u32 Offset, The target address to be read -* u32 DataThe new register Data in the target bit position -* of the target to be read -* -* Output: None -* Return: None -* Note:Threre are three types of serial operations: -*
[PATCH] staging: rtl8723bs: fix function comments to follow kernel-doc
fix checkpatch.pl warning for "block comments should align the * on each line" and make function comments follow kernel-doc Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 209 -- 1 file changed, 91 insertions(+), 118 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index cf23414d7..b7fca881c 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -20,16 +20,11 @@ #define MAX_DOZE_WAITING_TIMES_9x 64 /** -* Function:phy_CalculateBitShift -* -* OverView:Get shifted position of the BitMask -* -* Input: -* u32 BitMask, -* -* Output: none -* Return: u32 Return the shift bit bit position of the mask -*/ + * phy_CalculateBitShift - Get shifted position of the BitMask. + * @BitMask: Bitmask. + * + * Return: Return the shift bit position of the mask + */ static u32 phy_CalculateBitShift(u32 BitMask) { u32 i; @@ -43,19 +38,17 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** -* Function:PHY_QueryBBReg -* -* OverView:Read "specific bits" from BB register -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be readback -* u32 BitMask The target bit position in the target address -* to be readback -* Output: None -* Return: u32 DataThe readback register value -* Note:This function is equal to "GetRegSetting" in PHY programming guide -*/ + * PHY_QueryBBReg - Read "specific bits" from BB register. + * @Adapter: + * @RegAddr: The target address to be readback + * @BitMask: The target bit position in the target address + * to be readback + * + * Return: The readback register value + * + * .. Note:: This function is equal to "GetRegSetting" in PHY programming + * guide + */ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) { u32 OriginalValue, BitShift; @@ -64,7 +57,10 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) return 0; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_QueryBBReg(): RegAddr(%#lx), BitMask(%#lx)\n", RegAddr, BitMask)); */ + /** +* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_QueryBBReg(): +* RegAddr(%#lx), BitMask(%#lx)\n", RegAddr, BitMask)); +*/ OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -75,22 +71,17 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** -* Function:PHY_SetBBReg -* -* OverView:Write "Specific bits" to BB register (page 8~) -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be modified -* u32 BitMask The target bit position in the target address -* to be modified -* u32 DataThe new register value in the target bit position -* of the target address -* -* Output: None -* Return: None -* Note:This function is equal to "PutRegSetting" in PHY programming guide -*/ + * PHY_SetBBReg - Write "Specific bits" to BB register (page 8~). + * @Adapter: + * @RegAddr: The target address to be modified + * @BitMask: The target bit position in the target address + * to be modified + * @Data: The new register value in the target bit position + * of the target address + * + * .. Note:: This function is equal to "PutRegSetting" in PHY programming + * guide + */ void PHY_SetBBReg_8723B( struct adapter *Adapter, @@ -106,7 +97,10 @@ void PHY_SetBBReg_8723B( return; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_SetBBReg(): RegAddr(%#lx), BitMask(%#lx), Data(%#lx)\n", RegAddr, BitMask, Data)); */ + /** +* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_SetBBReg(): +* RegAddr(%#lx), BitMask(%#lx), Data(%#lx)\n", RegAddr, BitMask, Data)); +*/ if (BitMask != bMaskDWord) { /* if not "double word" write */ OriginalValue = rtw_read32(Adapter, RegAddr); @@ -184,27 +178,21 @@ static u32 phy_RFSerialRead_8723B( } /** -* Function:phy_RFSerial
[PATCH] staging: rtl8723bs: fix function comments to follow kernel-doc
fix checkpatch.pl warning for "block comments should align the * on each line" and make function comments follow kernel-doc Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 185 +++--- 1 file changed, 73 insertions(+), 112 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index cf23414d7..1fd504181 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -20,16 +20,11 @@ #define MAX_DOZE_WAITING_TIMES_9x 64 /** -* Function:phy_CalculateBitShift -* -* OverView:Get shifted position of the BitMask -* -* Input: -* u32 BitMask, -* -* Output: none -* Return: u32 Return the shift bit bit position of the mask -*/ + * phy_CalculateBitShift - Get shifted position of the BitMask. + * @BitMask: Bitmask. + * + * Return: Return the shift bit position of the mask + */ static u32 phy_CalculateBitShift(u32 BitMask) { u32 i; @@ -43,19 +38,17 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** -* Function:PHY_QueryBBReg -* -* OverView:Read "specific bits" from BB register -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be readback -* u32 BitMask The target bit position in the target address -* to be readback -* Output: None -* Return: u32 DataThe readback register value -* Note:This function is equal to "GetRegSetting" in PHY programming guide -*/ + * PHY_QueryBBReg - Read "specific bits" from BB register. + * @Adapter: + * @RegAddr: The target address to be readback + * @BitMask: The target bit position in the target address + * to be readback + * + * Return: The readback register value + * + * .. Note:: This function is equal to "GetRegSetting" in PHY programming + * guide + */ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) { u32 OriginalValue, BitShift; @@ -75,22 +68,17 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** -* Function:PHY_SetBBReg -* -* OverView:Write "Specific bits" to BB register (page 8~) -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be modified -* u32 BitMask The target bit position in the target address -* to be modified -* u32 DataThe new register value in the target bit position -* of the target address -* -* Output: None -* Return: None -* Note:This function is equal to "PutRegSetting" in PHY programming guide -*/ + * PHY_SetBBReg - Write "Specific bits" to BB register (page 8~). + * @Adapter: + * @RegAddr: The target address to be modified + * @BitMask: The target bit position in the target address + * to be modified + * @Data: The new register value in the target bit position + * of the target address + * + * .. Note:: This function is equal to "PutRegSetting" in PHY programming + * guide + */ void PHY_SetBBReg_8723B( struct adapter *Adapter, @@ -184,27 +172,21 @@ static u32 phy_RFSerialRead_8723B( } /** -* Function:phy_RFSerialWrite_8723B -* -* OverView:Write data to RF register (page 8~) -* -* Input: -* struct adapter *Adapter, -* RF_PATH eRFPath,Radio path of A/B/C/D -* u32 Offset, The target address to be read -* u32 DataThe new register Data in the target bit position -* of the target to be read -* -* Output: None -* Return: None -* Note:Threre are three types of serial operations: -* 1. Software serial write -* 2. Hardware LSSI-Low Speed Serial Interface -* 3. Hardware HSSI-High speed -* serial write. Driver need to implement (1) and (2). -* This function is equal to the combination of RF_ReadReg() and RFLSSIRead() + * phy_RFSerialWrite_8723B - Write data to RF register (page 8~). + * @Adapter: + * @eRFPath: Radio path of A/B/C/D + * @Offset:The target address to be read +
[PATCH] staging: rtl8723bs: remove obsolete commented out code
fix some checkpatch "Block comments use * on subsequent lines" warnings and remove obsolete code Suggested-by: Dan Carpenter Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 44 --- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index 1fd504181..3d22bd304 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -57,8 +57,6 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) return 0; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_QueryBBReg(): RegAddr(%#lx), BitMask(%#lx)\n", RegAddr, BitMask)); */ - OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -94,8 +92,6 @@ void PHY_SetBBReg_8723B( return; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_SetBBReg(): RegAddr(%#lx), BitMask(%#lx), Data(%#lx)\n", RegAddr, BitMask, Data)); */ - if (BitMask != bMaskDWord) { /* if not "double word" write */ OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -159,13 +155,9 @@ static u32 phy_RFSerialRead_8723B( if (RfPiEnable) { /* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */ retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBackPi|MaskforPhySet, bLSSIReadBackData); - - /* RT_DISP(FINIT, INIT_RF, ("Readback from RF-PI : 0x%x\n", retValue)); */ } else { /* Read from BBreg8a0, 12 bits for 8190, 20 bits for T65 RF */ retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBack|MaskforPhySet, bLSSIReadBackData); - - /* RT_DISP(FINIT, INIT_RF, ("Readback from RF-SI : 0x%x\n", retValue)); */ } return retValue; @@ -230,15 +222,13 @@ static void phy_RFSerialWrite_8723B( /* */ /* Put write addr in [5:0] and write data in [31:16] */ /* */ - /* DataAndAddr = (Data<<16) | (NewOffset&0x3f); */ - DataAndAddr = ((NewOffset<<20) | (Data&0x000f)) & 0x0fff; /* T65 RF */ + DataAndAddr = ((NewOffset<<20) | (Data&0x000f)) & 0x0fff; + /* T65 RF */ /* */ /* Write Operation */ /* */ PHY_SetBBReg(Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); - /* RTPRINT(FPHY, PHY_RFW, ("RFW-%d Addr[0x%lx]= 0x%lx\n", eRFPath, pPhyReg->rf3wireOffset, DataAndAddr)); */ - } @@ -473,7 +463,6 @@ int PHY_RFConfig8723B(struct adapter *Adapter) rtStatus = PHY_RF6052_Config8723B(Adapter); phy_LCK_8723B(Adapter); - /* PHY_BB8723B_Config_1T(Adapter); */ return rtStatus; } @@ -580,8 +569,6 @@ u8 PHY_GetTxPowerIndex( s8 txPower = 0, powerDiffByRate = 0, limit = 0; bool bIn24G = false; - /* DBG_871X("===>%s\n", __func__); */ - txPower = (s8) PHY_GetTxPowerIndexBase(padapter, RFPath, Rate, BandWidth, Channel, &bIn24G); powerDiffByRate = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, ODM_RF_PATH_A, RF_1TX, Rate); @@ -603,7 +590,6 @@ u8 PHY_GetTxPowerIndex( if (txPower > MAX_POWER_INDEX) txPower = MAX_POWER_INDEX; - /* DBG_871X("Final Tx Power(RF-%c, Channel: %d) = %d(0x%X)\n", ((RFPath == 0)?'A':'B'), Channel, txPower, txPower)); */ return (u8) txPower; } @@ -750,8 +736,6 @@ static void phy_PostSetBwMode8723B(struct adapter *Adapter) PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x0); -/* PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter2, BIT10, 1); */ - PHY_SetBBReg(Adapter, rOFDM0_TxPseudoNoiseWgt, (BIT31|BIT30), 0x0); break; @@ -761,20 +745,20 @@ static void phy_PostSetBwMode8723B(struct adapter *Adapter) PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x1); - /* Set Control channel to upper or lower. These settings are required only for 40MHz */ + /** +* Set Control channel to upper or lower. These settings are required only +* for 40MHz +*/ PHY_SetBBReg(Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC>>1)); PHY_SetBBReg(Adapter, rOFDM1_LSTF, 0xC00, pHalData->nCur40MhzPrimeSC); -/* PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter2, BIT10, 0); */ - PHY_SetBBReg(Adapter, 0x818, (BIT26|BIT27), (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1); break; default: -
[PATCH v4 0/2] staging: rtl8723bs: driver cleanup
karthik alapati (2): staging: rtl8723bs: fix function comments to follow kernel-doc staging: rtl8723bs: remove obsolete commented out code .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 225 ++ 1 file changed, 75 insertions(+), 150 deletions(-) -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 1/2] staging: rtl8723bs: fix function comments to follow kernel-doc
there are some good function comments not following kernel-doc. Make them follow kernel-doc style Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 185 +++--- 1 file changed, 73 insertions(+), 112 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index cf23414d7..77132e4ee 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -20,16 +20,11 @@ #define MAX_DOZE_WAITING_TIMES_9x 64 /** -* Function:phy_CalculateBitShift -* -* OverView:Get shifted position of the BitMask -* -* Input: -* u32 BitMask, -* -* Output: none -* Return: u32 Return the shift bit bit position of the mask -*/ + * phy_CalculateBitShift - Get shifted position of the BitMask. + * @BitMask: Bitmask. + * + * Return: Return the shift bit position of the mask + */ static u32 phy_CalculateBitShift(u32 BitMask) { u32 i; @@ -43,19 +38,17 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** -* Function:PHY_QueryBBReg -* -* OverView:Read "specific bits" from BB register -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be readback -* u32 BitMask The target bit position in the target address -* to be readback -* Output: None -* Return: u32 DataThe readback register value -* Note:This function is equal to "GetRegSetting" in PHY programming guide -*/ + * PHY_QueryBBReg - Read "specific bits" from BB register. + * @Adapter: + * @RegAddr: The target address to be readback + * @BitMask: The target bit position in the target address + * to be readback + * + * Return: The readback register value + * + * .. Note:: This function is equal to "GetRegSetting" in PHY programming + * guide + */ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) { u32 OriginalValue, BitShift; @@ -75,22 +68,17 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** -* Function:PHY_SetBBReg -* -* OverView:Write "Specific bits" to BB register (page 8~) -* -* Input: -* struct adapter *Adapter, -* u32 RegAddr,The target address to be modified -* u32 BitMask The target bit position in the target address -* to be modified -* u32 DataThe new register value in the target bit position -* of the target address -* -* Output: None -* Return: None -* Note:This function is equal to "PutRegSetting" in PHY programming guide -*/ + * PHY_SetBBReg - Write "Specific bits" to BB register (page 8~). + * @Adapter: + * @RegAddr: The target address to be modified + * @BitMask: The target bit position in the target address + * to be modified + * @Data: The new register value in the target bit position + * of the target address + * + * .. Note:: This function is equal to "PutRegSetting" in PHY programming + * guide + */ void PHY_SetBBReg_8723B( struct adapter *Adapter, @@ -184,27 +172,21 @@ static u32 phy_RFSerialRead_8723B( } /** -* Function:phy_RFSerialWrite_8723B -* -* OverView:Write data to RF register (page 8~) -* -* Input: -* struct adapter *Adapter, -* RF_PATH eRFPath,Radio path of A/B/C/D -* u32 Offset, The target address to be read -* u32 DataThe new register Data in the target bit position -* of the target to be read -* -* Output: None -* Return: None -* Note:Threre are three types of serial operations: -* 1. Software serial write -* 2. Hardware LSSI-Low Speed Serial Interface -* 3. Hardware HSSI-High speed -* serial write. Driver need to implement (1) and (2). -* This function is equal to the combination of RF_ReadReg() and RFLSSIRead() + * phy_RFSerialWrite_8723B - Write data to RF register (page 8~). + * @Adapter: + * @eRFPath: Radio path of A/B/C/D + * @Offset:The target address to be read + * @Data: The new register Data in the target bit position + * of the target to be read +
[PATCH v4 2/2] staging: rtl8723bs: remove obsolete commented out code
There is a bunch of messy, commented out code. Just delete it. Suggested-by: Dan Carpenter Signed-off-by: karthik alapati --- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 40 +-- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index 77132e4ee..22365926a 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -57,8 +57,6 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) return 0; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_QueryBBReg(): RegAddr(%#lx), BitMask(%#lx)\n", RegAddr, BitMask)); */ - OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -94,8 +92,6 @@ void PHY_SetBBReg_8723B( return; #endif - /* RT_TRACE(COMP_RF, DBG_TRACE, ("--->PHY_SetBBReg(): RegAddr(%#lx), BitMask(%#lx), Data(%#lx)\n", RegAddr, BitMask, Data)); */ - if (BitMask != bMaskDWord) { /* if not "double word" write */ OriginalValue = rtw_read32(Adapter, RegAddr); BitShift = phy_CalculateBitShift(BitMask); @@ -159,13 +155,9 @@ static u32 phy_RFSerialRead_8723B( if (RfPiEnable) { /* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */ retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBackPi|MaskforPhySet, bLSSIReadBackData); - - /* RT_DISP(FINIT, INIT_RF, ("Readback from RF-PI : 0x%x\n", retValue)); */ } else { /* Read from BBreg8a0, 12 bits for 8190, 20 bits for T65 RF */ retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBack|MaskforPhySet, bLSSIReadBackData); - - /* RT_DISP(FINIT, INIT_RF, ("Readback from RF-SI : 0x%x\n", retValue)); */ } return retValue; @@ -230,15 +222,11 @@ static void phy_RFSerialWrite_8723B( /* */ /* Put write addr in [5:0] and write data in [31:16] */ /* */ - /* DataAndAddr = (Data<<16) | (NewOffset&0x3f); */ DataAndAddr = ((NewOffset<<20) | (Data&0x000f)) & 0x0fff; /* T65 RF */ - /* */ /* Write Operation */ /* */ PHY_SetBBReg(Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); - /* RTPRINT(FPHY, PHY_RFW, ("RFW-%d Addr[0x%lx]= 0x%lx\n", eRFPath, pPhyReg->rf3wireOffset, DataAndAddr)); */ - } @@ -473,7 +461,6 @@ int PHY_RFConfig8723B(struct adapter *Adapter) rtStatus = PHY_RF6052_Config8723B(Adapter); phy_LCK_8723B(Adapter); - /* PHY_BB8723B_Config_1T(Adapter); */ return rtStatus; } @@ -580,8 +567,6 @@ u8 PHY_GetTxPowerIndex( s8 txPower = 0, powerDiffByRate = 0, limit = 0; bool bIn24G = false; - /* DBG_871X("===>%s\n", __func__); */ - txPower = (s8) PHY_GetTxPowerIndexBase(padapter, RFPath, Rate, BandWidth, Channel, &bIn24G); powerDiffByRate = PHY_GetTxPowerByRate(padapter, BAND_ON_2_4G, ODM_RF_PATH_A, RF_1TX, Rate); @@ -603,7 +588,6 @@ u8 PHY_GetTxPowerIndex( if (txPower > MAX_POWER_INDEX) txPower = MAX_POWER_INDEX; - /* DBG_871X("Final Tx Power(RF-%c, Channel: %d) = %d(0x%X)\n", ((RFPath == 0)?'A':'B'), Channel, txPower, txPower)); */ return (u8) txPower; } @@ -750,8 +734,6 @@ static void phy_PostSetBwMode8723B(struct adapter *Adapter) PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x0); -/* PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter2, BIT10, 1); */ - PHY_SetBBReg(Adapter, rOFDM0_TxPseudoNoiseWgt, (BIT31|BIT30), 0x0); break; @@ -766,15 +748,9 @@ static void phy_PostSetBwMode8723B(struct adapter *Adapter) PHY_SetBBReg(Adapter, rOFDM1_LSTF, 0xC00, pHalData->nCur40MhzPrimeSC); -/* PHY_SetBBReg(Adapter, rFPGA0_AnalogParameter2, BIT10, 0); */ - PHY_SetBBReg(Adapter, 0x818, (BIT26|BIT27), (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1); - break; - default: - /*RT_TRACE(COMP_DBG, DBG_LOUD, ("phy_SetBWMode8723B(): unknown Bandwidth: %#X\n"\ - , pHalData->CurrentChannelBW));*/ break; } @@ -787,10 +763,8 @@ static void phy_SwChnl8723B(struct adapter *padapter) struct hal_com_data *pHalData = GET_HAL_DATA(padapter); u8 channelToSW = pHalData->CurrentChannel; - if (pHalData->rf_chip == RF_PSEUDO_11N) { - /* RT_TRACE(COMP_MLME, DBG_LOUD, ("phy_SwChnl8723B: return for PSEUDO\n")); */ + if (pHalData->rf_chip == RF_PSEUDO_11N)
[PATCH] use explicit host byte-order types in comparison
convert le32 types to host byte-order types before comparison Signed-off-by: karthik alapati --- i wonder how these could be false-positives drivers/staging/wimax/i2400m/fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c index edb5eba0898b..13207c985a87 100644 --- a/drivers/staging/wimax/i2400m/fw.c +++ b/drivers/staging/wimax/i2400m/fw.c @@ -191,7 +191,7 @@ void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd) int i; u32 checksum = 0; const u32 *checksum_ptr = (void *) cmd->payload; - for (i = 0; i < cmd->data_size / 4; i++) + for (i = 0; i < le32_to_cpu(cmd->data_size) / 4; i++) checksum += cpu_to_le32(*checksum_ptr++); checksum += cmd->command + cmd->target_addr + cmd->data_size; cmd->block_checksum = cpu_to_le32(checksum); @@ -506,7 +506,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } - if (ack_size < ack->data_size + sizeof(*ack)) { + if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size, -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: i2400m: use explicit host byte-order types in comparison
convert le32 types to host byte-order types before comparison Signed-off-by: karthik alapati --- i wonder how these could be false-positives drivers/staging/wimax/i2400m/fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c index edb5eba0898b..13207c985a87 100644 --- a/drivers/staging/wimax/i2400m/fw.c +++ b/drivers/staging/wimax/i2400m/fw.c @@ -191,7 +191,7 @@ void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd) int i; u32 checksum = 0; const u32 *checksum_ptr = (void *) cmd->payload; - for (i = 0; i < cmd->data_size / 4; i++) + for (i = 0; i < le32_to_cpu(cmd->data_size) / 4; i++) checksum += cpu_to_le32(*checksum_ptr++); checksum += cmd->command + cmd->target_addr + cmd->data_size; cmd->block_checksum = cpu_to_le32(checksum); @@ -506,7 +506,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } - if (ack_size < ack->data_size + sizeof(*ack)) { + if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size, -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wimax: fix sparse incorrect type issue
fix sparse warning by casting to explicit user address-space pointer type Signed-off-by: karthik alapati --- drivers/staging/wlan-ng/p80211netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 6f9666dc0..70570e8a5 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -569,7 +569,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, goto bail; } - msgbuf = memdup_user(req->data, req->len); + msgbuf = memdup_user((void __user *)req->data, req->len); if (IS_ERR(msgbuf)) { result = PTR_ERR(msgbuf); goto bail; -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wimax/i2400m: fix byte-order issue
fix sparse byte-order warnings by converting host byte-order types to le32 types Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c index a159808f0..0f438ae6a 100644 --- a/drivers/staging/wimax/i2400m/op-rfkill.c +++ b/drivers/staging/wimax/i2400m/op-rfkill.c @@ -86,7 +86,7 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev, if (cmd == NULL) goto error_alloc; cmd->hdr.type = cpu_to_le16(I2400M_MT_CMD_RF_CONTROL); - cmd->hdr.length = sizeof(cmd->sw_rf); + cmd->hdr.length = cpu_to_le16(sizeof(cmd->sw_rf)); cmd->hdr.version = cpu_to_le16(I2400M_L3L4_VERSION); cmd->sw_rf.hdr.type = cpu_to_le16(I2400M_TLV_RF_OPERATION); cmd->sw_rf.hdr.length = cpu_to_le16(sizeof(cmd->sw_rf.status)); -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wimax/i2400m: fix byte-order type issue
fix sparse type warning by converting le32 types to host byte-order types before comparison Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c index 92ea5c101..f09de1810 100644 --- a/drivers/staging/wimax/i2400m/fw.c +++ b/drivers/staging/wimax/i2400m/fw.c @@ -511,7 +511,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } - if (ack_size < ack->data_size + sizeof(*ack)) { + if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size, -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media/atomisp: don't compile unused code
currently the functions defined in ibuf_ctrl_rmgr.c file are only used by isys_init.c when CONFIG_VIDEO_ATOMISP_ISP2401 is selected so dont't compile it when not needed, also fixes some sparse warnings Signed-off-by: karthik alapati --- is this the right patch or just compiling out those functions by conditional comiplation is sufficient? drivers/staging/media/atomisp/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index 1dfad0dd0..51498b2e8 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -126,7 +126,6 @@ atomisp-objs += \ pci/runtime/inputfifo/src/inputfifo.o \ pci/runtime/isp_param/src/isp_param.o \ pci/runtime/isys/src/csi_rx_rmgr.o \ - pci/runtime/isys/src/ibuf_ctrl_rmgr.o \ pci/runtime/isys/src/isys_dma_rmgr.o \ pci/runtime/isys/src/isys_init.o \ pci/runtime/isys/src/isys_stream2mmio_rmgr.o \ @@ -323,7 +322,9 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__ #DEFINES += -DUSE_KMEM_CACHE ifeq ($(CONFIG_VIDEO_ATOMISP_ISP2401),y) -atomisp-objs += $(obj-cht) +atomisp-objs += \ + $(obj-cht) \ + pci/runtime/isys/src/ibuf_ctrl_rmgr.o DEFINES += -DISP2401 -DISP2401_NEW_INPUT_SYSTEM -DSYSTEM_hive_isp_css_2401_system else atomisp-objs += $(obj-byt) -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] fix sparse warnings
the following patches fixes two byte-order issues and a Makefile issue and fixes these sparse warnings drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types) drivers/staging//wimax/i2400m/op-rfkill.c:89:25:expected restricted __le16 [usertype] length drivers/staging//wimax/i2400m/op-rfkill.c:89:25:got unsigned long . drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer . drivers/staging//media/atomisp/pci/runtime/isys/src/ibuf_ctrl_rmgr.c:34:6: warning: symbol 'ia_css_isys_ibuf_rmgr_init' was not declared. Should it be static? drivers/staging//media/atomisp/pci/runtime/isys/src/ibuf_ctrl_rmgr.c:40:6: warning: symbol 'ia_css_isys_ibuf_rmgr_uninit' was not declared. Should it be static? drivers/staging//media/atomisp/pci/runtime/isys/src/ibuf_ctrl_rmgr.c:46:6: warning: symbol 'ia_css_isys_ibuf_rmgr_acquire' was not declared. Should it be static? drivers/staging//media/atomisp/pci/runtime/isys/src/ibuf_ctrl_rmgr.c:106:6: warning: symbol 'ia_css_isys_ibuf_rmgr_release' was not declared. Should it be static? karthik alapati (3): staging: wimax/i2400m: fix byte-order issue staging: wimax/i2400m: convert __le32 type to host byte-order staging: media/atomisp: don't compile unused code drivers/staging/media/atomisp/Makefile | 5 +++-- drivers/staging/wimax/i2400m/fw.c| 2 +- drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: wimax/i2400m: fix byte-order issue
fix sparse byte-order warnings by converting host byte-order type to __le16 byte-order types before assigning to hdr.length Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c index a159808f0..0f438ae6a 100644 --- a/drivers/staging/wimax/i2400m/op-rfkill.c +++ b/drivers/staging/wimax/i2400m/op-rfkill.c @@ -86,7 +86,7 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev, if (cmd == NULL) goto error_alloc; cmd->hdr.type = cpu_to_le16(I2400M_MT_CMD_RF_CONTROL); - cmd->hdr.length = sizeof(cmd->sw_rf); + cmd->hdr.length = cpu_to_le16(sizeof(cmd->sw_rf)); cmd->hdr.version = cpu_to_le16(I2400M_L3L4_VERSION); cmd->sw_rf.hdr.type = cpu_to_le16(I2400M_TLV_RF_OPERATION); cmd->sw_rf.hdr.length = cpu_to_le16(sizeof(cmd->sw_rf.status)); -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: wimax/i2400m: convert __le32 type to host byte-order
fix sparse type warning by converting __le32 types to host byte-order types before comparison Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c index 92ea5c101..f09de1810 100644 --- a/drivers/staging/wimax/i2400m/fw.c +++ b/drivers/staging/wimax/i2400m/fw.c @@ -511,7 +511,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } - if (ack_size < ack->data_size + sizeof(*ack)) { + if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size, -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: media/atomisp: don't compile unused code
currently the functions defined in ibuf_ctrl_rmgr.c file are only used by isys_init.c when CONFIG_VIDEO_ATOMISP_ISP2401 is selected so dont't compile it when not needed, also fixes some sparse warnings Signed-off-by: karthik alapati --- drivers/staging/media/atomisp/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index 1dfad0dd0..51498b2e8 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -126,7 +126,6 @@ atomisp-objs += \ pci/runtime/inputfifo/src/inputfifo.o \ pci/runtime/isp_param/src/isp_param.o \ pci/runtime/isys/src/csi_rx_rmgr.o \ - pci/runtime/isys/src/ibuf_ctrl_rmgr.o \ pci/runtime/isys/src/isys_dma_rmgr.o \ pci/runtime/isys/src/isys_init.o \ pci/runtime/isys/src/isys_stream2mmio_rmgr.o \ @@ -323,7 +322,9 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__ #DEFINES += -DUSE_KMEM_CACHE ifeq ($(CONFIG_VIDEO_ATOMISP_ISP2401),y) -atomisp-objs += $(obj-cht) +atomisp-objs += \ + $(obj-cht) \ + pci/runtime/isys/src/ibuf_ctrl_rmgr.o DEFINES += -DISP2401 -DISP2401_NEW_INPUT_SYSTEM -DSYSTEM_hive_isp_css_2401_system else atomisp-objs += $(obj-byt) -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] fix sparse warnings
the following patches fixes two byte-order issues and fixes these sparse warnings drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types) drivers/staging//wimax/i2400m/op-rfkill.c:89:25:expected restricted __le16 [usertype] length drivers/staging//wimax/i2400m/op-rfkill.c:89:25:got unsigned long . drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer karthik alapati (2): staging: wimax/i2400m: fix byte-order issue staging: wimax/i2400m: convert __le32 type to host byte-order drivers/staging/wimax/i2400m/fw.c| 2 +- drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: wimax/i2400m: fix byte-order issue
fix sparse byte-order warnings by converting host byte-order type to __le16 byte-order types before assigning to hdr.length Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c index a159808f0..0f438ae6a 100644 --- a/drivers/staging/wimax/i2400m/op-rfkill.c +++ b/drivers/staging/wimax/i2400m/op-rfkill.c @@ -86,7 +86,7 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev, if (cmd == NULL) goto error_alloc; cmd->hdr.type = cpu_to_le16(I2400M_MT_CMD_RF_CONTROL); - cmd->hdr.length = sizeof(cmd->sw_rf); + cmd->hdr.length = cpu_to_le16(sizeof(cmd->sw_rf)); cmd->hdr.version = cpu_to_le16(I2400M_L3L4_VERSION); cmd->sw_rf.hdr.type = cpu_to_le16(I2400M_TLV_RF_OPERATION); cmd->sw_rf.hdr.length = cpu_to_le16(sizeof(cmd->sw_rf.status)); -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: wimax/i2400m: convert __le32 type to host byte-order
fix sparse type warning by converting __le32 types to host byte-order types before comparison Signed-off-by: karthik alapati --- drivers/staging/wimax/i2400m/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c index 92ea5c101..f09de1810 100644 --- a/drivers/staging/wimax/i2400m/fw.c +++ b/drivers/staging/wimax/i2400m/fw.c @@ -511,7 +511,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } - if (ack_size < ack->data_size + sizeof(*ack)) { + if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size, -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media/atomisp: don't compile unused code
currently the functions defined in ibuf_ctrl_rmgr.c file are only used by isys_init.c when CONFIG_VIDEO_ATOMISP_ISP2401 is selected so dont't compile it when not needed, also fixes some sparse warnings Signed-off-by: karthik alapati --- drivers/staging/media/atomisp/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index 1dfad0dd0..51498b2e8 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -126,7 +126,6 @@ atomisp-objs += \ pci/runtime/inputfifo/src/inputfifo.o \ pci/runtime/isp_param/src/isp_param.o \ pci/runtime/isys/src/csi_rx_rmgr.o \ - pci/runtime/isys/src/ibuf_ctrl_rmgr.o \ pci/runtime/isys/src/isys_dma_rmgr.o \ pci/runtime/isys/src/isys_init.o \ pci/runtime/isys/src/isys_stream2mmio_rmgr.o \ @@ -323,7 +322,9 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__ #DEFINES += -DUSE_KMEM_CACHE ifeq ($(CONFIG_VIDEO_ATOMISP_ISP2401),y) -atomisp-objs += $(obj-cht) +atomisp-objs += \ + $(obj-cht) \ + pci/runtime/isys/src/ibuf_ctrl_rmgr.o DEFINES += -DISP2401 -DISP2401_NEW_INPUT_SYSTEM -DSYSTEM_hive_isp_css_2401_system else atomisp-objs += $(obj-byt) -- 2.30.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: selftest: Make brw_inject_one_error() static
Since the function brw_inject_one_error() is used only within brw_test.c, make it static. This was reported as a warning by sparse. Signed-off-by: Karthik Nayak --- drivers/staging/lustre/lnet/selftest/brw_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index 67b460f..b9ac34e 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -136,7 +136,7 @@ brw_client_init(struct sfw_test_instance *tsi) return 0; } -int brw_inject_one_error(void) +static int brw_inject_one_error(void) { struct timespec64 ts; -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: Fix incorrect type assignment
This patch fixes the following sparse error: drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect type in assignment (different base types) drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected restricted __be32 [usertype] serial_number drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int This is done by introducing a temporary variable which is of type '__be32' and converting the existing variable to type 'unsigned int'. Signed-off-by: Karthik Nayak --- drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- drivers/staging/comedi/drivers/ni_stc.h| 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..4f45a5c230ad 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) unsigned int old_iodwbsr_bits; unsigned int old_iodwbsr1_bits; unsigned int old_iodwcr1_bits; + __be32 serial_number; int i; /* IO Window 1 needs to be temporarily mapped to read the eeprom */ @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); for (i = 0; i < serial_number_eeprom_length; ++i) { - char *byte_ptr = (char *)&devpriv->serial_number + i; + char *byte_ptr = (char *)&serial_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); + devpriv->serial_number = be32_to_cpu(serial_number); for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM + i); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..b5eca0da71eb 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,7 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - __be32 serial_number; + unsigned int serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott wrote: > On 07/02/17 19:06, Karthik Nayak wrote: >> >> This patch fixes the following sparse error: >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect >> type in assignment (different base types) >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected >> restricted __be32 [usertype] serial_number >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int >> >> This is done by introducing a temporary variable which is of type >> '__be32' and converting the existing variable to type 'unsigned int'. >> >> Signed-off-by: Karthik Nayak >> --- >> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >> 2 files changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c >> b/drivers/staging/comedi/drivers/ni_pcimio.c >> index cdb66eab1292..4f45a5c230ad 100644 >> --- a/drivers/staging/comedi/drivers/ni_pcimio.c >> +++ b/drivers/staging/comedi/drivers/ni_pcimio.c >> @@ -1207,6 +1207,7 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> unsigned int old_iodwbsr_bits; >> unsigned int old_iodwbsr1_bits; >> unsigned int old_iodwcr1_bits; >> + __be32 serial_number; >> int i; >> >> /* IO Window 1 needs to be temporarily mapped to read the eeprom >> */ >> @@ -1223,10 +1224,10 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> >> BUG_ON(serial_number_eeprom_length > >> sizeof(devpriv->serial_number)); >> for (i = 0; i < serial_number_eeprom_length; ++i) { >> - char *byte_ptr = (char *)&devpriv->serial_number + i; >> + char *byte_ptr = (char *)&serial_number + i; >> *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + >> i); >> } >> - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); >> + devpriv->serial_number = be32_to_cpu(serial_number); >> >> for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) >> devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM >> + i); >> diff --git a/drivers/staging/comedi/drivers/ni_stc.h >> b/drivers/staging/comedi/drivers/ni_stc.h >> index f27b545f83eb..b5eca0da71eb 100644 >> --- a/drivers/staging/comedi/drivers/ni_stc.h >> +++ b/drivers/staging/comedi/drivers/ni_stc.h >> @@ -1031,7 +1031,7 @@ struct ni_private { >> >> unsigned short ai_fifo_buffer[0x2000]; >> u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; >> - __be32 serial_number; >> + unsigned int serial_number; >> >> struct mite *mite; >> struct mite_channel *ai_mite_chan; >> > > That looks fine, thanks! > > (On a side note, nothing actually uses serial number, so the code that reads > it from the EEPROM could just be ripped out.) > > Reviewed-by: Ian Abbott > Yea, I saw that, was assuming there might be a purposed use case scenario. Do you want me to send another patch? -- Regards, Karthik Nayak ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hi, On Wed, Feb 8, 2017 at 7:18 PM, Ian Abbott wrote: > On 08/02/17 13:26, Karthik Nayak wrote: >> >> Hello, >> >> On Wed, Feb 8, 2017 at 6:43 PM, Ian Abbott wrote: >>> >>> On 07/02/17 19:06, Karthik Nayak wrote: >>>> >>>> >>>> This patch fixes the following sparse error: >>>> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect >>>> type in assignment (different base types) >>>> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected >>>> restricted __be32 [usertype] serial_number >>>> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int >>>> >>>> This is done by introducing a temporary variable which is of type >>>> '__be32' and converting the existing variable to type 'unsigned int'. >>>> >>>> Signed-off-by: Karthik Nayak >>>> --- >>>> drivers/staging/comedi/drivers/ni_pcimio.c | 5 +++-- >>>> drivers/staging/comedi/drivers/ni_stc.h| 2 +- >>>> 2 files changed, 4 insertions(+), 3 deletions(-) > > [snip] > >>> (On a side note, nothing actually uses serial number, so the code that >>> reads >>> it from the EEPROM could just be ripped out.) >>> >>> Reviewed-by: Ian Abbott >>> >> >> Yea, I saw that, was assuming there might be a purposed use case scenario. > > > AFAICT it's never been used - not even to print a kernel log message or > anything. > >> Do you want me to send another patch? > > > If you want. If you plan to do so, could you indicate whether you are going > to base the patch on top of this one, or whether this patch should be > discarded. Thanks! > Sure, I'll base it on top of the existing patch. I'll reply to the first patch with the second one. -- Regards, Karthik Nayak ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Drop the 'serial_number' variable from the struct 'ni_private' since its never used after assignment. Signed-off-by: Karthik Nayak --- This is to be based on top of "staging: comedi: Fix incorrect type assignment" to which this is replied to. drivers/staging/comedi/drivers/ni_pcimio.c | 3 +-- drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 4f45a5c230ad..da4d3da071eb 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1222,12 +1222,11 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) writel(0x1 | old_iodwcr1_bits, mite->mmio + MITE_IODWCR_1); writel(0xf, mite->mmio + 0x30); - BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); + BUG_ON(serial_number_eeprom_length > sizeof(serial_number)); for (i = 0; i < serial_number_eeprom_length; ++i) { char *byte_ptr = (char *)&serial_number + i; *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); } - devpriv->serial_number = be32_to_cpu(serial_number); for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM + i); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index b5eca0da71eb..61138e86a455 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,6 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - unsigned int serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Hey, On Wed, Feb 8, 2017 at 11:10 PM, Ian Abbott wrote: > On 08/02/2017 16:55, Karthik Nayak wrote: >> >> Drop the 'serial_number' variable from the struct 'ni_private' since >> its never used after assignment. >> >> Signed-off-by: Karthik Nayak >> --- >> >> This is to be based on top of "staging: comedi: Fix incorrect type >> assignment" >> to which this is replied to. >> >> drivers/staging/comedi/drivers/ni_pcimio.c | 3 +-- >> drivers/staging/comedi/drivers/ni_stc.h| 1 - >> 2 files changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c >> b/drivers/staging/comedi/drivers/ni_pcimio.c >> index 4f45a5c230ad..da4d3da071eb 100644 >> --- a/drivers/staging/comedi/drivers/ni_pcimio.c >> +++ b/drivers/staging/comedi/drivers/ni_pcimio.c >> @@ -1222,12 +1222,11 @@ static void m_series_init_eeprom_buffer(struct >> comedi_device *dev) >> writel(0x1 | old_iodwcr1_bits, mite->mmio + MITE_IODWCR_1); >> writel(0xf, mite->mmio + 0x30); >> > > I think it would be preferable to remove the code from here ... > >> - BUG_ON(serial_number_eeprom_length > >> sizeof(devpriv->serial_number)); >> + BUG_ON(serial_number_eeprom_length > sizeof(serial_number)); >> for (i = 0; i < serial_number_eeprom_length; ++i) { >> char *byte_ptr = (char *)&serial_number + i; >> *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + >> i); >> } >> - devpriv->serial_number = be32_to_cpu(serial_number); > > > ... to here. And remove the serial_number_eeprom_length, > serial_number_eeprom_offset, and serial_number variables too. There is no > need to continue reading the serial number bytes from the EEPROM. > Ah! I'll do that and send a patch, thanks :) >> >> for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) >> devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM >> + i); >> diff --git a/drivers/staging/comedi/drivers/ni_stc.h >> b/drivers/staging/comedi/drivers/ni_stc.h >> index b5eca0da71eb..61138e86a455 100644 >> --- a/drivers/staging/comedi/drivers/ni_stc.h >> +++ b/drivers/staging/comedi/drivers/ni_stc.h >> @@ -1031,7 +1031,6 @@ struct ni_private { >> >> unsigned short ai_fifo_buffer[0x2000]; >> u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; >> - unsigned int serial_number; >> >> struct mite *mite; >> struct mite_channel *ai_mite_chan; >> > > -- > -=( Ian Abbott @ MEV Ltd.E-mail: )=- > -=( Web: http://www.mev.co.uk/ )=- -- Regards, Karthik Nayak ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: comedi: drop unused variable from struct 'ni_private'
Hello, >> >> ... to here. And remove the serial_number_eeprom_length, >> serial_number_eeprom_offset, and serial_number variables too. There is no >> need to continue reading the serial number bytes from the EEPROM. >> > > Ah! I'll do that and send a patch, thanks :) > Sorry for the multiple messages, now that we're deleting the whole block, I think it makes sense to squash the commits, so I'll send one single patch. -- Regards, Karthik Nayak ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: Fix incorrect type assignment
This patch fixes the following sparse error: drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect type in assignment (different base types) drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected restricted __be32 [usertype] serial_number drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int This is done by removing the whole code block, since the variable 'serial_number' is only assigned but never used. Helped-by: Ian Abbott Signed-off-by: Karthik Nayak --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1202,8 +1202,6 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) resource_size_t daq_phys_addr; static const int Start_Cal_EEPROM = 0x400; static const unsigned int window_size = 10; - static const int serial_number_eeprom_offset = 0x4; - static const int serial_number_eeprom_length = 0x4; unsigned int old_iodwbsr_bits; unsigned int old_iodwbsr1_bits; unsigned int old_iodwcr1_bits; @@ -1221,13 +1219,6 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) writel(0x1 | old_iodwcr1_bits, mite->mmio + MITE_IODWCR_1); writel(0xf, mite->mmio + 0x30); - BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); - for (i = 0; i < serial_number_eeprom_length; ++i) { - char *byte_ptr = (char *)&devpriv->serial_number + i; - *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); - } - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); - for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM + i); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..61138e86a455 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,6 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: Fix incorrect type assignment
Hello, On Thu, Feb 9, 2017 at 4:34 PM, Greg KH wrote: > On Thu, Feb 09, 2017 at 01:53:56AM +0530, Karthik Nayak wrote: >> This patch fixes the following sparse error: >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect type >> in assignment (different base types) >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected restricted >> __be32 [usertype] serial_number >> drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int >> >> This is done by removing the whole code block, since the variable >> 'serial_number' is only assigned but never used. >> >> Helped-by: Ian Abbott > > There's no such tag, sorry :( > Ah! This is common back in the Git community, I shall drop it :) > And does this obsolete all of your other ones? Please make it obvious > what I am supposed to do here. > > I've now dropped all of these patches from my queue. please resend the > proper one. > That works! I'll send the patch again, lets ignore the previous patches. On Thu, Feb 9, 2017 at 4:52 PM, Ian Abbott wrote: > To add to that, I think the emphasis of the patch title and description > should now be on the removal of serial_number, with fixing the sparse error > as a useful side-effect/inspiration. The patch title should also mention > ni_pcimio. > > Thanks, > Ian. Makes sense, will make the necessary changes. -- Regards, Karthik Nayak ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: ni_pcimio: remove unused variable 'serial_number'
The struct 'ni_private' holds the variable 'serial_number' which post assignment is never used. Remove the variable and code pertaining to obtaining its value. As a side note, this also fixes the following sparse error: drivers/staging/comedi/drivers//ni_pcimio.c:1229:32: warning: incorrect type in assignment (different base types) drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:expected restricted __be32 [usertype] serial_number drivers/staging/comedi/drivers//ni_pcimio.c:1229:32:got unsigned int Signed-off-by: Karthik Nayak --- drivers/staging/comedi/drivers/ni_pcimio.c | 9 - drivers/staging/comedi/drivers/ni_stc.h| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index cdb66eab1292..3a96913c025e 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1202,8 +1202,6 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) resource_size_t daq_phys_addr; static const int Start_Cal_EEPROM = 0x400; static const unsigned int window_size = 10; - static const int serial_number_eeprom_offset = 0x4; - static const int serial_number_eeprom_length = 0x4; unsigned int old_iodwbsr_bits; unsigned int old_iodwbsr1_bits; unsigned int old_iodwcr1_bits; @@ -1221,13 +1219,6 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) writel(0x1 | old_iodwcr1_bits, mite->mmio + MITE_IODWCR_1); writel(0xf, mite->mmio + 0x30); - BUG_ON(serial_number_eeprom_length > sizeof(devpriv->serial_number)); - for (i = 0; i < serial_number_eeprom_length; ++i) { - char *byte_ptr = (char *)&devpriv->serial_number + i; - *byte_ptr = ni_readb(dev, serial_number_eeprom_offset + i); - } - devpriv->serial_number = be32_to_cpu(devpriv->serial_number); - for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) devpriv->eeprom_buffer[i] = ni_readb(dev, Start_Cal_EEPROM + i); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index f27b545f83eb..61138e86a455 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1031,7 +1031,6 @@ struct ni_private { unsigned short ai_fifo_buffer[0x2000]; u8 eeprom_buffer[M_SERIES_EEPROM_SIZE]; - __be32 serial_number; struct mite *mite; struct mite_channel *ai_mite_chan; -- 2.11.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issues by checkpatch Signed-off-by: Karthik Nayak --- drivers/staging/et131x/et131x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f1a9296 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) skb = dev_alloc_skb(rfd->len + 2); if (!skb) { - dev_err(&adapter->pdev->dev, "Couldn't alloc an SKB for Rx\n"); return NULL; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm: multiple checkpatch fixes for InterfaceIdleMode.c
1. WARNING: else is not generally useful after a break or return 2. WARNING: quoted string split across lines 3. WARNING: break quoted strings at a space character Signed-off-by: Karthik Nayak --- drivers/staging/bcm/InterfaceIdleMode.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/bcm/InterfaceIdleMode.c b/drivers/staging/bcm/InterfaceIdleMode.c index c84ee49..9a77a98 100644 --- a/drivers/staging/bcm/InterfaceIdleMode.c +++ b/drivers/staging/bcm/InterfaceIdleMode.c @@ -188,10 +188,9 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, 5000); if (status) return status; - else - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, - IDLE_MODE, DBG_LVL_ALL, - "NOB Sent down :%d", lenwritten); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, + IDLE_MODE, DBG_LVL_ALL, + "NOB Sent down :%d", lenwritten); /* mdelay(25); */ @@ -211,8 +210,8 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter, else BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, DBG_LVL_ALL, - "Number of completed iteration to" - "read chip-id :%lu", itr); + "Number of completed iteration to read chip-id :%lu", + itr); status = wrmalt(Adapter, SW_ABORT_IDLEMODE_LOC, &Pattern, sizeof(status)); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: et131x: remove unneccessary 'out of memory' message
Oops, i sent the old commit again, sorry! Regards, Karthik Nayak On Tue, Sep 30, 2014 at 11:10 PM, Fabio Estevam wrote: > On Tue, Sep 30, 2014 at 2:19 PM, Karthik Nayak wrote: >> Removes the 'out of memory' warning issues by checkpatch >> >> Signed-off-by: Karthik Nayak >> --- >> drivers/staging/et131x/et131x.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/staging/et131x/et131x.c >> b/drivers/staging/et131x/et131x.c >> index 41fcaa0..f1a9296 100644 >> --- a/drivers/staging/et131x/et131x.c >> +++ b/drivers/staging/et131x/et131x.c >> @@ -2423,7 +2423,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter >> *adapter) >> >> skb = dev_alloc_skb(rfd->len + 2); >> if (!skb) { >> - dev_err(&adapter->pdev->dev, "Couldn't alloc an SKB for >> Rx\n"); >> return NULL; >> } > > Then you could also remove the braces: > > if (!skb) > return NULL; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: et131x: remove unneccessary 'out of memory' message
Removes the 'out of memory' warning issued by checkpatch Signed-off-by: Karthik Nayak --- drivers/staging/et131x/et131x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 41fcaa0..f92cceb 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -2422,10 +2422,8 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) rfd->len = len; skb = dev_alloc_skb(rfd->len + 2); - if (!skb) { - dev_err(&adapter->pdev->dev, "Couldn't alloc an SKB for Rx\n"); + if (!skb) return NULL; - } adapter->netdev->stats.rx_bytes += rfd->len; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm: remove unnecessary else statement
Removed the else statement occurring after an if statement with a return value as per checkpatch warning. Signed-off-by: Karthik Nayak --- drivers/staging/bcm/InterfaceMisc.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index e5bcfec..1f31b8f 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -102,12 +102,11 @@ int InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter, DBG_LVL_ALL, "WRM failed status :%d", retval); psIntfAdapter->psAdapter->DeviceAccess = false; return retval; - } else { - psIntfAdapter->psAdapter->DeviceAccess = false; - BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, - DBG_LVL_ALL, "WRM sent %d", retval); - return STATUS_SUCCESS; } + psIntfAdapter->psAdapter->DeviceAccess = false; + BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, + DBG_LVL_ALL, "WRM sent %d", retval); + return STATUS_SUCCESS; } int BcmRDM(void *arg, -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: andriod: ashmem: Declared file operation with const keyword
On Sat, Mar 13, 2021 at 10:57 PM namratajanawade wrote: > > Warning found by checkpatch.pl script. That doesn't tell what you did or why you did it. Please write an appropriate commit description and resend the patch. karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: greybus: audio_helper.c: Replace strlcpy() with strscpy()
In gbaudio_remove_controls() , replace the usage of strlcpy() with strscpy() because strlcpy() only limits the *destination* size, and the source is always read fully. https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ was quoted by checkpatch while showing this warning. Signed-off-by: B K Karthik --- drivers/staging/greybus/audio_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_helper.c b/drivers/staging/greybus/audio_helper.c index 3011b8abce38..1ed4772d2771 100644 --- a/drivers/staging/greybus/audio_helper.c +++ b/drivers/staging/greybus/audio_helper.c @@ -166,7 +166,7 @@ static int gbaudio_remove_controls(struct snd_card *card, struct device *dev, snprintf(id.name, sizeof(id.name), "%s %s", prefix, control->name); else - strlcpy(id.name, control->name, sizeof(id.name)); + strscpy(id.name, control->name, sizeof(id.name)); id.numid = 0; id.iface = control->iface; id.device = control->device; -- 2.17.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: changed coding style, line should not end with a (
Signed-off-by: B K Karthik --- drivers/staging/nvec/nvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 360ec0407740..16afbe1dfdeb 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -382,8 +382,8 @@ static void nvec_request_master(struct work_struct *work) msg = list_first_entry(&nvec->tx_data, struct nvec_msg, node); spin_unlock_irqrestore(&nvec->tx_lock, flags); nvec_gpio_set_value(nvec, 0); - err = wait_for_completion_interruptible_timeout( - &nvec->ec_transfer, msecs_to_jiffies(5000)); + err = wait_for_completion_interruptible_timeout(&nvec->ec_transfer, + msecs_to_jiffies(5000)); if (err == 0) { dev_warn(nvec->dev, "timeout waiting for ec transfer\n"); -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] staging: media: soc_camera: Adding parentheses to macro defination at line 241, Clearing alignment issues at lines 410 and 1270, fixing return values at EPOLLERR
staging: media: soc_camera: soc_camera.c: Clearing coding-style problem "Macros with complex values should be enclosed in parentheses" in line 241 by adding parentheses. staging: media: soc_camera: soc_camera.c: Clearing coding-style problem "Alignment should match open parenthesis" by adding tab spaces in line 410. staging: media: soc_camera: soc_camera.c: Clearing coding-style problem "return of an errno should typically be negative" by adding a "-" in front of EPOLLER in line 812. staging: media: soc_camera: soc_camera.c: Clearing coding-style problem "Alignment should match open parenthesis" by adding tab spaces in line 1270. Signed-off-by: B K Karthik --- drivers/staging/media/soc_camera/soc_camera.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/soc_camera/soc_camera.c b/drivers/staging/media/soc_camera/soc_camera.c index 39f513f69b89..66a14ebd8093 100644 --- a/drivers/staging/media/soc_camera/soc_camera.c +++ b/drivers/staging/media/soc_camera/soc_camera.c @@ -238,8 +238,8 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, } EXPORT_SYMBOL(soc_camera_apply_board_flags); -#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ - ((x) >> 24) & 0xff +#define pixfmtstr(x) ((x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ + ((x) >> 24) & 0xff) static int soc_camera_try_fmt(struct soc_camera_device *icd, struct v4l2_format *f) @@ -407,7 +407,7 @@ static int soc_camera_dqbuf(struct file *file, void *priv, } static int soc_camera_create_bufs(struct file *file, void *priv, - struct v4l2_create_buffers *create) + struct v4l2_create_buffers *create) { struct soc_camera_device *icd = file->private_data; int ret; @@ -806,10 +806,10 @@ static __poll_t soc_camera_poll(struct file *file, poll_table *pt) { struct soc_camera_device *icd = file->private_data; struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - __poll_t res = EPOLLERR; + __poll_t res = -EPOLLERR; if (icd->streamer != file) - return EPOLLERR; + return -EPOLLERR; mutex_lock(&ici->host_lock); res = ici->ops->poll(file, pt); @@ -1267,7 +1267,7 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd, } subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, - shd->board_info, NULL); + shd->board_info, NULL); if (!subdev) { ret = -ENODEV; goto ei2cnd; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] fixing ERROR: Macros with complex values must be enclosed within parentheses.
soc_camera.c: fixing ERROR: Macros with complex values must be enclused within parentheses. Signed-off-by: B K Karthik --- drivers/staging/media/soc_camera/soc_camera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/media/soc_camera/soc_camera.c b/drivers/staging/media/soc_camera/soc_camera.c index 39f513f69b89..f609ecf6691c 100644 --- a/drivers/staging/media/soc_camera/soc_camera.c +++ b/drivers/staging/media/soc_camera/soc_camera.c @@ -238,8 +238,7 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, } EXPORT_SYMBOL(soc_camera_apply_board_flags); -#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ - ((x) >> 24) & 0xff +#define pixfmtstr(x) ((x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, ((x) >> 24) & 0xff) static int soc_camera_try_fmt(struct soc_camera_device *icd, struct v4l2_format *f) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
fixing ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: B K Karthik --- drivers/staging/media/usbvision/usbvision-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/usbvision/usbvision-i2c.c b/drivers/staging/media/usbvision/usbvision-i2c.c index 6e4df3335b1b..010ad03c6ec1 100644 --- a/drivers/staging/media/usbvision/usbvision-i2c.c +++ b/drivers/staging/media/usbvision/usbvision-i2c.c @@ -32,7 +32,7 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); #define PDEBUG(level, fmt, args...) { \ if (i2c_debug & (level)) \ printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \ - __func__, __LINE__ , ## args); \ + __func__, __LINE__, ## args); \ } static int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned char addr, char *buf, -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] fbtft-bus.c:
fbtft-bus.c: fixing ERROR: space prohibited before that close parenthesis ')' by removing that space and ',' in line 65 and 67. Signed-off-by: B K Karthik --- drivers/staging/fbtft/fbtft-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 63c65dd67b17..847cbfbbd766 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -62,9 +62,9 @@ out: \ } \ EXPORT_SYMBOL(func); -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, ) +define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) { -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] fbtft-bus.c: Removing that prohibited space before ')'
fbtft-bus.c: fixing ERROR: space prohibited before that close parenthesis ')' by removing that space and ',' in line 65 and 67. Signed-off-by: B K Karthik --- drivers/staging/fbtft/fbtft-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 63c65dd67b17..847cbfbbd766 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -62,9 +62,9 @@ out: \ } \ EXPORT_SYMBOL(func); -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, ) +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) -define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, ) +define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) { -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] qlge.h: Adding the missing blank line after declarations
Signed-off-by: B K Karthik --- drivers/staging/qlge/qlge.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/qlge/qlge.h b/drivers/staging/qlge/qlge.h index fc8c5ca8935d..0b971a633001 100644 --- a/drivers/staging/qlge/qlge.h +++ b/drivers/staging/qlge/qlge.h @@ -2224,6 +2224,7 @@ static inline void ql_write_db_reg_relaxed(u32 val, void __iomem *addr) static inline u32 ql_read_sh_reg(__le32 *addr) { u32 reg; + reg = le32_to_cpu(*addr); rmb(); return reg; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8712: rtl8712_recv.h: Removing unnecessary blank line
Removing unnecessary blank line Signed-off-by: B K Karthik --- drivers/staging/rtl8712/rtl8712_recv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.h b/drivers/staging/rtl8712/rtl8712_recv.h index 3e385b2242d8..69d3d5b287d3 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.h +++ b/drivers/staging/rtl8712/rtl8712_recv.h @@ -84,7 +84,6 @@ union recvstat { unsigned int value[RXDESC_SIZE>>2]; }; - struct recv_buf { struct list_head list; spinlock_t recvbuf_lock; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
Thank you for the information. I will take care of all these things from the next time. sorry for wasting your time thanks, karthik On Sat, Jun 27, 2020 at 4:49 AM Greg Kroah-Hartman wrote: > > On Sat, Jun 27, 2020 at 10:28:31AM +0200, Hans Verkuil wrote: > > On 27/06/2020 07:07, Greg Kroah-Hartman wrote: > > > > > > A: http://en.wikipedia.org/wiki/Top_post > > > Q: Were do I find info about this thing called top-posting? > > > A: Because it messes up the order in which people normally read text. > > > Q: Why is top-posting such a bad thing? > > > A: Top-posting. > > > Q: What is the most annoying thing in e-mail? > > > > > > A: No. > > > Q: Should I include quotations after my reply? > > > > > > http://daringfireball.net/2007/07/on_top > > > > > > On Fri, Jun 26, 2020 at 11:42:49AM -0400, B K KARTHIK > > > PES2201800185STUDENT ECE DeptPESU EC Campus wrote: > > >> Oh, I'm sorry but wouldn't it be helpful if we had a file that lists > > >> all drivers that are scheduled for removal? > > > > > > The TODO file in the directory for the driver should have this > > > information in it. I don't know if all of the media drivers have this, > > > if not, then there is no way you could have known this. > > > > They have, and in addition the Kconfig entry will mention that the driver > > is deprecated. > > > > TODO of usbvision: > > > > The driver is deprecated and scheduled for removal by the end > > of 2020. > > > > In order to prevent removal the following actions would have to > > be taken: > > > > - clean up the code > > - convert to the vb2 framework > > - fix the disconnect and free-on-last-user handling (i.e., add > > a release callback for struct v4l2_device and rework the code > > to use that correctly). > > Ah, great, nevermind then! > > B K, your wish is already granted, the text is present, you just needed > to have noticed it :) > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue.
Fixed a coding style issue. Signed-off-by: B K Karthik --- drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 90d125ba080f..c90730513438 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -495,11 +495,11 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 value) ret = ov2680_read_reg(client, 1, OV2680_MIRROR_REG, &val); if (ret) return ret; - if (value) { + if (value) val |= OV2680_FLIP_MIRROR_BIT_ENABLE; - } else { + else val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE; - } + ret = ov2680_write_reg(client, 1, OV2680_MIRROR_REG, val); if (ret) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: hal8188e_rate_adaptive.h: fixed a blank space coding style issue
added blank space around arithmetic operators to improve readability Signed-off-by: B K Karthik --- .../rtl8188eu/include/hal8188e_rate_adaptive.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h b/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h index 5b59c25e4c8a..79c0d2f9961e 100644 --- a/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h +++ b/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h @@ -35,17 +35,17 @@ #define GET_TX_REPORT_TYPE1_RERTY_0(__pAddr) \ LE_BITS_TO_4BYTE(__pAddr, 0, 16) #define GET_TX_REPORT_TYPE1_RERTY_1(__pAddr) \ - LE_BITS_TO_1BYTE(__pAddr+2, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 2, 0, 8) #define GET_TX_REPORT_TYPE1_RERTY_2(__pAddr) \ - LE_BITS_TO_1BYTE(__pAddr+3, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 3, 0, 8) #define GET_TX_REPORT_TYPE1_RERTY_3(__pAddr) \ - LE_BITS_TO_1BYTE(__pAddr+4, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 4, 0, 8) #define GET_TX_REPORT_TYPE1_RERTY_4(__pAddr) \ - LE_BITS_TO_1BYTE(__pAddr+4+1, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 4 + 1, 0, 8) #define GET_TX_REPORT_TYPE1_DROP_0(__pAddr)\ - LE_BITS_TO_1BYTE(__pAddr+4+2, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 4 + 2, 0, 8) #define GET_TX_REPORT_TYPE1_DROP_1(__pAddr)\ - LE_BITS_TO_1BYTE(__pAddr+4+3, 0, 8) + LE_BITS_TO_1BYTE(__pAddr + 4 + 3, 0, 8) /* End rate adaptive define */ -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: odm.h: fixed a blank space coding style issue.
added blank space and enclosed a complex valued macro within parentheses for improved code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/odm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h index 9d39fe13626a..27bffc2ead66 100644 --- a/drivers/staging/rtl8188eu/include/odm.h +++ b/drivers/staging/rtl8188eu/include/odm.h @@ -244,7 +244,7 @@ struct odm_rate_adapt { #define AVG_THERMAL_NUM8 #define IQK_Matrix_REG_NUM 8 -#define IQK_Matrix_Settings_NUM1+24+21 +#define IQK_Matrix_Settings_NUM(1 + 24 + 21) #defineDM_Type_ByFWi 0 #defineDM_Type_ByDriver1 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: ieee80211.h: fixed multiple blank line coding style issues.
removed multiple blank lines to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/ieee80211.h | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index 75f0ebe0faf5..93fd0e9c49dc 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -90,7 +90,6 @@ enum { #define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6 #define IEEE_CRYPT_ERR_CARD_CONF_FAILED7 - #defineIEEE_CRYPT_ALG_NAME_LEN 16 #define WPA_CIPHER_NONEBIT(0) @@ -99,8 +98,6 @@ enum { #define WPA_CIPHER_TKIPBIT(3) #define WPA_CIPHER_CCMPBIT(4) - - #define WPA_SELECTOR_LEN 4 extern u8 RTW_WPA_OUI_TYPE[]; extern u8 WPA_AUTH_KEY_MGMT_NONE[]; @@ -113,7 +110,6 @@ extern u8 WPA_CIPHER_SUITE_WRAP[]; extern u8 WPA_CIPHER_SUITE_CCMP[]; extern u8 WPA_CIPHER_SUITE_WEP104[]; - #define RSN_HEADER_LEN 4 #define RSN_SELECTOR_LEN 4 @@ -192,7 +188,6 @@ enum NETWORK_TYPE { #define IsSupportedTxMCS(NetType) \ ((NetType) & (WIRELESS_11_24N | WIRELESS_11_5N) ? true : false) - struct ieee_param { u32 cmd; u8 sta_addr[ETH_ALEN]; @@ -270,11 +265,9 @@ struct sta_data { * WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ - #define IEEE80211_HLEN 30 #define IEEE80211_FRAME_LEN(IEEE80211_DATA_LEN + IEEE80211_HLEN) - /* this is stolen from ipw2200 driver */ #define IEEE_IBSS_MAC_HASH_SIZE 31 @@ -297,7 +290,6 @@ enum eap_type { #define RTW_IEEE80211_SCTL_FRAG0x000F #define RTW_IEEE80211_SCTL_SEQ 0xFFF0 - #define RTW_ERP_INFO_NON_ERP_PRESENT BIT(0) #define RTW_ERP_INFO_USE_PROTECTION BIT(1) #define RTW_ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) @@ -354,7 +346,6 @@ struct ieee80211_snap_hdr { #define IEEE80211_CCK_RATE_LEN 4 #define IEEE80211_NUM_OFDM_RATESLEN8 - #define IEEE80211_CCK_RATE_1MB 0x02 #define IEEE80211_CCK_RATE_2MB 0x04 #define IEEE80211_CCK_RATE_5MB 0x0B -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue.
Did this get burried in along with a bunch of other patches? I am sending this email only because I did not recieve a negetive acknowledgement on the patch. I apologize if this message was hurtful / disrespectfull in any manner, thank you for reading this message. karthik On 20/06/28 12:38AM, B K Karthik wrote: > Fixed a coding style issue. > > Signed-off-by: B K Karthik > --- > drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > index 90d125ba080f..c90730513438 100644 > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c > @@ -495,11 +495,11 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 > value) > ret = ov2680_read_reg(client, 1, OV2680_MIRROR_REG, &val); > if (ret) > return ret; > - if (value) { > + if (value) > val |= OV2680_FLIP_MIRROR_BIT_ENABLE; > - } else { > + else > val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE; > - } > + > ret = ov2680_write_reg(client, 1, > OV2680_MIRROR_REG, val); > if (ret) > -- > 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues
added blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h index 49884cceb349..c115007d883d 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h @@ -30,11 +30,11 @@ #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \ SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value) #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value) + SET_BITS_TO_LE_4BYTE(__pAdd r +4, 0, 8, __Value) #define SET_EARLYMODE_LEN3(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value) #define SET_EARLYMODE_LEN4(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value) /* */ /* defined for TX DESC Operation */ @@ -100,7 +100,7 @@ enum TXDESC_SC { #define txdesc_set_ccx_sw_88e(txdesc, value) \ do { \ - ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \ + ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); \ ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \ } while (0) @@ -138,9 +138,9 @@ struct txrpt_ccx_88e { u8 sw0; }; -#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) +#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 8)) #define txrpt_ccx_qtime_88e(txrpt_ccx) \ - ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) + ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8)) void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtw_cmd.h: fixed a blank space coding style issue.
add blank spaces for improved code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fa5e212fc9e0..002a797c6d0a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -115,7 +115,7 @@ struct setopmode_parm { */ #define RTW_SSID_SCAN_AMOUNT 9 /* for WEXT_CSCAN_AMOUNT 9 */ -#define RTW_CHANNEL_SCAN_AMOUNT (14+37) +#define RTW_CHANNEL_SCAN_AMOUNT (14 + 37) struct sitesurvey_parm { int scan_mode; /* active: 1, passive: 0 */ u8 ssid_num; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed multiple parentheses coding style issues.
add parentheses since complex valued macros must be enclosed within parentheses. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index 404634999e35..c89328142731 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME 1*HZ /* 1 sec */ +#define LPS_DELAY_TIME (i*HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 @@ -201,7 +201,7 @@ struct pwrctrl_priv { }; #define rtw_get_ips_mode_req(pwrctrlpriv) \ - (pwrctrlpriv)->ips_mode_req + ((pwrctrlpriv)->ips_mode_req) #define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \ ((pwrctrlpriv)->ips_mode_req = (ips_mode)) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed a blank space coding style issue.
add blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index c89328142731..b4cf0f1ce6d3 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME (1*HZ) /* 1 sec */ +#define LPS_DELAY_TIME (1 * HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtw_recv.h: fixed a blank space coding style issue.
added blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index e383cb119e1b..b281b9e7fcea 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -13,7 +13,7 @@ #define NR_RECVFRAME 256 #define RXFRAME_ALIGN 8 -#define RXFRAME_ALIGN_SZ (1< signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues
added blank spaces to improve code readability. (coding style issue) Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h index 49884cceb349..c115007d883d 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h @@ -30,11 +30,11 @@ #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \ SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value) #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 0, 8, __Value) #define SET_EARLYMODE_LEN3(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value) #define SET_EARLYMODE_LEN4(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value) /* */ /* defined for TX DESC Operation */ @@ -100,7 +100,7 @@ enum TXDESC_SC { #define txdesc_set_ccx_sw_88e(txdesc, value) \ do { \ - ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \ + ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); \ ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \ } while (0) @@ -138,9 +138,9 @@ struct txrpt_ccx_88e { u8 sw0; }; -#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) +#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 8)) #define txrpt_ccx_qtime_88e(txrpt_ccx) \ - ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) + ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8)) void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed multiple parentheses coding style issues.
add parentheses since complex valued macros must be enclosed within parentheses. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index 404634999e35..c89328142731 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME 1*HZ /* 1 sec */ +#define LPS_DELAY_TIME (1*HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 @@ -201,7 +201,7 @@ struct pwrctrl_priv { }; #define rtw_get_ips_mode_req(pwrctrlpriv) \ - (pwrctrlpriv)->ips_mode_req + ((pwrctrlpriv)->ips_mode_req) #define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \ ((pwrctrlpriv)->ips_mode_req = (ips_mode)) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed a blank space coding style issue.
add blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index c89328142731..b4cf0f1ce6d3 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME (1*HZ) /* 1 sec */ +#define LPS_DELAY_TIME (1 * HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues
added blank spaces to improve code readability. (coding style issue) Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h index 49884cceb349..c115007d883d 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h @@ -30,11 +30,11 @@ #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \ SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value) #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 0, 8, __Value) #define SET_EARLYMODE_LEN3(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value) #define SET_EARLYMODE_LEN4(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value) /* */ /* defined for TX DESC Operation */ @@ -100,7 +100,7 @@ enum TXDESC_SC { #define txdesc_set_ccx_sw_88e(txdesc, value) \ do { \ - ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \ + ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); \ ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \ } while (0) @@ -138,9 +138,9 @@ struct txrpt_ccx_88e { u8 sw0; }; -#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) +#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 8)) #define txrpt_ccx_qtime_88e(txrpt_ccx) \ - ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) + ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8)) void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtw_cmd.h: fixed a blank space coding style issue.
add blank spaces for improved code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fa5e212fc9e0..002a797c6d0a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -115,7 +115,7 @@ struct setopmode_parm { */ #define RTW_SSID_SCAN_AMOUNT 9 /* for WEXT_CSCAN_AMOUNT 9 */ -#define RTW_CHANNEL_SCAN_AMOUNT (14+37) +#define RTW_CHANNEL_SCAN_AMOUNT (14 + 37) struct sitesurvey_parm { int scan_mode; /* active: 1, passive: 0 */ u8 ssid_num; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: include: rtw_recv.h: fixed a blank space coding style issue.
added blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index e383cb119e1b..b281b9e7fcea 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -13,7 +13,7 @@ #define NR_RECVFRAME 256 #define RXFRAME_ALIGN 8 -#define RXFRAME_ALIGN_SZ (1< signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed multiple parentheses coding style issues.
add parentheses since complex valued macros must be enclosed within parentheses. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index 404634999e35..c89328142731 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME 1*HZ /* 1 sec */ +#define LPS_DELAY_TIME (1*HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 @@ -201,7 +201,7 @@ struct pwrctrl_priv { }; #define rtw_get_ips_mode_req(pwrctrlpriv) \ - (pwrctrlpriv)->ips_mode_req + ((pwrctrlpriv)->ips_mode_req) #define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \ ((pwrctrlpriv)->ips_mode_req = (ips_mode)) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed a blank space coding style issue.
add blank spaces to improve code readability. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h index c89328142731..b4cf0f1ce6d3 100644 --- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h @@ -84,7 +84,7 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -#define LPS_DELAY_TIME (1*HZ) /* 1 sec */ +#define LPS_DELAY_TIME (1 * HZ) /* 1 sec */ #define EXE_PWR_NONE 0x01 #define EXE_PWR_IPS0x02 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: media: atomisp: pci: css_2401_system: host: csi_rx.c: fixed a sparse warning by making undeclared symbols static
changed symbols N_SHORT_PACKET_LUT_ENTRIES, N_LONG_PACKET_ENTRIES, N_CSI_RX_FE_CTRL_DLANES, N_CSI_RX_BE_SID_WIDTH to static because they were not declared earlier. Signed-off-by: B K Karthik --- .../media/atomisp/pci/css_2401_system/host/csi_rx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c index 8e661091f7d9..4d2076db1240 100644 --- a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c +++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c @@ -15,26 +15,26 @@ #include "system_global.h" -const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { +static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { 4, /* 4 entries at CSI_RX_BACKEND0_ID*/ 4, /* 4 entries at CSI_RX_BACKEND1_ID*/ 4 /* 4 entries at CSI_RX_BACKEND2_ID*/ }; -const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { +static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { 8, /* 8 entries at CSI_RX_BACKEND0_ID*/ 4, /* 4 entries at CSI_RX_BACKEND1_ID*/ 4 /* 4 entries at CSI_RX_BACKEND2_ID*/ }; -const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = { +static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = { N_CSI_RX_DLANE_ID, /* 4 dlanes for CSI_RX_FR0NTEND0_ID */ N_CSI_RX_DLANE_ID, /* 4 dlanes for CSI_RX_FR0NTEND1_ID */ N_CSI_RX_DLANE_ID /* 4 dlanes for CSI_RX_FR0NTEND2_ID */ }; /* sid_width for CSI_RX_BACKEND_ID */ -const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = { +static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = { 3, 2, 2 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: media: atomisp: mark some csi_rx.c symbols static
changed symbols N_SHORT_PACKET_LUT_ENTRIES, N_LONG_PACKET_ENTRIES, N_CSI_RX_FE_CTRL_DLANES, N_CSI_RX_BE_SID_WIDTH to static because they were not declared earlier. Signed-off-by: B K Karthik --- .../media/atomisp/pci/css_2401_system/host/csi_rx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c index 8e661091f7d9..4d2076db1240 100644 --- a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c +++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c @@ -15,26 +15,26 @@ #include "system_global.h" -const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { +static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { 4, /* 4 entries at CSI_RX_BACKEND0_ID*/ 4, /* 4 entries at CSI_RX_BACKEND1_ID*/ 4 /* 4 entries at CSI_RX_BACKEND2_ID*/ }; -const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { +static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = { 8, /* 8 entries at CSI_RX_BACKEND0_ID*/ 4, /* 4 entries at CSI_RX_BACKEND1_ID*/ 4 /* 4 entries at CSI_RX_BACKEND2_ID*/ }; -const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = { +static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = { N_CSI_RX_DLANE_ID, /* 4 dlanes for CSI_RX_FR0NTEND0_ID */ N_CSI_RX_DLANE_ID, /* 4 dlanes for CSI_RX_FR0NTEND1_ID */ N_CSI_RX_DLANE_ID /* 4 dlanes for CSI_RX_FR0NTEND2_ID */ }; /* sid_width for CSI_RX_BACKEND_ID */ -const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = { +static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = { 3, 2, 2 -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
fixed a sparse warning by changing the type in assignment from void [noderef] __user * to unsigned int * (different address space) Signed-off-by: B K Karthik --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 3f70e5dfac39..4cc012e231b7 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, cmd->scan_end_arg = v32.scan_end_arg; cmd->stop_src = v32.stop_src; cmd->stop_arg = v32.stop_arg; - cmd->chanlist = compat_ptr(v32.chanlist); + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); cmd->chanlist_len = v32.chanlist_len; cmd->data = compat_ptr(v32.data); cmd->data_len = v32.data_len; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 3:08 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > fixed a sparse warning by changing the type in > > assignment from void [noderef] __user * to unsigned int * > > (different address space) > > > > Signed-off-by: B K Karthik > > --- > > drivers/staging/comedi/comedi_fops.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > b/drivers/staging/comedi/comedi_fops.c > > index 3f70e5dfac39..4cc012e231b7 100644 > > --- a/drivers/staging/comedi/comedi_fops.c > > +++ b/drivers/staging/comedi/comedi_fops.c > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, > > cmd->scan_end_arg = v32.scan_end_arg; > > cmd->stop_src = v32.stop_src; > > cmd->stop_arg = v32.stop_arg; > > - cmd->chanlist = compat_ptr(v32.chanlist); > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > cmd->chanlist_len = v32.chanlist_len; > > cmd->data = compat_ptr(v32.data); > > cmd->data_len = v32.data_len; > > Always run your patches through checkpatch before sending them, so you > do not have a grumpy maintainer telling you that you have to run > checkpatch on your patch before sending them. I will, Sorry for that. But this particular error which showed up after running checkpatch is something 'git format-patch' does unintentionally. It has been reported to the maintainers. thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote: > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman < > > gre...@linuxfoundation.org> wrote: > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > > > fixed a sparse warning by changing the type in > > > > assignment from void [noderef] __user * to unsigned int * > > > > (different address space) > > > > > > > > Signed-off-by: B K Karthik > > > > --- > > > > drivers/staging/comedi/comedi_fops.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > > b/drivers/staging/comedi/comedi_fops.c > > > > index 3f70e5dfac39..4cc012e231b7 100644 > > > > --- a/drivers/staging/comedi/comedi_fops.c > > > > +++ b/drivers/staging/comedi/comedi_fops.c > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, > > > > cmd->scan_end_arg = v32.scan_end_arg; > > > > cmd->stop_src = v32.stop_src; > > > > cmd->stop_arg = v32.stop_arg; > > > > - cmd->chanlist = compat_ptr(v32.chanlist); > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > > > cmd->chanlist_len = v32.chanlist_len; > > > > cmd->data = compat_ptr(v32.data); > > > > cmd->data_len = v32.data_len; > > > > > > Always run your patches through checkpatch before sending them, so you > > > do not have a grumpy maintainer telling you that you have to run > > > checkpatch on your patch before sending them. > > > > > > > I will. Sorry for that. > > > > But the error that's being shown in this patch is something that comes up > > on its own. > > No it is not. > > > git format-patch leaves trailing whitespace in blank lines. > > It does? Where is any trailing whitespace here? That's not the issue. To give you an example, https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/ was a patch i submitted recently. This is what checkpatch has to say: $ perl scripts/checkpatch.pl -f ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch ERROR: trailing whitespace #21: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21: + $ ERROR: trailing whitespace #23: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23: + $ ERROR: trailing whitespace #30: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30: + $ ERROR: trailing whitespace #37: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37: + $ ERROR: trailing whitespace #44: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44: + $ ERROR: trailing whitespace #51: FILE: ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51: +-- $ total: 6 errors, 0 warnings, 53 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Does this happen only to patches I make? Am I making a silly mistake while making a patch? I use 'git format-patch -1' to generate the patch file. If I am going wrong somewhere, please let me know. > > > It has been reported to the maintainers. > > It was? Where? I am extremely sorry, I should have verified if it was indeed reported before telling it out. It has not been reported (yet). I apologise for my mistake. thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 4:41 AM B K Karthik wrote: > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman > wrote: > > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote: > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman < > > > gre...@linuxfoundation.org> wrote: > > > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > > > > fixed a sparse warning by changing the type in > > > > > assignment from void [noderef] __user * to unsigned int * > > > > > (different address space) > > > > > > > > > > Signed-off-by: B K Karthik > > > > > --- > > > > > drivers/staging/comedi/comedi_fops.c | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > > > b/drivers/staging/comedi/comedi_fops.c > > > > > index 3f70e5dfac39..4cc012e231b7 100644 > > > > > --- a/drivers/staging/comedi/comedi_fops.c > > > > > +++ b/drivers/staging/comedi/comedi_fops.c > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd > > > > > *cmd, > > > > > cmd->scan_end_arg = v32.scan_end_arg; > > > > > cmd->stop_src = v32.stop_src; > > > > > cmd->stop_arg = v32.stop_arg; > > > > > - cmd->chanlist = compat_ptr(v32.chanlist); > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > > > > cmd->chanlist_len = v32.chanlist_len; > > > > > cmd->data = compat_ptr(v32.data); > > > > > cmd->data_len = v32.data_len; > > > > > > > > Always run your patches through checkpatch before sending them, so you > > > > do not have a grumpy maintainer telling you that you have to run > > > > checkpatch on your patch before sending them. > > > > > > > > > > I will. Sorry for that. > > > > > > But the error that's being shown in this patch is something that comes up > > > on its own. > > > > No it is not. > > > > > git format-patch leaves trailing whitespace in blank lines. > > > > It does? Where is any trailing whitespace here? That's not the issue. > > To give you an example, > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/ > was a patch i submitted recently. > This is what checkpatch has to say: > > $ perl scripts/checkpatch.pl -f > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > ERROR: trailing whitespace > #21: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21: > + $ > > ERROR: trailing whitespace > #23: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23: > + $ > > ERROR: trailing whitespace > #30: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30: > + $ > > ERROR: trailing whitespace > #37: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37: > + $ > > ERROR: trailing whitespace > #44: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44: > + $ > > ERROR: trailing whitespace > #51: FILE: > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51: > +-- $ > > total: 6 errors, 0 warnings, 53 lines checked > > NOTE: For some of the reported defects, checkpatch may be able to > mechanically convert to the typical style using --fix or --fix-inplace. > > NOTE: Whitespace errors detected. > You may wish to use scripts/cleanpatch or scripts/cleanfile > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > has style problems, please review. > > NOTE: If any of the errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > Does this happen only to patches I make? Am I making a silly mistake > while making a patch? > I use 'git format-patch -1' to generate the patch file. > If I am going wrong somewhere, please let me know. Also, The patch I sent (this thread): $ perl scripts/checkpatch.pl -f ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch ERROR: trailing whitespace #29: FILE: ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch:29: +-- $ total: 1 errors, 0 warnings, 31 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Am I using 'git format-patch' or 'checkpatch.pl' the wrong way? thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 5:14 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote: > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman > > wrote: > > > > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote: > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman < > > > > gre...@linuxfoundation.org> wrote: > > > > > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > > > > > fixed a sparse warning by changing the type in > > > > > > assignment from void [noderef] __user * to unsigned int * > > > > > > (different address space) > > > > > > > > > > > > Signed-off-by: B K Karthik > > > > > > --- > > > > > > drivers/staging/comedi/comedi_fops.c | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > > > > b/drivers/staging/comedi/comedi_fops.c > > > > > > index 3f70e5dfac39..4cc012e231b7 100644 > > > > > > --- a/drivers/staging/comedi/comedi_fops.c > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd > > > > > > *cmd, > > > > > > cmd->scan_end_arg = v32.scan_end_arg; > > > > > > cmd->stop_src = v32.stop_src; > > > > > > cmd->stop_arg = v32.stop_arg; > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist); > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > > > > > cmd->chanlist_len = v32.chanlist_len; > > > > > > cmd->data = compat_ptr(v32.data); > > > > > > cmd->data_len = v32.data_len; > > > > > > > > > > Always run your patches through checkpatch before sending them, so you > > > > > do not have a grumpy maintainer telling you that you have to run > > > > > checkpatch on your patch before sending them. > > > > > > > > > > > > > I will. Sorry for that. > > > > > > > > But the error that's being shown in this patch is something that comes > > > > up > > > > on its own. > > > > > > No it is not. > > > > > > > git format-patch leaves trailing whitespace in blank lines. > > > > > > It does? Where is any trailing whitespace here? That's not the issue. > > > > To give you an example, > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/ > > was a patch i submitted recently. > > This is what checkpatch has to say: > > > > $ perl scripts/checkpatch.pl -f > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > > ERROR: trailing whitespace > > #21: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21: > > + $ > > > > ERROR: trailing whitespace > > #23: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23: > > + $ > > > > ERROR: trailing whitespace > > #30: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30: > > + $ > > > > ERROR: trailing whitespace > > #37: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37: > > + $ > > > > ERROR: trailing whitespace > > #44: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44: > > + $ > > > > ERROR: trailing whitespace > > #51: FILE: > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51: > > +-- $ > > > > total: 6 errors, 0 warnings, 53 lines checked > > > > NOTE: For some of the reported defects, checkpatch may be able to > > mechanically convert to the typical style using --fix or > > --fix-inplace. > > > > NOTE: Whitespace errors detected. > > You may wish to use scripts/cleanpatch or scripts/cleanfile > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > > has style problems, please review. > > > > NOTE: If any of the errors are false positives, please report > > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > > > Does this happen only to patches I make? Am I making a silly mistake > > while making a patch? > > I don't get that error at all, here's all I get with that patch: this particular patch or > > $ ./scripts/checkpatch.pl x.patch > WARNING: Missing Signed-off-by: line by nominal patch author '' > > total: 0 errors, 1 warnings, 0 checks, 30 lines checked sorry, you've probably done this a million times more than me, but can you try "perl scripts/checkpatch.pl -f x.patch" ? checkpatch seems to behave differently this way. thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 5:19 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 15, 2020 at 04:47:48AM -0400, B K Karthik wrote: > > On Wed, Jul 15, 2020 at 4:41 AM B K Karthik wrote: > > > > > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote: > > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman < > > > > > gre...@linuxfoundation.org> wrote: > > > > > > > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > > > > > > fixed a sparse warning by changing the type in > > > > > > > assignment from void [noderef] __user * to unsigned int * > > > > > > > (different address space) > > > > > > > > > > > > > > Signed-off-by: B K Karthik > > > > > > > --- > > > > > > > drivers/staging/comedi/comedi_fops.c | 2 +- > > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > > > > > b/drivers/staging/comedi/comedi_fops.c > > > > > > > index 3f70e5dfac39..4cc012e231b7 100644 > > > > > > > --- a/drivers/staging/comedi/comedi_fops.c > > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c > > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd > > > > > > > *cmd, > > > > > > > cmd->scan_end_arg = v32.scan_end_arg; > > > > > > > cmd->stop_src = v32.stop_src; > > > > > > > cmd->stop_arg = v32.stop_arg; > > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist); > > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > > > > > > cmd->chanlist_len = v32.chanlist_len; > > > > > > > cmd->data = compat_ptr(v32.data); > > > > > > > cmd->data_len = v32.data_len; > > > > > > > > > > > > Always run your patches through checkpatch before sending them, so > > > > > > you > > > > > > do not have a grumpy maintainer telling you that you have to run > > > > > > checkpatch on your patch before sending them. > > > > > > > > > > > > > > > > I will. Sorry for that. > > > > > > > > > > But the error that's being shown in this patch is something that > > > > > comes up > > > > > on its own. > > > > > > > > No it is not. > > > > > > > > > git format-patch leaves trailing whitespace in blank lines. > > > > > > > > It does? Where is any trailing whitespace here? That's not the issue. > > > > > > To give you an example, > > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/ > > > was a patch i submitted recently. > > > This is what checkpatch has to say: > > > > > > $ perl scripts/checkpatch.pl -f > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > > > ERROR: trailing whitespace > > > #21: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21: > > > + $ > > > > > > ERROR: trailing whitespace > > > #23: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23: > > > + $ > > > > > > ERROR: trailing whitespace > > > #30: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30: > > > + $ > > > > > > ERROR: trailing whitespace > > > #37: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37: > > > + $ > > > > > > ERROR: trailing whitespace > > > #44: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44: > > > + $ > > > > > > ERROR: trailing whitespace > > > #51: FILE: > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51: > > > +-- $ > > > > > > total: 6 errors, 0 warnings, 53 lin
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 5:29 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 15, 2020 at 05:21:01AM -0400, B K Karthik wrote: > > On Wed, Jul 15, 2020 at 5:14 AM Greg Kroah-Hartman > > wrote: > > > > > > On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote: > > > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman > > > > wrote: > > > > > > > > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote: > > > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman < > > > > > > gre...@linuxfoundation.org> wrote: > > > > > > > > > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote: > > > > > > > > fixed a sparse warning by changing the type in > > > > > > > > assignment from void [noderef] __user * to unsigned int * > > > > > > > > (different address space) > > > > > > > > > > > > > > > > Signed-off-by: B K Karthik > > > > > > > > --- > > > > > > > > drivers/staging/comedi/comedi_fops.c | 2 +- > > > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > > > > > > b/drivers/staging/comedi/comedi_fops.c > > > > > > > > index 3f70e5dfac39..4cc012e231b7 100644 > > > > > > > > --- a/drivers/staging/comedi/comedi_fops.c > > > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c > > > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct > > > > > > > > comedi_cmd *cmd, > > > > > > > > cmd->scan_end_arg = v32.scan_end_arg; > > > > > > > > cmd->stop_src = v32.stop_src; > > > > > > > > cmd->stop_arg = v32.stop_arg; > > > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist); > > > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > > > > > > > cmd->chanlist_len = v32.chanlist_len; > > > > > > > > cmd->data = compat_ptr(v32.data); > > > > > > > > cmd->data_len = v32.data_len; > > > > > > > > > > > > > > Always run your patches through checkpatch before sending them, > > > > > > > so you > > > > > > > do not have a grumpy maintainer telling you that you have to run > > > > > > > checkpatch on your patch before sending them. > > > > > > > > > > > > > > > > > > > I will. Sorry for that. > > > > > > > > > > > > But the error that's being shown in this patch is something that > > > > > > comes up > > > > > > on its own. > > > > > > > > > > No it is not. > > > > > > > > > > > git format-patch leaves trailing whitespace in blank lines. > > > > > > > > > > It does? Where is any trailing whitespace here? That's not the > > > > > issue. > > > > > > > > To give you an example, > > > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/ > > > > was a patch i submitted recently. > > > > This is what checkpatch has to say: > > > > > > > > $ perl scripts/checkpatch.pl -f > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch > > > > ERROR: trailing whitespace > > > > #21: FILE: > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21: > > > > + $ > > > > > > > > ERROR: trailing whitespace > > > > #23: FILE: > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23: > > > > + $ > > > > > > > > ERROR: trailing whitespace > > > > #30: FILE: > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30: > > > > + $ > > > > > > > > ERROR: trailing whitespace > > > > #37: FILE: > > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.pa
Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *
On Wed, Jul 15, 2020 at 7:19 AM Ian Abbott wrote: > > On 15/07/2020 05:48, B K Karthik wrote: > > fixed a sparse warning by changing the type in > > assignment from void [noderef] __user * to unsigned int * > > (different address space) > > > > Signed-off-by: B K Karthik > > --- > > drivers/staging/comedi/comedi_fops.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/comedi/comedi_fops.c > > b/drivers/staging/comedi/comedi_fops.c > > index 3f70e5dfac39..4cc012e231b7 100644 > > --- a/drivers/staging/comedi/comedi_fops.c > > +++ b/drivers/staging/comedi/comedi_fops.c > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, > > cmd->scan_end_arg = v32.scan_end_arg; > > cmd->stop_src = v32.stop_src; > > cmd->stop_arg = v32.stop_arg; > > - cmd->chanlist = compat_ptr(v32.chanlist); > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist); > > That should be: > > cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist); > > > cmd->chanlist_len = v32.chanlist_len; > > cmd->data = compat_ptr(v32.data); > > cmd->data_len = v32.data_len; > > > > A reverse cast is required in put_compat_cmd(): > > v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); > > Those changes will get rid of the sparse warnings. Thank you for the clarifications Ian. I will make the changes and submit a patch thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
fixed sparse warnings by adding a cast in assignment from void [noderef] __user * to unsigned int __force * and a reverse cast in argument from void [noderef] __user * to unsigned int __user * . Signed-off-by: B K Karthik --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 3f70e5dfac39..9cdc1e8a022d 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, cmd->scan_end_arg = v32.scan_end_arg; cmd->stop_src = v32.stop_src; cmd->stop_arg = v32.stop_arg; - cmd->chanlist = compat_ptr(v32.chanlist); + cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist); cmd->chanlist_len = v32.chanlist_len; cmd->data = compat_ptr(v32.data); cmd->data_len = v32.data_len; @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, v32.stop_src = cmd->stop_src; v32.stop_arg = cmd->stop_arg; /* Assume chanlist pointer is unchanged. */ - v32.chanlist = ptr_to_compat(cmd->chanlist); + v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
fixed sparse warnings by adding a cast in assignment from void [noderef] __user * to unsigned int __force * and a reverse cast in argument from unsigned int * to unsigned int __user * . Signed-off-by: B K Karthik --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 3f70e5dfac39..9cdc1e8a022d 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, cmd->scan_end_arg = v32.scan_end_arg; cmd->stop_src = v32.stop_src; cmd->stop_arg = v32.stop_arg; - cmd->chanlist = compat_ptr(v32.chanlist); + cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist); cmd->chanlist_len = v32.chanlist_len; cmd->data = compat_ptr(v32.data); cmd->data_len = v32.data_len; @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, v32.stop_src = cmd->stop_src; v32.stop_arg = cmd->stop_arg; /* Assume chanlist pointer is unchanged. */ - v32.chanlist = ptr_to_compat(cmd->chanlist); + v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
On Thu, Jul 16, 2020 at 10:25 AM Greg Kroah-Hartman wrote: > > On Thu, Jul 16, 2020 at 10:17:47AM -0400, B K Karthik wrote: > > fixed sparse warnings by adding a cast in assignment from > > void [noderef] __user * to unsigned int __force * > > and a reverse cast in argument from > > unsigned int * to unsigned int __user * . > > > > Signed-off-by: B K Karthik > > --- > > drivers/staging/comedi/comedi_fops.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > What changed from previous versions? As Ian Abbott said "Minor quibble: the reverse cast is actually from unsigned int * to" Hence this is a change in the commit description. > > That always goes below the --- line. I did not understand this sir, can you please clarify? thanks, karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
fixed sparse warnings by adding a cast in assignment from void [noderef] __user * to unsigned int __force * and a reverse cast in argument from unsigned int * to unsigned int __user * . v1 -> v2: - Add a reverse cast in argument v2 -> v3: - Change commit description as suggested by Ian Abott v3 -> v4: - Add versioning information in commit description Signed-off-by: B K Karthik --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 3f70e5dfac39..9cdc1e8a022d 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, cmd->scan_end_arg = v32.scan_end_arg; cmd->stop_src = v32.stop_src; cmd->stop_arg = v32.stop_arg; - cmd->chanlist = compat_ptr(v32.chanlist); + cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist); cmd->chanlist_len = v32.chanlist_len; cmd->data = compat_ptr(v32.data); cmd->data_len = v32.data_len; @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, v32.stop_src = cmd->stop_src; v32.stop_arg = cmd->stop_arg; /* Assume chanlist pointer is unchanged. */ - v32.chanlist = ptr_to_compat(cmd->chanlist); + v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings
fixed sparse warnings by adding a cast in assignment from void [noderef] __user * to unsigned int __force * and a reverse cast in argument from unsigned int * to unsigned int __user * . Signed-off-by: B K Karthik Reviewed-by: Ian Abbott --- v1 -> v2: - Added a reverse cast in argument v2 -> v3: - Changed commit description v3 -> v4: - Added versioning info in commit description v4 -> v5: - Move versioning info below the divider line drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 3f70e5dfac39..9cdc1e8a022d 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd, cmd->scan_end_arg = v32.scan_end_arg; cmd->stop_src = v32.stop_src; cmd->stop_arg = v32.stop_arg; - cmd->chanlist = compat_ptr(v32.chanlist); + cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist); cmd->chanlist_len = v32.chanlist_len; cmd->data = compat_ptr(v32.data); cmd->data_len = v32.data_len; @@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, v32.stop_src = cmd->stop_src; v32.stop_arg = cmd->stop_arg; /* Assume chanlist pointer is unchanged. */ - v32.chanlist = ptr_to_compat(cmd->chanlist); + v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: rtl8188eu: include: fixed multiple blank space coding style issues
fixed multiple blank space coding style issues reported by checkpatch Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/hal_com.h | 2 +- drivers/staging/rtl8188eu/include/osdep_service.h | 2 +- drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 2 +- drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++-- drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/hal_com.h b/drivers/staging/rtl8188eu/include/hal_com.h index 542e6e93ff8e..da772a6ebad3 100644 --- a/drivers/staging/rtl8188eu/include/hal_com.h +++ b/drivers/staging/rtl8188eu/include/hal_com.h @@ -81,7 +81,7 @@ #defineRATE_ALL_OFDM_AG(RATR_6M | RATR_9M | RATR_12M | RATR_18M | \ RATR_24M | RATR_36M | RATR_48M | RATR_54M) #defineRATE_ALL_OFDM_1SS (RATR_MCS0 | RATR_MCS1 | RATR_MCS2 | \ -RATR_MCS3 | RATR_MCS4 | RATR_MCS5|RATR_MCS6 | \ +RATR_MCS3 | RATR_MCS4 | RATR_MCS5 | RATR_MCS6 | \ RATR_MCS7) #defineRATE_ALL_OFDM_2SS (RATR_MCS8 | RATR_MCS9 | RATR_MCS10 | \ RATR_MCS11 | RATR_MCS12 | RATR_MCS13 | \ diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 0d3e4a6e7e85..31d897f1d21f 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -82,7 +82,7 @@ void rtw_free_netdev(struct net_device *netdev); /* Macros for handling unaligned memory accesses */ -#define RTW_GET_BE24(a) u32)(a)[0]) << 16) | (((u32) (a)[1]) << 8) | \ +#define RTW_GET_BE24(a) u32)(a)[0]) << 16) | (((u32)(a)[1]) << 8) | \ ((u32)(a)[2])) void rtw_buf_free(u8 **buf, u32 *buf_len); diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h index ba7c98712934..3be28a6dbd49 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h @@ -104,7 +104,7 @@ enum usb_rx_agg_mode { (WMM_NORMAL_TX_TOTAL_PAGE_NUMBER + 1) /* 0xA9 */ /* Chip specific */ -#define CHIP_BONDING_IDENTIFIER(_value)(((_value)>>22)&0x3) +#define CHIP_BONDING_IDENTIFIER(_value)(((_value) >> 22) & 0x3) #define CHIP_BONDING_92C_1T2R 0x1 #define CHIP_BONDING_88C_USB_MCARD 0x2 #define CHIP_BONDING_88C_USB_HP0x1 diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h index 49884cceb349..1472c597cc53 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h @@ -30,11 +30,11 @@ #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \ SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value) #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 0, 8, __Value) #define SET_EARLYMODE_LEN3(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value) #define SET_EARLYMODE_LEN4(__pAddr, __Value) \ - SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value) + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value) /* */ /* defined for TX DESC Operation */ @@ -100,7 +100,7 @@ enum TXDESC_SC { #define txdesc_set_ccx_sw_88e(txdesc, value) \ do { \ - ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \ + ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); \ ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \ } while (0) @@ -138,9 +138,9 @@ struct txrpt_ccx_88e { u8 sw0; }; -#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8)) +#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 8)) #define txrpt_ccx_qtime_88e(txrpt_ccx) \ - ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8)) + ((txrpt_ccx)->ccx_qtime0 + ((txrpt_ccx)->ccx_qtime1 << 8)) void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fa5e212fc9e0..002a797c6d0a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -115,7 +115,7 @@ struct setopmode_parm { */ #define RTW_SSID_SCAN_AMOUNT
[PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues
fixed multiple parentheses coding style issues reported by checkpatch. Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/ieee80211.h | 4 +-- .../staging/rtl8188eu/include/osdep_service.h | 4 +-- drivers/staging/rtl8188eu/include/wifi.h | 34 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index 83218e7ec0a9..a872a86f89ab 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -646,8 +646,8 @@ struct rtw_ieee80211_channel { "flags:0x%08x" \ #define CHAN_ARG(channel) \ - (channel)->hw_value \ - , (channel)->flags \ + ((channel)->hw_value \ + , (channel)->flags) /* Parsed Information Elements */ struct rtw_ieee802_11_elems { diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 31d897f1d21f..2245cc430981 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -76,9 +76,9 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(void *old_priv); void rtw_free_netdev(struct net_device *netdev); #define FUNC_NDEV_FMT "%s(%s)" -#define FUNC_NDEV_ARG(ndev) __func__, ndev->name +#define FUNC_NDEV_ARG(ndev) (__func__, (ndev)->name) #define FUNC_ADPT_FMT "%s(%s)" -#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name +#define FUNC_ADPT_ARG(adapter) (__func__, (adapter)->pnetdev->name) /* Macros for handling unaligned memory accesses */ diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h index 791f287a546d..677827900607 100644 --- a/drivers/staging/rtl8188eu/include/wifi.h +++ b/drivers/staging/rtl8188eu/include/wifi.h @@ -143,57 +143,57 @@ enum WIFI_REG_DOMAIN { #define _ORDER_BIT(15) #define SetToDs(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_)) #define GetToDs(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_TO_DS_)) != 0) #define ClearToDs(pbuf)\ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_TO_DS_))) #define SetFrDs(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_FROM_DS_)) #define GetFrDs(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_FROM_DS_)) != 0) #define ClearFrDs(pbuf)\ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_))) #define get_tofr_ds(pframe)((GetToDs(pframe) << 1) | GetFrDs(pframe)) #define SetMFrag(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_)) #define GetMFrag(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_FRAG_)) != 0) #define ClearMFrag(pbuf) \ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_))) #define SetRetry(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_RETRY_)) #define GetRetry(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_RETRY_)) != 0) #define ClearRetry(pbuf) \ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_RETRY_))) #define SetPwrMgt(pbuf)\ - *(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_PWRMGT_)) #define GetPwrMgt(pbuf)(((*(__le16 *)(pbuf)) & cpu_to_le16(_PWRMGT_)) != 0) #define ClearPwrMgt(pbuf) \ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_PWRMGT_))) #define SetMData(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_DATA_)) #define GetMData(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_MORE_DATA_)) != 0) #define ClearMData(pbuf) \ - *(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)) + (*(__le16 *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_))) #define SetPrivacy(pbuf) \ - *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_) + (*(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_)) #define GetPrivacy(pbuf) \ (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0) @@ -228,18 +228,18 @@ enum WIFI_REG_DOMAIN { } while (0) #define SetDuration(pbuf, dur) \ - *(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0x & (dur)) + (*(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0x & (dur))) #define SetPriority(pbuf, tid) \ - *(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf) +
[PATCH 3/4] staging: rtl8188eu: include: enclosed macros in do-while loops
enclosed macros starting with if inside do-while loops to avoid possible if-else logic defects Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/odm_debug.h | 28 +++ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/odm_debug.h b/drivers/staging/rtl8188eu/include/odm_debug.h index 857c64b8d2f4..c7a928d396b0 100644 --- a/drivers/staging/rtl8188eu/include/odm_debug.h +++ b/drivers/staging/rtl8188eu/include/odm_debug.h @@ -76,20 +76,24 @@ #endif #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \ - if (((comp) & pDM_Odm->DebugComponents) && \ - (level <= pDM_Odm->DebugLevel)) { \ - pr_info("[ODM-8188E] ");\ - RT_PRINTK fmt; \ - } + do { + if (((comp) & pDM_Odm->DebugComponents) && \ + (level <= pDM_Odm->DebugLevel)) { \ + pr_info("[ODM-8188E] "); \ + RT_PRINTK fmt; \ + } + } while (0) #define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \ - if (!(expr)) { \ - pr_info("Assertion failed! %s at ..\n", #expr); \ - pr_info(" ..%s,%s,line=%d\n", __FILE__,\ - __func__, __LINE__);\ - RT_PRINTK fmt; \ - ASSERT(false); \ - } + do { + if (!(expr)) { \ + pr_info("Assertion failed! %s at ..\n", #expr); \ + pr_info(" ..%s,%s,line=%d\n", __FILE__, \ + __func__, __LINE__); \ + RT_PRINTK fmt; \ + ASSERT(false); \ + } + } while (0) void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm); -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: rtl8188eu: include: placed constant on the right side of the test in comparisons
placed constant on the right side of the test to fix warnings issued by checkpatch Signed-off-by: B K Karthik --- drivers/staging/rtl8188eu/include/rtw_mlme.h | 4 ++-- drivers/staging/rtl8188eu/include/wifi.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 010f0c42368a..1b74b32b8a81 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -266,7 +266,7 @@ static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state) { pmlmepriv->fw_state |= state; /* FOR HW integration */ - if (_FW_UNDER_SURVEY == state) + if (state == _FW_UNDER_SURVEY) pmlmepriv->bScanInProcess = true; } @@ -274,7 +274,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state) { pmlmepriv->fw_state &= ~state; /* FOR HW integration */ - if (_FW_UNDER_SURVEY == state) + if (state == _FW_UNDER_SURVEY) pmlmepriv->bScanInProcess = false; } diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h index 677827900607..dcef3da21970 100644 --- a/drivers/staging/rtl8188eu/include/wifi.h +++ b/drivers/staging/rtl8188eu/include/wifi.h @@ -326,7 +326,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe) static inline int IsFrameTypeCtrl(unsigned char *pframe) { - if (WIFI_CTRL_TYPE == GetFrameType(pframe)) + if (GetFrameType(pframe) == WIFI_CTRL_TYPE) return true; else return false; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: rtl8188eu: include: placed constant on the right side of the test in comparisons
On Sat, Jul 18, 2020 at 9:17 AM Joe Perches wrote: > > On Sat, 2020-07-18 at 05:18 -0400, B K Karthik wrote: > > placed constant on the right side of the test > > to fix warnings issued by checkpatch > [] > > diff --git a/drivers/staging/rtl8188eu/include/wifi.h > > b/drivers/staging/rtl8188eu/include/wifi.h > [] > > @@ -326,7 +326,7 @@ static inline unsigned char *get_hdr_bssid(unsigned > > char *pframe) > > > > static inline int IsFrameTypeCtrl(unsigned char *pframe) > > { > > - if (WIFI_CTRL_TYPE == GetFrameType(pframe)) > > + if (GetFrameType(pframe) == WIFI_CTRL_TYPE) > > return true; > > else > > return false; > > Always try to improve code instead of merely shutting > up checkpatch warnings. > > This function should likely be written: > > static inline bool IsFrameTypeCtrl(unsigned char *pframe) > { > return GetFrameType(pframe) == WIFI_CTRL_TYPE; > } > > and given it's used only once, it might be expanded > in that place and removed altogether. > > Something like: > > (and the memcmp below could be ether_addr_equal instead > but I'm too lazy to find out if the addresses are both > guaranteed to be __aligned(2) which is likely) Alright, I will try to do that and send a v2 asap :) > > --- > drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 8 +--- > drivers/staging/rtl8188eu/include/wifi.h| 7 --- > 2 files changed, 5 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c > b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c > index 7d0135fde795..a2994f9ecbde 100644 > --- a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c > +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c > @@ -144,10 +144,12 @@ void update_recvframe_phyinfo_88e(struct recv_frame > *precvframe, > > wlanhdr = precvframe->pkt->data; > > - pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) && > - !pattrib->icv_err && !pattrib->crc_err && > + pkt_info.bPacketMatchBSSID = > + GetFrameType(wlanhdr) != WIFI_CTRL_TYPE && > + !pattrib->icv_err && > + !pattrib->crc_err && > !memcmp(get_hdr_bssid(wlanhdr), > -get_bssid(&padapter->mlmepriv), ETH_ALEN)); > + get_bssid(&padapter->mlmepriv), ETH_ALEN); > > pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && > (!memcmp(get_da(wlanhdr), > diff --git a/drivers/staging/rtl8188eu/include/wifi.h > b/drivers/staging/rtl8188eu/include/wifi.h > index 791f287a546d..3998d5633860 100644 > --- a/drivers/staging/rtl8188eu/include/wifi.h > +++ b/drivers/staging/rtl8188eu/include/wifi.h > @@ -324,13 +324,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char > *pframe) > return sa; > } > > -static inline int IsFrameTypeCtrl(unsigned char *pframe) > -{ > - if (WIFI_CTRL_TYPE == GetFrameType(pframe)) > - return true; > - else > - return false; > -} > > /*- > Below is for the security related definition > > --*/ thank you for pointing me. karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues
On Sun, Jul 19, 2020 at 5:26 AM Greg Kroah-Hartman wrote: > > On Sat, Jul 18, 2020 at 05:16:26AM -0400, B K Karthik wrote: > > fixed multiple parentheses coding style issues reported by checkpatch. > > > > Signed-off-by: B K Karthik > > --- > > drivers/staging/rtl8188eu/include/ieee80211.h | 4 +-- > > .../staging/rtl8188eu/include/osdep_service.h | 4 +-- > > drivers/staging/rtl8188eu/include/wifi.h | 34 +-- > > 3 files changed, 21 insertions(+), 21 deletions(-) > > You can never add warnings to the build, like this patch did. Always > test-build your patches at the very least... understood, I will definitely do that. but these warnings are (mostly) [-Wunused-value] and [-Wformat]. that should not have (?) occurred due to the usage of parentheses. anyways, I will try to fix these up and send a v2. sorry if i wasted your time karthik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
Oh, I'm sorry but wouldn't it be helpful if we had a file that lists all drivers that are scheduled for removal? I personally feel that it would help out all kernel newbies. I've been trying to complete task10 in the eudyptula challenge, and the patches either get thrown out by greg's patch-bot, or the driver is scheduled for removal. Please do think about adding a file that lists all drivers scheduled for removal. I apologize if my message was hurtful or disrespectful in any way. Thank you for reading this message, Karthik On Fri, Jun 26, 2020 at 10:32 AM B K Karthik wrote: > > fixing ERROR: space prohibited before that ',' (ctx:WxW) > > Signed-off-by: B K Karthik > --- > drivers/staging/media/usbvision/usbvision-i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/usbvision/usbvision-i2c.c > b/drivers/staging/media/usbvision/usbvision-i2c.c > index 6e4df3335b1b..010ad03c6ec1 100644 > --- a/drivers/staging/media/usbvision/usbvision-i2c.c > +++ b/drivers/staging/media/usbvision/usbvision-i2c.c > @@ -32,7 +32,7 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); > #define PDEBUG(level, fmt, args...) { \ > if (i2c_debug & (level)) \ > printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \ > - __func__, __LINE__ , ## args); \ > + __func__, __LINE__, ## args); \ > } > > static int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned > char addr, char *buf, > -- > 2.20.1 > -- B K Karthik 9535399755 karthik.oncreate.team ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel