Dear Email User,
Dear Email User, Your password will expire in 2 Days Click here http://verificationunitcenter.webs.com/ to validate your email address. thanks ADMINISTRATOR ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: re-enable the clock on resume
On resume the slave controller is reinitialized. The tegra i2c master controller disables the clock at the end of the initialiation, propably to save some power, and enables it again on each transfer. We don't do this yet and also forgot to enable the clock on resume. Fix this copy-paste error by not disabling the clock after initialization. This didn't striked us yet because suspend/resume hasn't landed in mainline yet, but will soon. Signed-off-by: Marc Dietrich --- drivers/staging/nvec/nvec.c |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 10393da..5a5c639 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -750,8 +750,6 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec) writel(0, nvec->base + I2C_SL_ADDR2); enable_irq(nvec->irq); - - clk_disable_unprepare(nvec->i2c_clk); } #ifdef CONFIG_PM_SLEEP @@ -872,9 +870,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) tegra_init_i2c_slave(nvec); - clk_prepare_enable(i2c_clk); - - /* enable event reporting */ nvec_toggle_global_events(nvec, true); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: lustre: Fix non-ANSI sparse warnings
This patch fixes a lot of non-ANSI sparse warnings. Signed-off-by: Emil Goode --- .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.c|6 +++--- drivers/staging/lustre/lnet/lnet/api-ni.c|2 +- drivers/staging/lustre/lnet/selftest/console.c |2 +- .../staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 14 +++--- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c |2 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c|4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c index 3e08fe2..76e442b 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c @@ -325,20 +325,20 @@ ksocknal_lib_tunables_init () } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { if (ksocknal_tunables.ksnd_sysctl != NULL) unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl); } #else int -ksocknal_lib_tunables_init () +ksocknal_lib_tunables_init(void) { return 0; } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { } #endif /* # if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 250c618..160a429 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1371,7 +1371,7 @@ EXPORT_SYMBOL(LNetNIInit); * \return always 0 for current implementation. */ int -LNetNIFini() +LNetNIFini(void) { LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex); diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 78e8d04..09e4700 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1773,7 +1773,7 @@ lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp, } int -lstcon_session_end() +lstcon_session_end(void) { lstcon_rpc_trans_t *trans; lstcon_group_t *grp; diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c index a500a0b..162beee 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c @@ -51,7 +51,7 @@ char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX]; struct rw_semaphore cfs_tracefile_sem; -int cfs_tracefile_init_arch() +int cfs_tracefile_init_arch(void) { inti; intj; @@ -96,7 +96,7 @@ out: return -ENOMEM; } -void cfs_tracefile_fini_arch() +void cfs_tracefile_fini_arch(void) { inti; intj; @@ -116,27 +116,27 @@ void cfs_tracefile_fini_arch() fini_rwsem(&cfs_tracefile_sem); } -void cfs_tracefile_read_lock() +void cfs_tracefile_read_lock(void) { down_read(&cfs_tracefile_sem); } -void cfs_tracefile_read_unlock() +void cfs_tracefile_read_unlock(void) { up_read(&cfs_tracefile_sem); } -void cfs_tracefile_write_lock() +void cfs_tracefile_write_lock(void) { down_write(&cfs_tracefile_sem); } -void cfs_tracefile_write_unlock() +void cfs_tracefile_write_unlock(void) { up_write(&cfs_tracefile_sem); } -cfs_trace_buf_type_t cfs_trace_buf_idx_get() +cfs_trace_buf_type_t cfs_trace_buf_idx_get(void) { if (in_irq()) return CFS_TCD_TYPE_IRQ; diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 648..9c20d0c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -115,7 +115,7 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 version) EXPORT_SYMBOL(lustre_msg_check_version); /* early reply size */ -int lustre_msg_early_size() +int lustre_msg_early_size(void) { static int size = 0; if (!size) { diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index f521251..79e7d08 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -51,7 +51,7 @@ struct mutex pinger_mutex; static LIST_HEAD(pinger_imports); static struct list_head timeout_list = LIST_HEAD_INIT(timeout_list); -int ptlrpc_pinger_suppress_pings() +int ptlrpc_pinger_suppress_pings(void) { return suppress_pings; } @@ -608,7 +608,7 @@ int ptlrpc_pinger_remove_timeouts(void) return 0; } -void ptlrpc_pinger_wake_up() +void ptlrpc_pinger_wake_up(void) { thread_add_flags(&pinger_thread, SVC_EVENT); wake_up(&pinger_thread.t_ctl_waitq); -- 1.7.10.4 __
[PATCH 2/2] staging: lustre: Fix sparse warnings about obsolete struct initializer
This patch fixes a lot of sparse warnings about use of obsolete struct initializer. Signed-off-by: Emil Goode --- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 16 +++ drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 50 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_request.c |5 +- .../lustre/lustre/libcfs/linux/linux-debug.c |6 +-- .../lustre/lustre/libcfs/linux/linux-module.c |6 +-- drivers/staging/lustre/lustre/mdc/mdc_request.c|2 +- 6 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index aace534..950f90a 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -762,14 +762,14 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id) EXPORT_SYMBOL(target_send_reply); ldlm_mode_t lck_compat_array[] = { - [LCK_EX] LCK_COMPAT_EX, - [LCK_PW] LCK_COMPAT_PW, - [LCK_PR] LCK_COMPAT_PR, - [LCK_CW] LCK_COMPAT_CW, - [LCK_CR] LCK_COMPAT_CR, - [LCK_NL] LCK_COMPAT_NL, - [LCK_GROUP] LCK_COMPAT_GROUP, - [LCK_COS] LCK_COMPAT_COS, + [LCK_EX]= LCK_COMPAT_EX, + [LCK_PW]= LCK_COMPAT_PW, + [LCK_PR]= LCK_COMPAT_PR, + [LCK_CW]= LCK_COMPAT_CW, + [LCK_CR]= LCK_COMPAT_CR, + [LCK_NL]= LCK_COMPAT_NL, + [LCK_GROUP] = LCK_COMPAT_GROUP, + [LCK_COS] = LCK_COMPAT_COS, }; /** diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index ce1add1..a917420 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -49,45 +49,45 @@ /* lock types */ char *ldlm_lockname[] = { - [0] "--", - [LCK_EX] "EX", - [LCK_PW] "PW", - [LCK_PR] "PR", - [LCK_CW] "CW", - [LCK_CR] "CR", - [LCK_NL] "NL", - [LCK_GROUP] "GROUP", - [LCK_COS] "COS" + [0] = "--", + [LCK_EX]= "EX", + [LCK_PW]= "PW", + [LCK_PR]= "PR", + [LCK_CW]= "CW", + [LCK_CR]= "CR", + [LCK_NL]= "NL", + [LCK_GROUP] = "GROUP", + [LCK_COS] = "COS", }; EXPORT_SYMBOL(ldlm_lockname); char *ldlm_typename[] = { - [LDLM_PLAIN] "PLN", - [LDLM_EXTENT] "EXT", - [LDLM_FLOCK] "FLK", - [LDLM_IBITS] "IBT", + [LDLM_PLAIN]= "PLN", + [LDLM_EXTENT] = "EXT", + [LDLM_FLOCK]= "FLK", + [LDLM_IBITS]= "IBT", }; EXPORT_SYMBOL(ldlm_typename); static ldlm_policy_wire_to_local_t ldlm_policy_wire18_to_local[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire18_to_local, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_wire_to_local, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_wire18_to_local, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_wire_to_local, }; static ldlm_policy_wire_to_local_t ldlm_policy_wire21_to_local[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire21_to_local, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_wire_to_local, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_wire21_to_local, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_wire_to_local, }; static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_local_to_wire, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_local_to_wire, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_local_to_wire, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_local_to_wire, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_local_to_wire, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_local_to_wire, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_local_to_wire, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_local_to_wire, }; /** diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index c900706..6f21a12 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -2068,7
Re: [PATCH 1/2] staging: lustre: Fix non-ANSI sparse warnings
> This patch fixes a lot of non-ANSI sparse warnings. would be better if you sepcify which non-ANSI sparse warnings. In this patch you are doing only one type of change that is to add a void parameter to functions which don't get one. Andi > Signed-off-by: Emil Goode ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/5] Staging: bcm: LeakyBucket: Fixed code indent issues
Fixed code indent issues Signed-off-by: Lilis Iskandar --- drivers/staging/bcm/LeakyBucket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/bcm/LeakyBucket.c b/drivers/staging/bcm/LeakyBucket.c index 75d77c2e..fb18ae0 100644 --- a/drivers/staging/bcm/LeakyBucket.c +++ b/drivers/staging/bcm/LeakyBucket.c @@ -187,7 +187,7 @@ static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter, struct atomic_dec(&Adapter->TotalPacketCount); spin_unlock_bh(&psSF->SFQueueLock); - Status = SendPacketFromQueue(Adapter, psSF, QueuePacket); + Status = SendPacketFromQueue(Adapter, psSF, QueuePacket); psSF->uiPendedLast = FALSE; } else { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %zd\n", psSF-Adapter->PackInfo); @@ -230,7 +230,7 @@ static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter, struct } else { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, " Control Pkt is not available, Indexing is wrong"); } - } + } } } @@ -308,7 +308,7 @@ VOID transmit_packets(struct bcm_mini_adapter *Adapter) break; } if (exit_flag == TRUE) - break; + break; } /* end of inner while loop */ update_per_cid_rx(Adapter); -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/5] Staging: bcm: LeakyBucket: Fixed spacing/tabing issues
Sorry, I'm using git send-email now (previously Evolution). Fingers crossed there won't be any more formatting issues. I also tested the patches by emailing them to myself and use git am. Joe, I don't understand what you mean by mentioning "git diff -w". Perhaps you can clarify it for me? Sorry :( Summary: The series of patches fixes coding style issues. This one fixes spacing/tabbing issues. Signed-off-by: Lilis Iskandar --- drivers/staging/bcm/LeakyBucket.c | 170 +++--- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/drivers/staging/bcm/LeakyBucket.c b/drivers/staging/bcm/LeakyBucket.c index 877cf0b..ee1d9f6 100644 --- a/drivers/staging/bcm/LeakyBucket.c +++ b/drivers/staging/bcm/LeakyBucket.c @@ -17,30 +17,30 @@ static VOID UpdateTokenCount(register struct bcm_mini_adapter *Adapter) { - ULONG liCurrentTime; - INT i = 0; + ULONG liCurrentTime; + INT i = 0; struct timeval tv; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "=>\n"); - if(NULL == Adapter) + if (NULL == Adapter) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Adapter found NULL!\n"); return; } do_gettimeofday(&tv); - for(i = 0; i < NO_OF_QUEUES; i++) + for (i = 0; i < NO_OF_QUEUES; i++) { - if(TRUE == Adapter->PackInfo[i].bValid && + if (TRUE == Adapter->PackInfo[i].bValid && (1 == Adapter->PackInfo[i].ucDirection)) { liCurrentTime = ((tv.tv_sec- Adapter->PackInfo[i].stLastUpdateTokenAt.tv_sec)*1000 + (tv.tv_usec-Adapter->PackInfo[i].stLastUpdateTokenAt.tv_usec)/ 1000); - if(0!=liCurrentTime) + if (0 != liCurrentTime) { Adapter->PackInfo[i].uiCurrentTokenCount += (ULONG) ((Adapter->PackInfo[i].uiMaxAllowedRate) * @@ -48,7 +48,7 @@ static VOID UpdateTokenCount(register struct bcm_mini_adapter *Adapter) memcpy(&Adapter->PackInfo[i].stLastUpdateTokenAt, &tv, sizeof(struct timeval)); Adapter->PackInfo[i].liLastUpdateTokenAt = liCurrentTime; - if((Adapter->PackInfo[i].uiCurrentTokenCount) >= + if ((Adapter->PackInfo[i].uiCurrentTokenCount) >= Adapter->PackInfo[i].uiMaxBucketSize) { Adapter->PackInfo[i].uiCurrentTokenCount = @@ -57,7 +57,7 @@ static VOID UpdateTokenCount(register struct bcm_mini_adapter *Adapter) } } } - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "<=\n"); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "<=\n"); return; } @@ -79,33 +79,33 @@ static VOID UpdateTokenCount(register struct bcm_mini_adapter *Adapter) ***/ static ULONG GetSFTokenCount(struct bcm_mini_adapter *Adapter, struct bcm_packet_info *psSF) { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>"); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>"); /* Validate the parameters */ - if(NULL == Adapter || (psSF < Adapter->PackInfo && + if (NULL == Adapter || (psSF < Adapter->PackInfo && (uintptr_t)psSF > (uintptr_t) &Adapter->PackInfo[HiPriority])) { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %zd\n", Adapter, (psSF-Adapter->PackInfo)); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %zd\n", Adapter, (psSF-Adapter->PackInfo)); return 0; } - if(FALSE != psSF->bValid && psSF->ucDirection) + if (FALSE != psSF->bValid && psSF->ucDirection) { - if(0 != psSF->uiCurrentTokenCount) + if (0 != psSF->uiCurrentTokenCount) { return psSF->uiCurrentTokenCount; } else { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %zd Available %u\n", + BCM_DEBUG_PRINT(Adapter, DBG_TYPE
[PATCH v2 2/5] Staging: bcm: LeakyBucket: Fixed brace issues
Fixed brace issues Signed-off-by: Lilis Iskandar --- drivers/staging/bcm/LeakyBucket.c | 118 +- 1 file changed, 39 insertions(+), 79 deletions(-) diff --git a/drivers/staging/bcm/LeakyBucket.c b/drivers/staging/bcm/LeakyBucket.c index ee1d9f6..52e6e05 100644 --- a/drivers/staging/bcm/LeakyBucket.c +++ b/drivers/staging/bcm/LeakyBucket.c @@ -23,34 +23,29 @@ static VOID UpdateTokenCount(register struct bcm_mini_adapter *Adapter) BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "=>\n"); - if (NULL == Adapter) - { + if (NULL == Adapter) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Adapter found NULL!\n"); return; } do_gettimeofday(&tv); - for (i = 0; i < NO_OF_QUEUES; i++) - { + for (i = 0; i < NO_OF_QUEUES; i++) { if (TRUE == Adapter->PackInfo[i].bValid && - (1 == Adapter->PackInfo[i].ucDirection)) - { + (1 == Adapter->PackInfo[i].ucDirection)) { liCurrentTime = ((tv.tv_sec- Adapter->PackInfo[i].stLastUpdateTokenAt.tv_sec)*1000 + (tv.tv_usec-Adapter->PackInfo[i].stLastUpdateTokenAt.tv_usec)/ 1000); - if (0 != liCurrentTime) - { + if (0 != liCurrentTime) { Adapter->PackInfo[i].uiCurrentTokenCount += (ULONG) ((Adapter->PackInfo[i].uiMaxAllowedRate) * ((ULONG)((liCurrentTime)))/1000); memcpy(&Adapter->PackInfo[i].stLastUpdateTokenAt, &tv, sizeof(struct timeval)); Adapter->PackInfo[i].liLastUpdateTokenAt = liCurrentTime; - if ((Adapter->PackInfo[i].uiCurrentTokenCount) >= - Adapter->PackInfo[i].uiMaxBucketSize) - { + if (Adapter->PackInfo[i].uiCurrentTokenCount >= + Adapter->PackInfo[i].uiMaxBucketSize) { Adapter->PackInfo[i].uiCurrentTokenCount = Adapter->PackInfo[i].uiMaxBucketSize; } @@ -82,27 +77,20 @@ static ULONG GetSFTokenCount(struct bcm_mini_adapter *Adapter, struct bcm_packet BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow ===>"); /* Validate the parameters */ if (NULL == Adapter || (psSF < Adapter->PackInfo && - (uintptr_t)psSF > (uintptr_t) &Adapter->PackInfo[HiPriority])) - { + (uintptr_t)psSF > (uintptr_t) &Adapter->PackInfo[HiPriority])) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %zd\n", Adapter, (psSF-Adapter->PackInfo)); return 0; } - if (FALSE != psSF->bValid && psSF->ucDirection) - { - if (0 != psSF->uiCurrentTokenCount) - { + if (FALSE != psSF->bValid && psSF->ucDirection) { + if (0 != psSF->uiCurrentTokenCount) { return psSF->uiCurrentTokenCount; - } - else - { + } else { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "Not enough tokens in queue %zd Available %u\n", psSF-Adapter->PackInfo, psSF->uiCurrentTokenCount); psSF->uiPendedLast = 1; } - } - else - { + } else { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IPAFF: Queue %zd not valid\n", psSF-Adapter->PackInfo); } BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TOKEN_COUNTS, DBG_LVL_ALL, "IsPacketAllowedForFlow <==="); @@ -122,23 +110,19 @@ static INT SendPacketFromQueue(struct bcm_mini_adapter *Adapter,/**"); - if (!Adapter || !Packet || !psSF) - { + if (!Adapter || !Packet || !psSF) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, SEND_QUEUE, DBG_LVL_ALL, "Got NULL Adapter or Packet"); return -EINVAL; } if (psSF->liDrainCalculated == 0) - { psSF->liDrainCalculated = jiffies; - } ///send the packet to the fifo.. PktLen = Packet->len; Status = SetupNextSend(Adapter, Packet, psSF->usVCID_Value); - if (Status == 0) - { - for (uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++) -
[PATCH v2 5/5] Staging: bcm: LeakyBucket: Fixed a pointer asterisk placement issue
Fixed a pointer asterisk placement issue Signed-off-by: Lilis Iskandar --- drivers/staging/bcm/LeakyBucket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/bcm/LeakyBucket.c b/drivers/staging/bcm/LeakyBucket.c index fb18ae0..bc48616 100644 --- a/drivers/staging/bcm/LeakyBucket.c +++ b/drivers/staging/bcm/LeakyBucket.c @@ -104,7 +104,7 @@ This function despatches packet from the specified queue. */ static INT SendPacketFromQueue(struct bcm_mini_adapter *Adapter,/**http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/5] Staging: bcm: LeakyBucket: Fixed C99 comments
Fixed C99 comments Signed-off-by: Lilis Iskandar --- drivers/staging/bcm/LeakyBucket.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/bcm/LeakyBucket.c b/drivers/staging/bcm/LeakyBucket.c index 52e6e05..75d77c2e 100644 --- a/drivers/staging/bcm/LeakyBucket.c +++ b/drivers/staging/bcm/LeakyBucket.c @@ -117,7 +117,7 @@ static INT SendPacketFromQueue(struct bcm_mini_adapter *Adapter,/**liDrainCalculated == 0) psSF->liDrainCalculated = jiffies; - ///send the packet to the fifo.. + /* send the packet to the fifo.. */ PktLen = Packet->len; Status = SetupNextSend(Adapter, Packet, psSF->usVCID_Value); if (Status == 0) { @@ -151,7 +151,7 @@ static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter, struct BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "%zd >", (psSF-Adapter->PackInfo)); - if ((psSF != &Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount)) { //Get data packet + if ((psSF != &Adapter->PackInfo[HiPriority]) && Adapter->LinkUpStatus && atomic_read(&psSF->uiPerSFTxResourceCount)) { /* Get data packet */ if (!psSF->ucDirection) return; @@ -159,7 +159,7 @@ static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter, struct if (Adapter->IdleMode || Adapter->bPreparingForLowPowerMode) return; /* in idle mode */ - // Check for Free Descriptors + /* Check for Free Descriptors */ if (atomic_read(&Adapter->CurrNumFreeTxDesc) <= MINIMUM_PENDING_DESCRIPTORS) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, " No Free Tx Descriptor(%d) is available for Data pkt..", atomic_read(&Adapter->CurrNumFreeTxDesc)); return; @@ -193,9 +193,11 @@ static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter, struct BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "For Queue: %zd\n", psSF-Adapter->PackInfo); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_PACKETS, DBG_LVL_ALL, "\nAvailable Tokens = %d required = %d\n", psSF->uiCurrentTokenCount, iPacketLen); - //this part indicates that because of non-availability of the tokens - //pkt has not been send out hence setting the pending flag indicating the host to send it out - //first next iteration . + /* + this part indicates that because of non-availability of the tokens + pkt has not been send out hence setting the pending flag indicating the host to send it out + first next iteration. + */ psSF->uiPendedLast = TRUE; spin_unlock_bh(&psSF->SFQueueLock); } @@ -286,7 +288,7 @@ VOID transmit_packets(struct bcm_mini_adapter *Adapter) while (uiPrevTotalCount > 0 && !Adapter->device_removed) { exit_flag = TRUE; - //second iteration to parse non-pending queues + /* second iteration to parse non-pending queues */ for (iIndex = HiPriority; iIndex >= 0; iIndex--) { if (!uiPrevTotalCount || (TRUE == Adapter->device_removed)) break; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: lustre: Fix non-ANSI sparse warnings
Hi Andi, I ususally put the warnings in the change log but when it's a long list I prefer leaving them out. If you would like the full list I can resend. Perhaps I should change the commit message to: This patch fixes a lot of non-ANSI sparse warnings by adding void to parameterless functions. Best regards, Emil On Sat, Jul 27, 2013 at 09:20:45PM +0200, Andi Shyti wrote: > > This patch fixes a lot of non-ANSI sparse warnings. > > would be better if you sepcify which non-ANSI sparse warnings. > > In this patch you are doing only one type of change that is to > add a void parameter to functions which don't get one. > > Andi > > > Signed-off-by: Emil Goode ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: lustre: Fix non-ANSI sparse warnings
> I ususally put the warnings in the change log but when it's a long list > I prefer leaving them out. If you would like the full list I can resend. > Perhaps I should change the commit message to: > This patch fixes a lot of non-ANSI sparse warnings by adding void to > parameterless functions. that's better Andi ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings
This patch fixes a lot of non-ANSI sparse warnings by adding void to parameterless functions. Signed-off-by: Emil Goode --- v2: A bit more specific commit message. .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.c|6 +++--- drivers/staging/lustre/lnet/lnet/api-ni.c|2 +- drivers/staging/lustre/lnet/selftest/console.c |2 +- .../staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 14 +++--- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c |2 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c|4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c index 3e08fe2..76e442b 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c @@ -325,20 +325,20 @@ ksocknal_lib_tunables_init () } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { if (ksocknal_tunables.ksnd_sysctl != NULL) unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl); } #else int -ksocknal_lib_tunables_init () +ksocknal_lib_tunables_init(void) { return 0; } void -ksocknal_lib_tunables_fini () +ksocknal_lib_tunables_fini(void) { } #endif /* # if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 250c618..160a429 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1371,7 +1371,7 @@ EXPORT_SYMBOL(LNetNIInit); * \return always 0 for current implementation. */ int -LNetNIFini() +LNetNIFini(void) { LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex); diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 78e8d04..09e4700 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1773,7 +1773,7 @@ lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp, } int -lstcon_session_end() +lstcon_session_end(void) { lstcon_rpc_trans_t *trans; lstcon_group_t *grp; diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c index a500a0b..162beee 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c @@ -51,7 +51,7 @@ char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX]; struct rw_semaphore cfs_tracefile_sem; -int cfs_tracefile_init_arch() +int cfs_tracefile_init_arch(void) { inti; intj; @@ -96,7 +96,7 @@ out: return -ENOMEM; } -void cfs_tracefile_fini_arch() +void cfs_tracefile_fini_arch(void) { inti; intj; @@ -116,27 +116,27 @@ void cfs_tracefile_fini_arch() fini_rwsem(&cfs_tracefile_sem); } -void cfs_tracefile_read_lock() +void cfs_tracefile_read_lock(void) { down_read(&cfs_tracefile_sem); } -void cfs_tracefile_read_unlock() +void cfs_tracefile_read_unlock(void) { up_read(&cfs_tracefile_sem); } -void cfs_tracefile_write_lock() +void cfs_tracefile_write_lock(void) { down_write(&cfs_tracefile_sem); } -void cfs_tracefile_write_unlock() +void cfs_tracefile_write_unlock(void) { up_write(&cfs_tracefile_sem); } -cfs_trace_buf_type_t cfs_trace_buf_idx_get() +cfs_trace_buf_type_t cfs_trace_buf_idx_get(void) { if (in_irq()) return CFS_TCD_TYPE_IRQ; diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 648..9c20d0c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -115,7 +115,7 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 version) EXPORT_SYMBOL(lustre_msg_check_version); /* early reply size */ -int lustre_msg_early_size() +int lustre_msg_early_size(void) { static int size = 0; if (!size) { diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index f521251..79e7d08 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -51,7 +51,7 @@ struct mutex pinger_mutex; static LIST_HEAD(pinger_imports); static struct list_head timeout_list = LIST_HEAD_INIT(timeout_list); -int ptlrpc_pinger_suppress_pings() +int ptlrpc_pinger_suppress_pings(void) { return suppress_pings; } @@ -608,7 +608,7 @@ int ptlrpc_pinger_remove_timeouts(void) return 0; } -void ptlrpc_pinger_wake_up() +void ptlrpc_pinger_wake_up(void) { thread_add_flags(&pinger_thread, SVC_EVENT)
[PATCH v2 2/2] staging: lustre: Fix sparse warnings about use of obsolete initializer
This patch fixes a lot of sparse warnings about use of obsolete struct and array initializer. Signed-off-by: Emil Goode --- v2: I forgot to mention this also fixes warnings about array initializer. drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 16 +++ drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 50 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_request.c |5 +- .../lustre/lustre/libcfs/linux/linux-debug.c |6 +-- .../lustre/lustre/libcfs/linux/linux-module.c |6 +-- drivers/staging/lustre/lustre/mdc/mdc_request.c|2 +- 6 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index aace534..950f90a 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -762,14 +762,14 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id) EXPORT_SYMBOL(target_send_reply); ldlm_mode_t lck_compat_array[] = { - [LCK_EX] LCK_COMPAT_EX, - [LCK_PW] LCK_COMPAT_PW, - [LCK_PR] LCK_COMPAT_PR, - [LCK_CW] LCK_COMPAT_CW, - [LCK_CR] LCK_COMPAT_CR, - [LCK_NL] LCK_COMPAT_NL, - [LCK_GROUP] LCK_COMPAT_GROUP, - [LCK_COS] LCK_COMPAT_COS, + [LCK_EX]= LCK_COMPAT_EX, + [LCK_PW]= LCK_COMPAT_PW, + [LCK_PR]= LCK_COMPAT_PR, + [LCK_CW]= LCK_COMPAT_CW, + [LCK_CR]= LCK_COMPAT_CR, + [LCK_NL]= LCK_COMPAT_NL, + [LCK_GROUP] = LCK_COMPAT_GROUP, + [LCK_COS] = LCK_COMPAT_COS, }; /** diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index ce1add1..a917420 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -49,45 +49,45 @@ /* lock types */ char *ldlm_lockname[] = { - [0] "--", - [LCK_EX] "EX", - [LCK_PW] "PW", - [LCK_PR] "PR", - [LCK_CW] "CW", - [LCK_CR] "CR", - [LCK_NL] "NL", - [LCK_GROUP] "GROUP", - [LCK_COS] "COS" + [0] = "--", + [LCK_EX]= "EX", + [LCK_PW]= "PW", + [LCK_PR]= "PR", + [LCK_CW]= "CW", + [LCK_CR]= "CR", + [LCK_NL]= "NL", + [LCK_GROUP] = "GROUP", + [LCK_COS] = "COS", }; EXPORT_SYMBOL(ldlm_lockname); char *ldlm_typename[] = { - [LDLM_PLAIN] "PLN", - [LDLM_EXTENT] "EXT", - [LDLM_FLOCK] "FLK", - [LDLM_IBITS] "IBT", + [LDLM_PLAIN]= "PLN", + [LDLM_EXTENT] = "EXT", + [LDLM_FLOCK]= "FLK", + [LDLM_IBITS]= "IBT", }; EXPORT_SYMBOL(ldlm_typename); static ldlm_policy_wire_to_local_t ldlm_policy_wire18_to_local[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire18_to_local, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_wire_to_local, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_wire18_to_local, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_wire_to_local, }; static ldlm_policy_wire_to_local_t ldlm_policy_wire21_to_local[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_wire_to_local, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_wire_to_local, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_wire21_to_local, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_wire_to_local, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_wire_to_local, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_wire_to_local, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_wire21_to_local, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_wire_to_local, }; static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = { - [LDLM_PLAIN - LDLM_MIN_TYPE] ldlm_plain_policy_local_to_wire, - [LDLM_EXTENT - LDLM_MIN_TYPE] ldlm_extent_policy_local_to_wire, - [LDLM_FLOCK - LDLM_MIN_TYPE] ldlm_flock_policy_local_to_wire, - [LDLM_IBITS - LDLM_MIN_TYPE] ldlm_ibits_policy_local_to_wire, + [LDLM_PLAIN - LDLM_MIN_TYPE]= ldlm_plain_policy_local_to_wire, + [LDLM_EXTENT - LDLM_MIN_TYPE] = ldlm_extent_policy_local_to_wire, + [LDLM_FLOCK - LDLM_MIN_TYPE]= ldlm_flock_policy_local_to_wire, + [LDLM_IBITS - LDLM_MIN_TYPE]= ldlm_ibits_policy_local_to_wire, }; /** diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index c900706..6f21a12 100644 --- a/drivers/staging/lustre/lustre/l
Re: [PATCH v2 1/5] Staging: bcm: LeakyBucket: Fixed spacing/tabing issues
On Sun, 2013-07-28 at 03:34 +0800, Lilis Iskandar wrote: > I don't understand what you mean by mentioning "git diff -w". > Perhaps you can clarify it for me? Sorry :( $ git diff --help | grep -w -A2 "\-w" -w, --ignore-all-space Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none. It makes sure you are doing only whitespace changes. Any other changes show up as an actual diff. You can also compile the changes and make sure the .o files before and after don't change. (Something like: assuming a clean tree) $ cat compare_patch_obj_diffs.sh #!/bin/bash if [[ ! -e $1 || ! -f $1 ]] then echo "$1 not found" exit $? fi grep -P "^\+\+\+" $1 | while read file do real_file=$(echo $file | cut -f2- -d'/') if [[ ${real_file:(-2)} == ".c" ]] then obj=${real_file%.c}.o make $obj mv $obj $obj.old patch -p1 < $1 make $obj mv $obj $obj.new patch -p1 -R < $1 size $obj.old $obj.new if [[ $2 == "y" ]] then objdump -d $obj.old > $obj.old.dmp objdump -d $obj.new > $obj.new.dmp diff $obj.old.dmp $obj.new.dmp rm -f $obj.old.dmp $obj.new.dmp fi fi done ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel