[PATCH] Staging: rtl8712: Fixed 'tabstop' coding style warnings.
Fixed checkpatch warning "Statements should start on a tabstop" in rtl8712 module. Signed-off-by: Yamanappagouda Patil --- drivers/staging/rtl8712/rtl8712_led.c | 24 drivers/staging/rtl8712/rtl871x_recv.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_led.c b/drivers/staging/rtl8712/rtl8712_led.c index a8e237e..317aeee 100644 --- a/drivers/staging/rtl8712/rtl8712_led.c +++ b/drivers/staging/rtl8712/rtl8712_led.c @@ -355,7 +355,7 @@ static void SwLedBlink1(struct LED_871x *pLed) } pLed->bLedScanBlinkInProgress = false; } else { -if (pLed->bLedOn) + if (pLed->bLedOn) pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_STATE_ON; @@ -390,7 +390,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->BlinkTimes = 0; pLed->bLedBlinkInProgress = false; } else { -if (pLed->bLedOn) + if (pLed->bLedOn) pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_STATE_ON; @@ -460,7 +460,7 @@ static void SwLedBlink2(struct LED_871x *pLed) } pLed->bLedScanBlinkInProgress = false; } else { -if (pLed->bLedOn) + if (pLed->bLedOn) pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_STATE_ON; @@ -667,7 +667,7 @@ static void SwLedBlink4(struct LED_871x *pLed) msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA)); pLed->bLedBlinkInProgress = false; } else { -if (pLed->bLedOn) + if (pLed->bLedOn) pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_STATE_ON; @@ -764,7 +764,7 @@ static void SwLedBlink5(struct LED_871x *pLed) msecs_to_jiffies(LED_BLINK_FASTER_INTERVAL_ALPHA)); pLed->bLedBlinkInProgress = false; } else { -if (pLed->bLedOn) + if (pLed->bLedOn) pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_STATE_ON; @@ -946,7 +946,7 @@ static void SwLedControlMode1(struct _adapter *padapter, if (psitesurveyctrl->traffic_busy && check_fwstate(pmlmepriv, _FW_LINKED)) ; /* dummy branch */ -else if (!pLed->bLedScanBlinkInProgress) { + else if (!pLed->bLedScanBlinkInProgress) { if (IS_LED_WPS_BLINKING(pLed)) return; if (pLed->bLedNoLinkBlinkInProgress) { @@ -970,7 +970,7 @@ static void SwLedControlMode1(struct _adapter *padapter, pLed->BlinkingLedState = LED_STATE_ON; mod_timer(&pLed->BlinkTimer, jiffies + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA)); -} + } break; case LED_CTL_TX: case LED_CTL_RX: @@ -1000,7 +1000,7 @@ static void SwLedControlMode1(struct _adapter *padapter, case LED_CTL_START_WPS: /*wait until xinpin finish */ case LED_CTL_START_WPS_BOTTON: -if (!pLed->bLedWPSBlinkInProgress) { + if (!pLed->bLedWPSBlinkInProgress) { if (pLed->bLedNoLinkBlinkInProgress) { del_timer(&pLed->BlinkTimer); pLed->bLedNoLinkBlinkInProgress = false; @@ -1113,9 +1113,9 @@ static void SwLedControlMode2(struct _adapter *padapter, switch (LedAction) { case LED_CTL_SITE_SURVEY: -if (pmlmepriv->sitesurveyctrl.traffic_busy) + if (pmlmepriv->sitesurveyctrl.traffic_busy) ; /* dummy branch */ -else if (!pLed->bLedScanBlinkInProgress) { + else if (!pLed->bLedScanBlinkInProgress) { if (IS_LED_WPS_BLINKING(pLed)) return; @@ -1132,7 +1132,7 @@ static void SwLedControlMode2(struct _adapter *padapter, pLed->BlinkingLedState = LED_STATE_ON; mod_timer(&pLed->BlinkTimer, jiffies +
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
Hm... I seem to duplicate the Sparse warnings at all. That's weird. Anyway as far as I can tell the warnings are false positives... Can't you just remove the __iomem tag? Have you tested this change? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
On Thu, Nov 17, 2016 at 11:51 AM, Dan Carpenter wrote: > Hm... I seem to duplicate the Sparse warnings at all. That's weird. > With this patch applied, sparse warnings dissapear for me... That's weird. > Anyway as far as I can tell the warnings are false positives... Can't > you just remove the __iomem tag? Have you tested this change? > I haven' t tested this change because I can't test it :(. Do you think that just removing __iomem tag is enough? Maybe we can get feedback from Lior or someone. Thanks for your review time, Dan. Cheers, Sergio Paracuellos ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
On Thu, Nov 17, 2016 at 12:22:00PM +0100, Sergio Paracuellos wrote: > On Thu, Nov 17, 2016 at 11:51 AM, Dan Carpenter > wrote: > > Hm... I seem to duplicate the Sparse warnings at all. That's weird. > > > > With this patch applied, sparse warnings dissapear for me... That's weird. > I understand that. > > Anyway as far as I can tell the warnings are false positives... Can't > > you just remove the __iomem tag? Have you tested this change? > > > I haven' t tested this change because I can't test it :(. Do you think > that just removing > __iomem tag is enough? Give it a shot and see if the warnings go away. I don't think the tag is correct. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
On Thu, Nov 17, 2016 at 12:33 PM, Dan Carpenter wrote: > Give it a shot and see if the warnings go away. I don't think the tag > is correct. Just removing __iomem tag in shmem_data field of slic_shmemory struct makes sparse happy. No warnings around. Should I send a v4 patch with the tag removed? Cheers, Sergio Paracuellos ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571
From: Ping-Ke Shih In commit c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module parameter"), wifi was fixed for those laptops that have only a single antenna but have an incorrectly coded EEPROM. This error causes the driver to select the wrong antenna. In that commit, one necessary change that affects Bluetooth operation was missed. Fixes: c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module parameter") Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Stable --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index aba60c3..cb046ec 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c @@ -2664,9 +2664,12 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, } /* override ant_num / ant_path */ - if (mod_params->ant_sel) + if (mod_params->ant_sel) { rtlpriv->btcoexist.btc_info.ant_num = (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); + rtlpriv->btcoexist.btc_info.single_ant_path = + (mod_params->ant_sel == 1 ? 0 : 1); + } } void rtl8723be_bt_reg_init(struct ieee80211_hw *hw) -- 2.10.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571
On 11/17/2016 12:05 PM, Larry Finger wrote: From: Ping-Ke Shih In commit c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module parameter"), wifi was fixed for those laptops that have only a single antenna but have an incorrectly coded EEPROM. This error causes the driver to select the wrong antenna. In that commit, one necessary change that affects Bluetooth operation was missed. Fixes: c18d8f509571 ("rtlwifi: rtl8723be: Add antenna select module parameter") Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Stable --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index aba60c3..cb046ec 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c @@ -2664,9 +2664,12 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, } /* override ant_num / ant_path */ - if (mod_params->ant_sel) + if (mod_params->ant_sel) { rtlpriv->btcoexist.btc_info.ant_num = (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); + rtlpriv->btcoexist.btc_info.single_ant_path = + (mod_params->ant_sel == 1 ? 0 : 1); + } } void rtl8723be_bt_reg_init(struct ieee80211_hw *hw) Please drop this patch. It contains an error. Sorry, Larry ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] rtlwifi: rtl8723be: Fix bug in ant_sel code from commit c18d8f509571
Hi Ping-Ke, [auto build test ERROR on wireless-drivers-next/master] [also build test ERROR on v4.9-rc5] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Larry-Finger/rtlwifi-rtl8723be-Fix-bug-in-ant_sel-code-from-commit-c18d8f509571/20161118-024559 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c: In function 'rtl8723be_read_bt_coexist_info_from_hwpg': >> drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c:2670:30: error: 'struct >> rtl_btc_info' has no member named 'single_ant_path' rtlpriv->btcoexist.btc_info.single_ant_path = ^ vim +2670 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c 2664 } 2665 2666 /* override ant_num / ant_path */ 2667 if (mod_params->ant_sel) { 2668 rtlpriv->btcoexist.btc_info.ant_num = 2669 (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1); > 2670 rtlpriv->btcoexist.btc_info.single_ant_path = 2671 (mod_params->ant_sel == 1 ? 0 : 1); 2672 } 2673 } --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/19] LNet/libcfs checkpatch and style cleanups
Sweep of the LNet/libcfs layer to cleanup various checkpatch issues. Also more cleanups to match the kernel coding style. James Simmons (19): staging: lustre: lnet: don't use bare unsigned staging: lustre: lnet: resolve trailing */ checkpatch errors staging: lustre: libcfs: use static const char const * for a suffixes array staging: lustre: libcfs: remove explict test of NULL variable staging: lustre: libcfs: fix aligment issue staging: lustre: lnet: fix misspelled word destroy staging: lustre: lnet: remove unused lib_me_dump staging: lustre: lnet: missing blank line after declaration staging: lustre: lnet: fill in real lnet_md_t staging: lustre: lnet: replace uninitialized_var staging: lustre: libcfs: remove != 0 testing staging: lustre: libcfs: remove == 0 testing staging: lustre: libcfs: white space cleanup staging: lustre: libcfs: fix misspelling of descriptor staging: lustre: libcfs: Make char * array envp static constant staging: lustre: libcfs: use pr_* instead of printk staging: lustre: libcfs: remove use of __u* types staging: lustre: lnet: use BIT macro in LNet selftest staging: lustre: lnet: cleanup some of the > 80 line issues .../staging/lustre/lnet/klnds/socklnd/socklnd.c| 31 +++-- .../staging/lustre/lnet/klnds/socklnd/socklnd.h| 132 +--- .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 40 -- .../lustre/lnet/klnds/socklnd/socklnd_lib.c|6 +- .../lustre/lnet/klnds/socklnd/socklnd_proto.c | 26 +++- drivers/staging/lustre/lnet/libcfs/debug.c | 36 +++--- drivers/staging/lustre/lnet/libcfs/fail.c |4 +- drivers/staging/lustre/lnet/libcfs/hash.c | 117 +- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c|2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 20 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c| 22 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 58 +- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 132 ++-- .../lustre/lnet/libcfs/linux/linux-crypto.c| 32 +++--- .../lustre/lnet/libcfs/linux/linux-crypto.h|2 +- .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 20 ++-- .../lustre/lnet/libcfs/linux/linux-module.c|2 +- .../staging/lustre/lnet/libcfs/linux/linux-prim.c | 10 +- .../lustre/lnet/libcfs/linux/linux-tracefile.c | 28 ++-- drivers/staging/lustre/lnet/libcfs/module.c| 18 ++-- drivers/staging/lustre/lnet/libcfs/prng.c |2 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 108 drivers/staging/lustre/lnet/libcfs/tracefile.h | 28 ++-- drivers/staging/lustre/lnet/libcfs/workitem.c | 50 drivers/staging/lustre/lnet/lnet/api-ni.c |8 +- drivers/staging/lustre/lnet/lnet/lib-me.c | 18 --- drivers/staging/lustre/lnet/lnet/lib-move.c|1 + drivers/staging/lustre/lnet/lnet/nidstrings.c |4 +- drivers/staging/lustre/lnet/lnet/router.c | 17 ++-- drivers/staging/lustre/lnet/selftest/conctl.c |2 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 28 +++-- drivers/staging/lustre/lnet/selftest/conrpc.h | 23 ++-- drivers/staging/lustre/lnet/selftest/console.c | 27 +++-- drivers/staging/lustre/lnet/selftest/console.h | 25 ++-- drivers/staging/lustre/lnet/selftest/framework.c | 23 ++-- drivers/staging/lustre/lnet/selftest/ping_test.c |4 +- drivers/staging/lustre/lnet/selftest/rpc.c |3 +- drivers/staging/lustre/lnet/selftest/rpc.h |6 +- drivers/staging/lustre/lnet/selftest/selftest.h| 25 +++-- drivers/staging/lustre/lnet/selftest/timer.c |7 +- 40 files changed, 621 insertions(+), 526 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/19] staging: lustre: lnet: fix misspelled word destroy
Fix misspelling of destroy in LNet core. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/api-ni.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 4daf828..b2ba10d 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1551,16 +1551,16 @@ void lnet_lib_exit(void) rc = lnet_check_routes(); if (rc) - goto err_destory_routes; + goto err_destroy_routes; rc = lnet_rtrpools_alloc(im_a_router); if (rc) - goto err_destory_routes; + goto err_destroy_routes; } rc = lnet_acceptor_start(); if (rc) - goto err_destory_routes; + goto err_destroy_routes; the_lnet.ln_refcount = 1; /* Now I may use my own API functions... */ @@ -1587,7 +1587,7 @@ void lnet_lib_exit(void) err_acceptor_stop: the_lnet.ln_refcount = 0; lnet_acceptor_stop(); -err_destory_routes: +err_destroy_routes: if (!the_lnet.ln_nis_from_mod_params) lnet_destroy_routes(); err_shutdown_lndnis: -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/19] staging: lustre: lnet: resolve trailing */ errors
This patch resolves the checkpatch error: Block comments use a trailing */ on a separate line for the LNet/libcfs layer Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/socklnd/socklnd.h| 128 +--- drivers/staging/lustre/lnet/libcfs/hash.c |2 +- .../lustre/lnet/libcfs/linux/linux-crypto.h|2 +- drivers/staging/lustre/lnet/libcfs/prng.c |2 +- drivers/staging/lustre/lnet/selftest/console.h |9 +- drivers/staging/lustre/lnet/selftest/rpc.h |6 +- drivers/staging/lustre/lnet/selftest/selftest.h| 21 ++- drivers/staging/lustre/lnet/selftest/timer.c |3 +- 8 files changed, 112 insertions(+), 61 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index c51c16b..2978014 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -84,7 +84,8 @@ struct ksock_sched { /* per scheduler state */ struct list_headkss_zombie_noop_txs; /* zombie noop tx list */ wait_queue_head_t kss_waitq; /* where scheduler sleeps */ int kss_nconns; /* # connections assigned to -* this scheduler */ +* this scheduler +*/ struct ksock_sched_info *kss_info; /* owner of it */ }; @@ -110,15 +111,19 @@ struct ksock_interface { /* in-use interface */ struct ksock_tunables { int *ksnd_timeout;/* "stuck" socket timeout - * (seconds) */ + * (seconds) + */ int *ksnd_nscheds;/* # scheduler threads in each - * pool while starting */ + * pool while starting + */ int *ksnd_nconnds;/* # connection daemons */ int *ksnd_nconnds_max;/* max # connection daemons */ int *ksnd_min_reconnectms;/* first connection retry after - * (ms)... */ + * (ms)... + */ int *ksnd_max_reconnectms;/* ...exponentially increasing to - * this */ + * this + */ int *ksnd_eager_ack; /* make TCP ack eagerly? */ int *ksnd_typed_conns;/* drive sockets by type? */ int *ksnd_min_bulk; /* smallest "large" message */ @@ -126,9 +131,11 @@ struct ksock_tunables { int *ksnd_rx_buffer_size; /* socket rx buffer size */ int *ksnd_nagle; /* enable NAGLE? */ int *ksnd_round_robin;/* round robin for multiple - * interfaces */ + * interfaces + */ int *ksnd_keepalive; /* # secs for sending keepalive - * NOOP */ + * NOOP + */ int *ksnd_keepalive_idle; /* # idle secs before 1st probe */ int *ksnd_keepalive_count;/* # probes */ @@ -137,20 +144,26 @@ struct ksock_tunables { int *ksnd_peertxcredits; /* # concurrent sends to 1 peer */ int *ksnd_peerrtrcredits; /* # per-peer router buffer - * credits */ + * credits + */ int *ksnd_peertimeout;/* seconds to consider peer dead */ int *ksnd_enable_csum;/* enable check sum */ int *ksnd_inject_csum_error; /* set non-zero to inject - * checksum error */ + * checksum error + */ int *ksnd_nonblk_zcack; /* always send zc-ack on - * non-blocking connection */ +
[PATCH 13/19] staging: lustre: libcfs: white space cleanup
Remove white space present for variable declarations or initialization. Cleanup structs was strange alignments due to white spacing. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/debug.c | 16 ++-- drivers/staging/lustre/lnet/libcfs/hash.c | 24 +++--- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c|2 +- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 14 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_mem.c| 22 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 24 +++--- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 100 ++-- .../lustre/lnet/libcfs/linux/linux-crypto.c| 20 ++-- .../staging/lustre/lnet/libcfs/linux/linux-debug.c |6 +- .../staging/lustre/lnet/libcfs/linux/linux-prim.c | 10 +- .../lustre/lnet/libcfs/linux/linux-tracefile.c |8 +- drivers/staging/lustre/lnet/libcfs/module.c| 14 ++-- drivers/staging/lustre/lnet/libcfs/tracefile.c | 80 drivers/staging/lustre/lnet/libcfs/tracefile.h | 28 +++--- drivers/staging/lustre/lnet/libcfs/workitem.c | 40 15 files changed, 204 insertions(+), 204 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 67f043e..a38db23 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -255,9 +255,9 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) { const char *(*fn)(int bit) = is_subsys ? libcfs_debug_subsys2str : libcfs_debug_dbg2str; - intlen = 0; - const char *token; - inti; + int len = 0; + const char *token; + int i; if (!mask) {/* "0" */ if (size > 0) @@ -301,10 +301,10 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) { const char *(*fn)(int bit) = is_subsys ? libcfs_debug_subsys2str : libcfs_debug_dbg2str; - int m = 0; - int matched; - int n; - int t; + int m = 0; + int matched; + int n; + int t; /* Allow a number for backwards compatibility */ @@ -389,8 +389,8 @@ void libcfs_debug_dumplog(void) int libcfs_debug_init(unsigned long bufsize) { - intrc = 0; unsigned int max = libcfs_debug_mb; + int rc = 0; init_waitqueue_head(&debug_ctlwq); diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index 22e1e25..12ed71c 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -289,7 +289,7 @@ struct cfs_hash_head_dep { static struct hlist_head * cfs_hash_hd_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd) { - struct cfs_hash_head_dep *head; + struct cfs_hash_head_dep *head; head = (struct cfs_hash_head_dep *)&bd->bd_bucket->hsb_head[0]; return &head[bd->bd_offset].hd_head; @@ -512,9 +512,9 @@ struct cfs_hash_dhead_dep { return; spin_lock(&hs->hs_dep_lock); - hs->hs_dep_max = dep_cur; - hs->hs_dep_bkt = bd->bd_bucket->hsb_index; - hs->hs_dep_off = bd->bd_offset; + hs->hs_dep_max = dep_cur; + hs->hs_dep_bkt = bd->bd_bucket->hsb_index; + hs->hs_dep_off = bd->bd_offset; hs->hs_dep_bits = hs->hs_cur_bits; spin_unlock(&hs->hs_dep_lock); @@ -908,9 +908,9 @@ struct hlist_node * return NULL; } - new_bkts[i]->hsb_index = i; - new_bkts[i]->hsb_version = 1; /* shouldn't be zero */ - new_bkts[i]->hsb_depmax = -1; /* unknown */ + new_bkts[i]->hsb_index = i; + new_bkts[i]->hsb_version = 1; /* shouldn't be zero */ + new_bkts[i]->hsb_depmax = -1; /* unknown */ bd.bd_bucket = new_bkts[i]; cfs_hash_bd_for_each_hlist(hs, &bd, hhead) INIT_HLIST_HEAD(hhead); @@ -950,9 +950,9 @@ static int cfs_hash_dep_print(struct cfs_workitem *wi) int bits; spin_lock(&hs->hs_dep_lock); - dep = hs->hs_dep_max; - bkt = hs->hs_dep_bkt; - off = hs->hs_dep_off; + dep = hs->hs_dep_max; + bkt = hs->hs_dep_bkt; + off = hs->hs_dep_off; bits = hs->hs_dep_bits; spin_unlock(&hs->hs_dep_lock); @@ -1040,7 +1040,7 @@ struct cfs_hash * hs->hs_max_bits = (__u8)max_bits; hs->hs_bkt_bits = (__u8)bkt_bits; - hs->hs_ops = ops; + hs->hs_ops = ops; hs->hs_extra_bytes = extra_bytes; hs->hs_rehash_bits = 0; cfs_wi_init(&hs->hs_rehash_wi, hs, cfs_hash_rehash_worker); @@ -1292,7 +1292,7 @@ void cfs_hash_putr
[PATCH 10/19] staging: lustre: lnet: replace uninitialized_var
Checkpatch for some reason doesn't like the way libcfs_str2net_internal. Lets just replace it with nf being set to NULL instead Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/nidstrings.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/nidstrings.c b/drivers/staging/lustre/lnet/lnet/nidstrings.c index 63379f7..e1f1ca8 100644 --- a/drivers/staging/lustre/lnet/lnet/nidstrings.c +++ b/drivers/staging/lustre/lnet/lnet/nidstrings.c @@ -1156,7 +1156,7 @@ static void cfs_ip_min_max(struct list_head *nidlist, __u32 *min_nid, static struct netstrfns * libcfs_str2net_internal(const char *str, __u32 *net) { - struct netstrfns *uninitialized_var(nf); + struct netstrfns *nf = NULL; int nob; unsigned int netnum; int i; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/19] staging: lustre: libcfs: use pr_* instead of printk
Checkpatch recommended that we use pr_*() instead of printk directly. Signed-off-by: James Simmons --- .../lustre/lnet/libcfs/linux/linux-tracefile.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c index a3cabb9..75eb84e 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c @@ -85,7 +85,7 @@ int cfs_tracefile_init_arch(void) out: cfs_tracefile_fini_arch(); - printk(KERN_ERR "lnet: Not enough memory\n"); + pr_err("lnet: Not enough memory\n"); return -ENOMEM; } @@ -239,11 +239,11 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask, } if (mask & D_CONSOLE) { - printk("%s%s: %.*s", ptype, prefix, len, buf); + pr_info("%s%s: %.*s", ptype, prefix, len, buf); } else { - printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, - hdr->ph_pid, hdr->ph_extern_pid, file, hdr->ph_line_num, - fn, len, buf); + pr_info("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix, + hdr->ph_pid, hdr->ph_extern_pid, file, + hdr->ph_line_num, fn, len, buf); } } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/19] staging: lustre: lnet: remove unused lib_me_dump
Remove unused lib_me_dump. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/lib-me.c | 18 -- 1 files changed, 0 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c index b430046..eb796a8 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-me.c +++ b/drivers/staging/lustre/lnet/lnet/lib-me.c @@ -271,21 +271,3 @@ lnet_res_lh_invalidate(&me->me_lh); lnet_me_free(me); } - -#if 0 -static void -lib_me_dump(lnet_me_t *me) -{ - CWARN("Match Entry %p (%#llx)\n", me, - me->me_lh.lh_cookie); - - CWARN("\tMatch/Ignore\t= %016lx / %016lx\n", - me->me_match_bits, me->me_ignore_bits); - - CWARN("\tMD\t= %p\n", me->md); - CWARN("\tprev\t= %p\n", - list_entry(me->me_list.prev, lnet_me_t, me_list)); - CWARN("\tnext\t= %p\n", - list_entry(me->me_list.next, lnet_me_t, me_list)); -} -#endif -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/19] staging: lustre: lnet: don't use bare unsigned
Turn all bare unsigned to unsigned int that were detected by checkpatch in the LNet/libcfs layer. Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/socklnd/socklnd.h|4 +- drivers/staging/lustre/lnet/libcfs/debug.c |2 +- drivers/staging/lustre/lnet/libcfs/hash.c | 26 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_string.c |8 +++--- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c |6 ++-- drivers/staging/lustre/lnet/lnet/nidstrings.c |2 +- drivers/staging/lustre/lnet/selftest/conctl.c |2 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 18 +++-- drivers/staging/lustre/lnet/selftest/conrpc.h | 20 --- drivers/staging/lustre/lnet/selftest/console.c | 10 --- drivers/staging/lustre/lnet/selftest/console.h | 16 ++-- drivers/staging/lustre/lnet/selftest/framework.c |8 +++--- drivers/staging/lustre/lnet/selftest/ping_test.c |4 +- drivers/staging/lustre/lnet/selftest/selftest.h|4 +- 14 files changed, 68 insertions(+), 62 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index e6ca0cf..c51c16b 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -216,8 +216,8 @@ struct ksock_nal_data { time64_tksnd_connd_starting_stamp;/* time stamp of the * last starting connd */ - unsignedksnd_connd_starting;/* # starting connd */ - unsignedksnd_connd_running; /* # running connd */ + unsigned intksnd_connd_starting;/* # starting connd */ + unsigned intksnd_connd_running; /* # running connd */ spinlock_t ksnd_connd_lock;/* serialise */ struct list_headksnd_idle_noop_txs; /* list head for freed diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 23b36b8..9fe4227 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -57,7 +57,7 @@ static int libcfs_param_debug_mb_set(const char *val, const struct kernel_param *kp) { int rc; - unsigned num; + unsigned int num; rc = kstrtouint(val, 0, &num); if (rc < 0) diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index 997b8a5..3137f12 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -682,7 +682,7 @@ struct hlist_node * static void cfs_hash_multi_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, - unsigned n, int excl) + unsigned int n, int excl) { struct cfs_hash_bucket *prev = NULL; int i; @@ -704,7 +704,7 @@ struct hlist_node * static void cfs_hash_multi_bd_unlock(struct cfs_hash *hs, struct cfs_hash_bd *bds, -unsigned n, int excl) +unsigned int n, int excl) { struct cfs_hash_bucket *prev = NULL; int i; @@ -719,10 +719,10 @@ struct hlist_node * static struct hlist_node * cfs_hash_multi_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, - unsigned n, const void *key) + unsigned int n, const void *key) { struct hlist_node *ehnode; - unsigned i; + unsigned int i; cfs_hash_for_each_bd(bds, n, i) { ehnode = cfs_hash_bd_lookup_intent(hs, &bds[i], key, NULL, @@ -735,12 +735,12 @@ struct hlist_node * static struct hlist_node * cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, -unsigned n, const void *key, +unsigned int n, const void *key, struct hlist_node *hnode, int noref) { struct hlist_node *ehnode; int intent; - unsigned i; + unsigned int i; LASSERT(hnode); intent = (!noref * CFS_HS_LOOKUP_MASK_REF) | CFS_HS_LOOKUP_IT_PEEK; @@ -766,7 +766,7 @@ struct hlist_node * static struct hlist_node * cfs_hash_multi_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, -unsigned n, const void *key, +unsigned int n, const void *key, struct hlist_node *hnode) { struct hlist_node *ehnode; @@ -992,10 +992,10 @@ static inline void cfs_hash_depth_wi_cancel(struct cfs_hash *hs) {} #endif /* CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 */ struct cfs_hash * -cfs_hash_
[PATCH 08/19] staging: lustre: lnet: missing blank line after declaration
Add in missing blank line in lnet_copy_iov2iter() after variable declarations. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/lib-move.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 48e6f8f..f3dd6e4 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -192,6 +192,7 @@ left = siov->iov_len - soffset; do { size_t n, copy = left; + LASSERT(nsiov > 0); if (copy > nob) -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/19] staging: lustre: libcfs: fix misspelling of descriptor
Fix typo for correct spelling. Signed-off-by: James Simmons --- .../lustre/lnet/libcfs/linux/linux-crypto.c|2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c index 53b1bf7..68e34b4 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c @@ -177,7 +177,7 @@ int cfs_crypto_hash_digest(enum cfs_crypto_hash_alg hash_alg, EXPORT_SYMBOL(cfs_crypto_hash_digest); /** - * Allocate and initialize desriptor for hash algorithm. + * Allocate and initialize descriptor for hash algorithm. * * This should be used to initialize a hash descriptor for multiple calls * to a single hash function when computing the hash across multiple -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/19] staging: lustre: libcfs: remove use of __u* types
The __[u|s]* types are for UAPI headers or user space. They shouldn't be used in core kernel code. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/fail.c |4 ++-- drivers/staging/lustre/lnet/libcfs/hash.c | 16 drivers/staging/lustre/lnet/libcfs/libcfs_string.c |6 +++--- .../lustre/lnet/libcfs/linux/linux-module.c|2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/fail.c b/drivers/staging/lustre/lnet/libcfs/fail.c index 3a9c8dd..12dd50a 100644 --- a/drivers/staging/lustre/lnet/libcfs/fail.c +++ b/drivers/staging/lustre/lnet/libcfs/fail.c @@ -46,7 +46,7 @@ int cfs_race_state; EXPORT_SYMBOL(cfs_race_state); -int __cfs_fail_check_set(__u32 id, __u32 value, int set) +int __cfs_fail_check_set(u32 id, u32 value, int set) { static atomic_t cfs_fail_count = ATOMIC_INIT(0); @@ -124,7 +124,7 @@ int __cfs_fail_check_set(__u32 id, __u32 value, int set) } EXPORT_SYMBOL(__cfs_fail_check_set); -int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) +int __cfs_fail_timeout_set(u32 id, u32 value, int ms, int set) { int ret; diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index 12ed71c..b90dfb9 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -1035,10 +1035,10 @@ struct cfs_hash * cfs_hash_lock_setup(hs); cfs_hash_hlist_setup(hs); - hs->hs_cur_bits = (__u8)cur_bits; - hs->hs_min_bits = (__u8)cur_bits; - hs->hs_max_bits = (__u8)max_bits; - hs->hs_bkt_bits = (__u8)bkt_bits; + hs->hs_cur_bits = (u8)cur_bits; + hs->hs_min_bits = (u8)cur_bits; + hs->hs_max_bits = (u8)max_bits; + hs->hs_bkt_bits = (u8)bkt_bits; hs->hs_ops = ops; hs->hs_extra_bytes = extra_bytes; @@ -1405,14 +1405,14 @@ void cfs_hash_putref(struct cfs_hash *hs) *. if @removal_safe is true, use can remove current item by * cfs_hash_bd_del_locked */ -static __u64 +static u64 cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, void *data, int remove_safe) { struct hlist_node *hnode; struct hlist_node *pos; struct cfs_hash_bd bd; - __u64 count = 0; + u64 count = 0; int excl = !!remove_safe; int loop = 0; int i; @@ -1525,7 +1525,7 @@ struct cfs_hash_cond_arg { } EXPORT_SYMBOL(cfs_hash_is_empty); -__u64 +u64 cfs_hash_size_get(struct cfs_hash *hs) { return cfs_hash_with_counter(hs) ? @@ -1556,7 +1556,7 @@ struct cfs_hash_cond_arg { struct hlist_node *hnode; struct hlist_node *tmp; struct cfs_hash_bd bd; - __u32 version; + u32 version; int count = 0; int stop_on_change; int end = -1; diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c index ccebeb4..02de1ee 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_string.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_string.c @@ -411,7 +411,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), * \retval 0 otherwise */ int -cfs_expr_list_match(__u32 value, struct cfs_expr_list *expr_list) +cfs_expr_list_match(u32 value, struct cfs_expr_list *expr_list) { struct cfs_range_expr *expr; @@ -433,10 +433,10 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), * \retval < 0 for failure */ int -cfs_expr_list_values(struct cfs_expr_list *expr_list, int max, __u32 **valpp) +cfs_expr_list_values(struct cfs_expr_list *expr_list, int max, u32 **valpp) { struct cfs_range_expr *expr; - __u32 *val; + u32 *val; int count = 0; int i; diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c index 38308f8..3f5d58b 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c @@ -83,7 +83,7 @@ static inline bool libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n"); return true; } - if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_hdr.ioc_len) { + if ((u32)libcfs_ioctl_packlen(data) != data->ioc_hdr.ioc_len) { CERROR("LIBCFS ioctl: packlen != ioc_len\n"); return true; } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/19] staging: lustre: libcfs: fix aligment issue
Make alignment match open parenthesis for parameters to wait_event_interruptible_exclusive() call. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/workitem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/workitem.c b/drivers/staging/lustre/lnet/libcfs/workitem.c index e98c818..84118b5 100644 --- a/drivers/staging/lustre/lnet/libcfs/workitem.c +++ b/drivers/staging/lustre/lnet/libcfs/workitem.c @@ -273,7 +273,7 @@ static int cfs_wi_scheduler(void *arg) spin_unlock(&sched->ws_lock); rc = wait_event_interruptible_exclusive(sched->ws_waitq, - !cfs_wi_sched_cansleep(sched)); + !cfs_wi_sched_cansleep(sched)); spin_lock(&sched->ws_lock); } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/19] staging: lustre: libcfs: use static const char const * for a suffixes array
Change the static const array libcfs_debug_subsystems to use static const char const * as pointed out by checkpatch. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/debug.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 9fe4227..f95764c 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -228,7 +228,8 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) static const char * libcfs_debug_subsys2str(int subsys) { - static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES; + static const char * const libcfs_debug_subsystems[] = + LIBCFS_DEBUG_SUBSYS_NAMES; if (subsys >= ARRAY_SIZE(libcfs_debug_subsystems)) return NULL; @@ -240,7 +241,8 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) static const char * libcfs_debug_dbg2str(int debug) { - static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES; + static const char * const libcfs_debug_masks[] = + LIBCFS_DEBUG_MASKS_NAMES; if (debug >= ARRAY_SIZE(libcfs_debug_masks)) return NULL; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/19] staging: lustre: lnet: use BIT macro in LNet selftest
Some of the defines for lnet selftest can use the BIT macros. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/selftest/timer.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c index a4b723b..2fe692d 100644 --- a/drivers/staging/lustre/lnet/selftest/timer.c +++ b/drivers/staging/lustre/lnet/selftest/timer.c @@ -46,9 +46,9 @@ * to cover a time period of 1024 seconds into the future before wrapping. */ #define STTIMER_MINPOLL3 /* log2 min poll interval (8 s) */ -#define STTIMER_SLOTTIME (1 << STTIMER_MINPOLL) +#define STTIMER_SLOTTIME BIT(STTIMER_MINPOLL) #define STTIMER_SLOTTIMEMASK (~(STTIMER_SLOTTIME - 1)) -#define STTIMER_NSLOTS(1 << 7) +#define STTIMER_NSLOTS BIT(7) #define STTIMER_SLOT(t) (&stt_data.stt_hash[(((t) >> STTIMER_MINPOLL) & \ (STTIMER_NSLOTS - 1))]) -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/19] staging: lustre: lnet: cleanup some of the > 80 line issues
Cleanup some of the checkpatch over 80 character lines reported. Signed-off-by: James Simmons --- .../staging/lustre/lnet/klnds/socklnd/socklnd.c| 31 ++- .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 40 +--- .../lustre/lnet/klnds/socklnd/socklnd_lib.c|6 ++- .../lustre/lnet/klnds/socklnd/socklnd_proto.c | 26 ++--- drivers/staging/lustre/lnet/selftest/conrpc.c | 10 +++-- drivers/staging/lustre/lnet/selftest/conrpc.h |3 +- drivers/staging/lustre/lnet/selftest/console.c | 17 +--- drivers/staging/lustre/lnet/selftest/framework.c | 15 +-- drivers/staging/lustre/lnet/selftest/rpc.c |3 +- 9 files changed, 101 insertions(+), 50 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index cbc9a9c..b74cf63 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -96,7 +96,8 @@ } static int -ksocknal_create_peer(struct ksock_peer **peerp, lnet_ni_t *ni, lnet_process_id_t id) +ksocknal_create_peer(struct ksock_peer **peerp, lnet_ni_t *ni, +lnet_process_id_t id) { int cpt = lnet_cpt_of_nid(id.nid); struct ksock_net *net = ni->ni_data; @@ -319,7 +320,8 @@ struct ksock_peer * } static void -ksocknal_associate_route_conn_locked(struct ksock_route *route, struct ksock_conn *conn) +ksocknal_associate_route_conn_locked(struct ksock_route *route, +struct ksock_conn *conn) { struct ksock_peer *peer = route->ksnr_peer; int type = conn->ksnc_type; @@ -821,7 +823,8 @@ struct ksock_peer * if (k < peer->ksnp_n_passive_ips) /* using it already */ continue; - k = ksocknal_match_peerip(iface, peerips, n_peerips); + k = ksocknal_match_peerip(iface, peerips, + n_peerips); xor = ip ^ peerips[k]; this_netmatch = !(xor & iface->ksni_netmask) ? 1 : 0; @@ -1302,8 +1305,11 @@ struct ksock_peer * /* Take packets blocking for this connection. */ list_for_each_entry_safe(tx, txtmp, &peer->ksnp_tx_queue, tx_list) { - if (conn->ksnc_proto->pro_match_tx(conn, tx, tx->tx_nonblk) == SOCKNAL_MATCH_NO) - continue; + int match = conn->ksnc_proto->pro_match_tx(conn, tx, + tx->tx_nonblk); + + if (match == SOCKNAL_MATCH_NO) + continue; list_del(&tx->tx_list); ksocknal_queue_tx_locked(tx, conn); @@ -1493,8 +1499,8 @@ struct ksock_peer * spin_unlock_bh(&conn->ksnc_scheduler->kss_lock); } - peer->ksnp_proto = NULL;/* renegotiate protocol version */ - peer->ksnp_error = error; /* stash last conn close reason */ + peer->ksnp_proto = NULL; /* renegotiate protocol version */ + peer->ksnp_error = error; /* stash last conn close reason */ if (list_empty(&peer->ksnp_routes)) { /* @@ -1786,7 +1792,8 @@ struct ksock_peer * (id.pid == LNET_PID_ANY || id.pid == peer->ksnp_id.pid))) continue; - count += ksocknal_close_peer_conns_locked(peer, ipaddr, 0); + count += ksocknal_close_peer_conns_locked(peer, ipaddr, + 0); } } @@ -2026,7 +2033,10 @@ static int ksocknal_push(lnet_ni_t *ni, lnet_process_id_t id) } rc = 0; - /* NB only new connections will pay attention to the new interface! */ + /* +* NB only new connections will pay attention to the +* new interface! +*/ } write_unlock_bh(&ksocknal_data.ksnd_global_lock); @@ -2200,8 +2210,9 @@ static int ksocknal_push(lnet_ni_t *ni, lnet_process_id_t id) int txmem; int rxmem; int nagle; - struct ksock_conn *conn = ksocknal_get_conn_by_idx(ni, data->ioc_count); + struct ksock_conn *conn; + conn = ksocknal_get_conn_by_idx(ni, data->ioc_count); if (!conn) return -ENOENT; diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index f31f4a1..972f609 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/s
[PATCH 15/19] staging: lustre: libcfs: Make char * array envp static constant
The envp char array can be made static constant. Signed-off-by: James Simmons --- .../staging/lustre/lnet/libcfs/linux/linux-debug.c | 14 -- 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c index 8d37938..d8a9894 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c @@ -69,10 +69,11 @@ void libcfs_run_debug_log_upcall(char *file) { char *argv[3]; int rc; - char *envp[] = { + static const char * const envp[] = { "HOME=/", "PATH=/sbin:/bin:/usr/sbin:/usr/bin", - NULL}; + NULL + }; argv[0] = lnet_debug_log_upcall; @@ -81,7 +82,7 @@ void libcfs_run_debug_log_upcall(char *file) argv[2] = NULL; - rc = call_usermodehelper(argv[0], argv, envp, 1); + rc = call_usermodehelper(argv[0], argv, (char **)envp, 1); if (rc < 0 && rc != -ENOENT) { CERROR("Error %d invoking LNET debug log upcall %s %s; check /sys/kernel/debug/lnet/debug_log_upcall\n", rc, argv[0], argv[1]); @@ -95,10 +96,11 @@ void libcfs_run_upcall(char **argv) { int rc; int argc; - char *envp[] = { + static const char * const envp[] = { "HOME=/", "PATH=/sbin:/bin:/usr/sbin:/usr/bin", - NULL}; + NULL + }; argv[0] = lnet_upcall; argc = 1; @@ -107,7 +109,7 @@ void libcfs_run_upcall(char **argv) LASSERT(argc >= 2); - rc = call_usermodehelper(argv[0], argv, envp, 1); + rc = call_usermodehelper(argv[0], argv, (char **)envp, 1); if (rc < 0 && rc != -ENOENT) { CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; check /sys/kernel/debug/lnet/upcall\n", rc, argv[0], argv[1], -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/19] staging: lustre: libcfs: remove explicit test of NULL variable
Remove != NULL which is not needed to test key existence. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c index 83543f9..1deea76 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c @@ -73,7 +73,7 @@ struct cfs_percpt_lock * cfs_percpt_for_each(lock, i, pcl->pcl_locks) { spin_lock_init(lock); - if (keys != NULL) + if (keys) lockdep_set_class(lock, &keys[i]); } -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/19] staging: lustre: libcfs: remove == 0 testing
Testing == 0 is not kernel style so remove this type of testing from libcfs. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/debug.c |8 +++--- drivers/staging/lustre/lnet/libcfs/hash.c | 27 +-- drivers/staging/lustre/lnet/libcfs/libcfs_lock.c |4 +- drivers/staging/lustre/lnet/libcfs/libcfs_string.c | 16 ++-- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 12 .../lustre/lnet/libcfs/linux/linux-crypto.c|4 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 14 +- drivers/staging/lustre/lnet/libcfs/workitem.c |2 +- 8 files changed, 43 insertions(+), 44 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index 57cdc76..67f043e 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -259,13 +259,13 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) const char *token; inti; - if (mask == 0) {/* "0" */ + if (!mask) {/* "0" */ if (size > 0) str[0] = '0'; len = 1; } else {/* space-separated tokens */ for (i = 0; i < 32; i++) { - if ((mask & (1 << i)) == 0) + if (!(mask & (1 << i))) continue; token = fn(i); @@ -416,9 +416,9 @@ int libcfs_debug_init(unsigned long bufsize) max = max / num_possible_cpus(); max <<= (20 - PAGE_SHIFT); } - rc = cfs_tracefile_init(max); - if (rc == 0) { + rc = cfs_tracefile_init(max); + if (!rc) { libcfs_register_panic_notifier(); libcfs_debug_mb = cfs_trace_get_debug_mb(); } diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index 1b67536..22e1e25 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -507,7 +507,7 @@ struct cfs_hash_dhead_dep { bd->bd_bucket->hsb_depmax = dep_cur; # if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 - if (likely(warn_on_depth == 0 || + if (likely(!warn_on_depth || max(warn_on_depth, hs->hs_dep_max) >= dep_cur)) return; @@ -531,7 +531,7 @@ struct cfs_hash_dhead_dep { rc = hs->hs_hops->hop_hnode_add(hs, bd, hnode); cfs_hash_bd_dep_record(hs, bd, rc); bd->bd_bucket->hsb_version++; - if (unlikely(bd->bd_bucket->hsb_version == 0)) + if (unlikely(!bd->bd_bucket->hsb_version)) bd->bd_bucket->hsb_version++; bd->bd_bucket->hsb_count++; @@ -551,7 +551,7 @@ struct cfs_hash_dhead_dep { LASSERT(bd->bd_bucket->hsb_count > 0); bd->bd_bucket->hsb_count--; bd->bd_bucket->hsb_version++; - if (unlikely(bd->bd_bucket->hsb_version == 0)) + if (unlikely(!bd->bd_bucket->hsb_version)) bd->bd_bucket->hsb_version++; if (cfs_hash_with_counter(hs)) { @@ -571,7 +571,7 @@ struct cfs_hash_dhead_dep { struct cfs_hash_bucket *nbkt = bd_new->bd_bucket; int rc; - if (cfs_hash_bd_compare(bd_old, bd_new) == 0) + if (!cfs_hash_bd_compare(bd_old, bd_new)) return; /* use cfs_hash_bd_hnode_add/del, to avoid atomic & refcount ops @@ -584,11 +584,11 @@ struct cfs_hash_dhead_dep { LASSERT(obkt->hsb_count > 0); obkt->hsb_count--; obkt->hsb_version++; - if (unlikely(obkt->hsb_version == 0)) + if (unlikely(!obkt->hsb_version)) obkt->hsb_version++; nbkt->hsb_count++; nbkt->hsb_version++; - if (unlikely(nbkt->hsb_version == 0)) + if (unlikely(!nbkt->hsb_version)) nbkt->hsb_version++; } @@ -883,7 +883,7 @@ struct hlist_node * struct cfs_hash_bucket **new_bkts; int i; - LASSERT(old_size == 0 || old_bkts); + LASSERT(!old_size || old_bkts); if (old_bkts && old_size == new_size) return old_bkts; @@ -1016,12 +1016,11 @@ struct cfs_hash * LASSERT(cur_bits > 0); LASSERT(cur_bits >= bkt_bits); LASSERT(max_bits >= cur_bits && max_bits < 31); - LASSERT(ergo((flags & CFS_HASH_REHASH) == 0, cur_bits == max_bits)); - LASSERT(ergo(flags & CFS_HASH_REHASH, -(flags & CFS_HASH_NO_LOCK) == 0)); + LASSERT(ergo(!(flags & CFS_HASH_REHASH), cur_bits == max_bits)); + LASSERT(ergo(flags & CFS_HASH_REHASH, !(flags & CFS_HASH_NO_LOCK))); LASSERT(ergo(flags & CFS_HASH_REHASH_KEY, ops->hs_keycpy)); - len = (flags & CFS_HASH_BIGNAME) == 0 ? + len = !(flags & CFS_HASH_BIGNAME) ?
[PATCH 09/19] staging: lustre: lnet: fill in real lnet_md_t
While checkpatch reported an alignment issue its just ugly to fill in a data structure being passed to a function. Instead fill in a lnet_md_t on the stack and pass that to LNetMDBind. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/router.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 063ad55..8afa0ab 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -903,6 +903,7 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg) { lnet_rc_data_t *rcd = NULL; lnet_ping_info_t *pi; + lnet_md_t md; int rc; int i; @@ -925,15 +926,15 @@ int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg) } rcd->rcd_pinginfo = pi; + md.start = pi; + md.user_ptr = rcd; + md.length = LNET_PINGINFO_SIZE; + md.threshold = LNET_MD_THRESH_INF; + md.options = LNET_MD_TRUNCATE; + md.eq_handle = the_lnet.ln_rc_eqh; + LASSERT(!LNetHandleIsInvalid(the_lnet.ln_rc_eqh)); - rc = LNetMDBind((lnet_md_t){.start = pi, - .user_ptr = rcd, - .length= LNET_PINGINFO_SIZE, - .threshold = LNET_MD_THRESH_INF, - .options = LNET_MD_TRUNCATE, - .eq_handle = the_lnet.ln_rc_eqh}, - LNET_UNLINK, - &rcd->rcd_mdh); + rc = LNetMDBind(md, LNET_UNLINK, &rcd->rcd_mdh); if (rc < 0) { CERROR("Can't bind MD: %d\n", rc); goto out; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/19] staging: lustre: libcfs: remove != 0 testing
Testing != 0 is not kernel style so remove this type of testing from libcfs. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/libcfs/debug.c |4 +- drivers/staging/lustre/lnet/libcfs/hash.c | 24 ++-- drivers/staging/lustre/lnet/libcfs/libcfs_string.c |6 ++-- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 14 +- .../lustre/lnet/libcfs/linux/linux-crypto.c|6 ++-- .../lustre/lnet/libcfs/linux/linux-tracefile.c | 10 drivers/staging/lustre/lnet/libcfs/module.c|4 +- drivers/staging/lustre/lnet/libcfs/tracefile.c | 14 +- drivers/staging/lustre/lnet/libcfs/workitem.c |6 ++-- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c index f95764c..57cdc76 100644 --- a/drivers/staging/lustre/lnet/libcfs/debug.c +++ b/drivers/staging/lustre/lnet/libcfs/debug.c @@ -278,7 +278,7 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) len++; } - while (*token != 0) { + while (*token) { if (len < size) str[len] = *token; token++; @@ -315,7 +315,7 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp) t = sscanf(str, "%i%n", &m, &matched); if (t >= 1 && matched == n) { /* don't print warning for lctl set_param debug=0 or -1 */ - if (m != 0 && m != -1) + if (m && m != -1) CWARN("You are trying to use a numerical value for the mask - this will be deprecated in a future release.\n"); *mask = m; return 0; diff --git a/drivers/staging/lustre/lnet/libcfs/hash.c b/drivers/staging/lustre/lnet/libcfs/hash.c index 530def6..1b67536 100644 --- a/drivers/staging/lustre/lnet/libcfs/hash.c +++ b/drivers/staging/lustre/lnet/libcfs/hash.c @@ -492,7 +492,7 @@ struct cfs_hash_dhead_dep { cfs_hash_bd_from_key(hs, hs->hs_buckets, hs->hs_cur_bits, key, bd); } else { - LASSERT(hs->hs_rehash_bits != 0); + LASSERT(hs->hs_rehash_bits); cfs_hash_bd_from_key(hs, hs->hs_rehash_buckets, hs->hs_rehash_bits, key, bd); } @@ -629,7 +629,7 @@ enum cfs_hash_lookup_intent { struct hlist_head *hhead = cfs_hash_bd_hhead(hs, bd); struct hlist_node *ehnode; struct hlist_node *match; - int intent_add = (intent & CFS_HS_LOOKUP_MASK_ADD) != 0; + int intent_add = intent & CFS_HS_LOOKUP_MASK_ADD; /* with this function, we can avoid a lot of useless refcount ops, * which are expensive atomic operations most time. @@ -643,13 +643,13 @@ enum cfs_hash_lookup_intent { continue; /* match and ... */ - if ((intent & CFS_HS_LOOKUP_MASK_DEL) != 0) { + if (intent & CFS_HS_LOOKUP_MASK_DEL) { cfs_hash_bd_del_locked(hs, bd, ehnode); return ehnode; } /* caller wants refcount? */ - if ((intent & CFS_HS_LOOKUP_MASK_REF) != 0) + if (intent & CFS_HS_LOOKUP_MASK_REF) cfs_hash_get(hs, ehnode); return ehnode; } @@ -815,7 +815,7 @@ struct hlist_node * return; } - LASSERT(hs->hs_rehash_bits != 0); + LASSERT(hs->hs_rehash_bits); cfs_hash_bd_from_key(hs, hs->hs_rehash_buckets, hs->hs_rehash_bits, key, &bds[1]); @@ -976,7 +976,7 @@ static void cfs_hash_depth_wi_cancel(struct cfs_hash *hs) return; spin_lock(&hs->hs_dep_lock); - while (hs->hs_dep_bits != 0) { + while (hs->hs_dep_bits) { spin_unlock(&hs->hs_dep_lock); cond_resched(); spin_lock(&hs->hs_dep_lock); @@ -1010,16 +1010,16 @@ struct cfs_hash * LASSERT(ops->hs_get); LASSERT(ops->hs_put_locked); - if ((flags & CFS_HASH_REHASH) != 0) + if (flags & CFS_HASH_REHASH) flags |= CFS_HASH_COUNTER; /* must have counter */ LASSERT(cur_bits > 0); LASSERT(cur_bits >= bkt_bits); LASSERT(max_bits >= cur_bits && max_bits < 31); LASSERT(ergo((flags & CFS_HASH_REHASH) == 0, cur_bits == max_bits)); - LASSERT(ergo((flags & CFS_HASH_REHASH) != 0, + LASSERT(ergo(flags & CFS_HASH_REHASH, (flags & CFS_HASH_NO_LOCK) == 0)); - LASSERT(ergo((flags & CFS_HASH_REHASH_KEY) != 0, ops->hs_keycpy)); + LASSERT(ergo(flags & CFS_HASH_REHASH_KEY, ops->hs_keycpy));
[PATCH v2] staging: lustre: llog: fix wrong offset in llog_process_thread()
From: Mikhail Pershin - llh_cat_idx may become bigger than llog bitmap size in llog_cat_set_first_idx() function - it is wrong to use previous cur_offset as new buffer offset, new offset should be calculated from value returned by llog_next_block(). - optimize llog_skip_over() to find llog entry offset by index for llog with fixed-size records. Signed-off-by: Mikhail Pershin Signed-off-by: Bob Glossman Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6714 Reviewed-on: http://review.whamcloud.com/15316 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6163 Reviewed-on: http://review.whamcloud.com/18819 Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- ChangeLog: v1) Initial patch with umoddi issue v2) Included fix from patch LU-6163 that fixed umoddi problem drivers/staging/lustre/lustre/obdclass/llog.c | 81 ++--- 1 files changed, 58 insertions(+), 23 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 3bc1789..1d0c5a3 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -217,7 +217,7 @@ static int llog_process_thread(void *arg) struct llog_log_hdr *llh = loghandle->lgh_hdr; struct llog_process_cat_data*cd = lpi->lpi_catdata; char*buf; - __u64cur_offset; + u64 cur_offset, tmp_offset; __u64last_offset; int chunk_size; int rc = 0, index = 1, last_index; @@ -229,6 +229,8 @@ static int llog_process_thread(void *arg) cur_offset = llh->llh_hdr.lrh_len; chunk_size = llh->llh_hdr.lrh_len; + /* expect chunk_size to be power of two */ + LASSERT(is_power_of_2(chunk_size)); buf = libcfs_kvzalloc(chunk_size, GFP_NOFS); if (!buf) { @@ -245,38 +247,50 @@ static int llog_process_thread(void *arg) else last_index = LLOG_HDR_BITMAP_SIZE(llh) - 1; - /* Record is not in this buffer. */ - if (index > last_index) - goto out; - while (rc == 0) { + unsigned int buf_offset = 0; struct llog_rec_hdr *rec; + bool partial_chunk; + off_t chunk_offset; /* skip records not set in bitmap */ while (index <= last_index && !ext2_test_bit(index, LLOG_HDR_BITMAP(llh))) ++index; - LASSERT(index <= last_index + 1); - if (index == last_index + 1) + if (index > last_index) break; -repeat: + CDEBUG(D_OTHER, "index: %d last_index %d\n", index, last_index); - +repeat: /* get the buf with our target record; avoid old garbage */ memset(buf, 0, chunk_size); - last_offset = cur_offset; rc = llog_next_block(lpi->lpi_env, loghandle, &saved_index, index, &cur_offset, buf, chunk_size); if (rc) goto out; + /* +* NB: after llog_next_block() call the cur_offset is the +* offset of the next block after read one. +* The absolute offset of the current chunk is calculated +* from cur_offset value and stored in chunk_offset variable. +*/ + tmp_offset = cur_offset; + if (do_div(tmp_offset, chunk_size)) { + partial_chunk = true; + chunk_offset = cur_offset & ~(chunk_size - 1); + } else { + partial_chunk = false; + chunk_offset = cur_offset - chunk_size; + } + /* NB: when rec->lrh_len is accessed it is already swabbed * since it is used at the "end" of the loop and the rec * swabbing is done at the beginning of the loop. */ - for (rec = (struct llog_rec_hdr *)buf; + for (rec = (struct llog_rec_hdr *)(buf + buf_offset); (char *)rec < buf + chunk_size; rec = llog_rec_hdr_next(rec)) { CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n", @@ -288,13 +302,28 @@ static int llog_process_thread(void *arg) CDEBUG(D_OTHER, "after swabbing, type=%#x idx=%d\n", rec->lrh_type, rec->lrh_index); - if (rec->lrh_index == 0) { - /* probably another rec just got added? */ - rc = 0; - if (in
Re: [PATCH v2] staging: lustre: llog: fix wrong offset in llog_process_thread()
Hi Mikhail, [auto build test WARNING on staging/staging-testing] [also build test WARNING on next-20161117] [cannot apply to v4.9-rc5] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/James-Simmons/staging-lustre-llog-fix-wrong-offset-in-llog_process_thread/20161118-042856 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/staging/lustre/lustre/obdclass/llog.c: In function 'llog_process_thread': >> drivers/staging/lustre/lustre/obdclass/llog.c:221:12: warning: unused >> variable 'last_offset' [-Wunused-variable] __u64 last_offset; ^~~ vim +/last_offset +221 drivers/staging/lustre/lustre/obdclass/llog.c d7e09d039 Peng Tao 2013-05-02 205if (rc) { 11c647caf Andreas Dilger 2016-10-27 206kvfree(llh); d7e09d039 Peng Tao 2013-05-02 207handle->lgh_hdr = NULL; d7e09d039 Peng Tao 2013-05-02 208} 0a3bdb007 Greg Kroah-Hartman 2013-08-03 209return rc; d7e09d039 Peng Tao 2013-05-02 210 } d7e09d039 Peng Tao 2013-05-02 211 EXPORT_SYMBOL(llog_init_handle); d7e09d039 Peng Tao 2013-05-02 212 d7e09d039 Peng Tao 2013-05-02 213 static int llog_process_thread(void *arg) d7e09d039 Peng Tao 2013-05-02 214 { d7e09d039 Peng Tao 2013-05-02 215struct llog_process_info *lpi = arg; d7e09d039 Peng Tao 2013-05-02 216struct llog_handle *loghandle = lpi->lpi_loghandle; d7e09d039 Peng Tao 2013-05-02 217struct llog_log_hdr *llh = loghandle->lgh_hdr; d7e09d039 Peng Tao 2013-05-02 218struct llog_process_cat_data *cd = lpi->lpi_catdata; d7e09d039 Peng Tao 2013-05-02 219char *buf; ede733b28 Mikhail Pershin2016-11-17 220u64 cur_offset, tmp_offset; d7e09d039 Peng Tao 2013-05-02 @221__u64 last_offset; 11c647caf Andreas Dilger 2016-10-27 222int chunk_size; d7e09d039 Peng Tao 2013-05-02 223int rc = 0, index = 1, last_index; d7e09d039 Peng Tao 2013-05-02 224int saved_index = 0; d7e09d039 Peng Tao 2013-05-02 225int last_called_index = 0; d7e09d039 Peng Tao 2013-05-02 226 11c647caf Andreas Dilger 2016-10-27 227if (!llh) 11c647caf Andreas Dilger 2016-10-27 228return -EINVAL; 11c647caf Andreas Dilger 2016-10-27 229 :: The code at line 221 was first introduced by commit :: d7e09d0397e84eefbabfd9cb353221f3c6448d83 staging: add Lustre file system client support :: TO: Peng Tao :: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: lustre: llog: fix wrong offset in llog_process_thread()
From: Mikhail Pershin - llh_cat_idx may become bigger than llog bitmap size in llog_cat_set_first_idx() function - it is wrong to use previous cur_offset as new buffer offset, new offset should be calculated from value returned by llog_next_block(). - optimize llog_skip_over() to find llog entry offset by index for llog with fixed-size records. Signed-off-by: Mikhail Pershin Signed-off-by: Bob Glossman Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6714 Reviewed-on: http://review.whamcloud.com/15316 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6163 Reviewed-on: http://review.whamcloud.com/18819 Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- ChangeLog: v1) Initial patch with umoddi issue v2) Included fix from patch LU-6163 that fixed umoddi problem v3) Remove no longer needed last_offset variable drivers/staging/lustre/lustre/obdclass/llog.c | 82 +--- include/linux/fs.h|2 +- 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 3bc1789..ae63047 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -217,8 +217,7 @@ static int llog_process_thread(void *arg) struct llog_log_hdr *llh = loghandle->lgh_hdr; struct llog_process_cat_data*cd = lpi->lpi_catdata; char*buf; - __u64cur_offset; - __u64last_offset; + u64 cur_offset, tmp_offset; int chunk_size; int rc = 0, index = 1, last_index; int saved_index = 0; @@ -229,6 +228,8 @@ static int llog_process_thread(void *arg) cur_offset = llh->llh_hdr.lrh_len; chunk_size = llh->llh_hdr.lrh_len; + /* expect chunk_size to be power of two */ + LASSERT(is_power_of_2(chunk_size)); buf = libcfs_kvzalloc(chunk_size, GFP_NOFS); if (!buf) { @@ -245,38 +246,50 @@ static int llog_process_thread(void *arg) else last_index = LLOG_HDR_BITMAP_SIZE(llh) - 1; - /* Record is not in this buffer. */ - if (index > last_index) - goto out; - while (rc == 0) { + unsigned int buf_offset = 0; struct llog_rec_hdr *rec; + bool partial_chunk; + off_t chunk_offset; /* skip records not set in bitmap */ while (index <= last_index && !ext2_test_bit(index, LLOG_HDR_BITMAP(llh))) ++index; - LASSERT(index <= last_index + 1); - if (index == last_index + 1) + if (index > last_index) break; -repeat: + CDEBUG(D_OTHER, "index: %d last_index %d\n", index, last_index); - +repeat: /* get the buf with our target record; avoid old garbage */ memset(buf, 0, chunk_size); - last_offset = cur_offset; rc = llog_next_block(lpi->lpi_env, loghandle, &saved_index, index, &cur_offset, buf, chunk_size); if (rc) goto out; + /* +* NB: after llog_next_block() call the cur_offset is the +* offset of the next block after read one. +* The absolute offset of the current chunk is calculated +* from cur_offset value and stored in chunk_offset variable. +*/ + tmp_offset = cur_offset; + if (do_div(tmp_offset, chunk_size)) { + partial_chunk = true; + chunk_offset = cur_offset & ~(chunk_size - 1); + } else { + partial_chunk = false; + chunk_offset = cur_offset - chunk_size; + } + /* NB: when rec->lrh_len is accessed it is already swabbed * since it is used at the "end" of the loop and the rec * swabbing is done at the beginning of the loop. */ - for (rec = (struct llog_rec_hdr *)buf; + for (rec = (struct llog_rec_hdr *)(buf + buf_offset); (char *)rec < buf + chunk_size; rec = llog_rec_hdr_next(rec)) { CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n", @@ -288,13 +301,28 @@ static int llog_process_thread(void *arg) CDEBUG(D_OTHER, "after swabbing, type=%#x idx=%d\n", rec->lrh_type, rec->lrh_index); - if (rec->lrh_index == 0) { -
[PATCH v2 0/7] staging: xgifb: vb_setmode.c checkpatch modifications
Make Linux kernel coding style modifications for vb_setmode.c to include: CHECK: spaces preferred around that CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast WARNING: braces {} are not necessary for single statement blocks CHECK: Logical continuations should be on the previous line Spelling Comment style modifications Walt Feasel (7): staging: xgifb: vb_setmode.c Comment Spelling correction staging: xgifb: vb_setmode.c Comment style modifications staging: xgifb: vb_setmode.c Space around operator staging: xgifb: vb_setmode.c Braces single statement blocks staging: xgifb: vb_setmode.c Space after cast staging: xgifb: vb_setmode.c Logical continuation staging: xgifb: vb_setmode.c Align match parenthesis drivers/staging/xgifb/vb_setmode.c | 642 ++--- 1 file changed, 311 insertions(+), 331 deletions(-) -- v2 makes changes to correct for email format patch submission 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/7] staging: xgifb: vb_setmode.c Comment Spelling correction
Make spelling correction for 'vertical'. Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 6467d96..1655d3a 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -3061,7 +3061,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = pVBInfo->VGAVT; push1 = tempbx; tempcx = 0x121; - tempbx = pVBInfo->VGAVDE; /* 0x0E Virtical Display End */ + tempbx = pVBInfo->VGAVDE; /* 0x0E Vertical Display End */ if (tempbx == 357) tempbx = 350; @@ -3113,7 +3113,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, if (tempbx & 0x0400) tempcx |= 0x0600; - /* 0x11 Vertival Blank End */ + /* 0x11 Vertical Blank End */ xgifb_reg_set(pVBInfo->Part1Port, 0x11, 0x00); tempax = push1; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/7] staging: xgifb: vb_setmode.c Space around operator
Make suggested checkpatch modificationfor CHECK: spaces preferred around that '+' Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 7383100..480d94a 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -73,7 +73,7 @@ static void XGI_SetSeqRegs(struct vb_device_info *pVBInfo) /* Get SR1,2,3,4 from file */ /* SR1 is with screen off 0x20 */ SRdata = XGI330_StandTable.SR[i]; - xgifb_reg_set(pVBInfo->P3c4, i+1, SRdata); /* Set SR 1 2 3 4 */ + xgifb_reg_set(pVBInfo->P3c4, i + 1, SRdata); /* Set SR 1 2 3 4 */ } } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/7] staging: xgifb: vb_setmode.c Braces single statement blocks
Make suggested checkpatch modificationfor WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 480d94a..9c26f0a 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -1681,13 +1681,11 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, return tempal; } - if (pVBInfo->TVInfo & TVSetYPbPr750p) { + if (pVBInfo->TVInfo & TVSetYPbPr750p) return XGI_YPbPr750pVCLK; - } - if (pVBInfo->TVInfo & TVSetYPbPr525p) { + if (pVBInfo->TVInfo & TVSetYPbPr525p) return YPbPr525pVCLK; - } tempal = NTSC1024VCLK; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/7] staging: xgifb: vb_setmode.c Space after cast
Make suggested checkpatch modification for CHECK: No space is necessary after a cast Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 139 ++--- 1 file changed, 69 insertions(+), 70 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 9c26f0a..2d430c3 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -796,7 +796,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo, i |= temp; xgifb_reg_set(pVBInfo->P3c4, 0x0E, i); - temp = (unsigned char) temp2; + temp = (unsigned char)temp2; temp &= 0xFF; /* al */ xgifb_reg_set(pVBInfo->P3d4, 0x13, temp); @@ -1087,9 +1087,9 @@ static void XGI_WriteDAC(unsigned short dl, else swap(bl, bh); } - outb((unsigned short) dh, pVBInfo->P3c9); - outb((unsigned short) bh, pVBInfo->P3c9); - outb((unsigned short) bl, pVBInfo->P3c9); + outb((unsigned short)dh, pVBInfo->P3c9); + outb((unsigned short)bh, pVBInfo->P3c9); + outb((unsigned short)bl, pVBInfo->P3c9); } static void XGI_LoadDAC(struct vb_device_info *pVBInfo) @@ -1441,9 +1441,9 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, tempbx >>= 3; xgifb_reg_set(pVBInfo->Part1Port, 0x16, - (unsigned short) (tempbx & 0xff)); + (unsigned short)(tempbx & 0xff)); xgifb_reg_set(pVBInfo->Part1Port, 0x17, - (unsigned short) (tempcx & 0xff)); + (unsigned short)(tempcx & 0xff)); tempax = pVBInfo->HT; @@ -1469,7 +1469,7 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax); xgifb_reg_set(pVBInfo->Part1Port, 0x14, - (unsigned short) (tempbx & 0xff)); + (unsigned short)(tempbx & 0xff)); tempax = pVBInfo->VT; tempbx = LCDPtr1->LCDVDES; @@ -1481,15 +1481,15 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, tempcx -= tempax; xgifb_reg_set(pVBInfo->Part1Port, 0x1b, - (unsigned short) (tempbx & 0xff)); + (unsigned short)(tempbx & 0xff)); xgifb_reg_set(pVBInfo->Part1Port, 0x1c, - (unsigned short) (tempcx & 0xff)); + (unsigned short)(tempcx & 0xff)); tempbx = (tempbx >> 8) & 0x07; tempcx = (tempcx >> 8) & 0x07; xgifb_reg_set(pVBInfo->Part1Port, 0x1d, - (unsigned short) ((tempcx << 3) + (unsigned short)((tempcx << 3) | tempbx)); tempax = pVBInfo->VT; @@ -1505,9 +1505,9 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, tempcx -= tempax; xgifb_reg_set(pVBInfo->Part1Port, 0x18, - (unsigned short) (tempbx & 0xff)); + (unsigned short)(tempbx & 0xff)); xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f, - (unsigned short) (tempcx & 0x0f)); + (unsigned short)(tempcx & 0x0f)); tempax = ((tempbx >> 8) & 0x07) << 3; @@ -1527,7 +1527,7 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, temp = tempax; /* 0430 ylshieh */ temp1 = (temp << 18) / tempbx; - tempdx = (unsigned short) ((temp << 18) % tempbx); + tempdx = (unsigned short)((temp << 18) % tempbx); if (tempdx != 0) temp1 += 1; @@ -1536,11 +1536,11 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, push3 = temp2; xgifb_reg_set(pVBInfo->Part1Port, 0x37, - (unsigned short) (temp2 & 0xff)); + (unsigned short)(temp2 & 0xff)); xgifb_reg_set(pVBInfo->Part1Port, 0x36, - (unsigned short) ((temp2 >> 8) & 0xff)); + (unsigned short)((temp2 >> 8) & 0xff)); - tempbx = (unsigned short) (temp2 >> 16); + tempbx = (unsigned short)(temp2 >> 16); tempax = tempbx & 0x03; tempbx = pVBInfo->VGAVDE; @@ -1553,15 +1553,15 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, temp2 = push3; xgifb_reg_set(pVBInfo->Part4Port, 0x3c, - (unsigned short) (temp2 & 0xff)); + (unsigned short)(temp2 & 0xff)); xgifb_reg_set(pVBInfo->Part4Port, 0x3b, - (unsigned short) ((temp2 >> 8) & + (unsigned short)((temp2 >> 8) & 0xff)); - tempbx = (unsigned short) (temp2 >> 16); +
[PATCH v2 6/7] staging: xgifb: vb_setmode.c Logical continuation
Make suggested checkpatch modification for CHECK: Logical continuations should be on the previous line Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 2d430c3..61ab40b 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -4993,8 +4993,8 @@ static void XGI_SetCRT2ModeRegs(struct vb_device_info *pVBInfo) tempah |= 0x40; } - if ((pVBInfo->LCDResInfo == Panel_1280x1024) - || (pVBInfo->LCDResInfo == Panel_1280x1024x75)) + if ((pVBInfo->LCDResInfo == Panel_1280x1024) || + (pVBInfo->LCDResInfo == Panel_1280x1024x75)) tempah |= 0x80; if (pVBInfo->LCDResInfo == Panel_1280x960) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/7] staging: xgifb: vb_setmode.c Comment style modifications
Make comment style modifications. Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 234 ++--- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 1655d3a..7383100 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -55,7 +55,7 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) pVBInfo->XGINew_CR97 = 0xc1; pVBInfo->SR18 = XG27_SR18; - /*Z11m DDR*/ + /* Z11m DDR */ temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B); /* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */ if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08)) @@ -390,12 +390,12 @@ static void XGI_SetCRT1CRTC(unsigned short ModeIdIndex, xgifb_reg_set(pVBInfo->P3d4, 0x14, 0x4F); } -/* - */ -/* Function : XGI_SetXG21CRTC */ -/* Input : Stand or enhance CRTC table */ -/* Output : Fill CRT Hsync/Vsync to SR2E/SR2F/SR30/SR33/SR34/SR3F */ -/* Description : Set LCD timing */ -/* - */ +/* + * Function : XGI_SetXG21CRTC + * Input : Stand or enhance CRTC table + * Output : Fill CRT Hsync/Vsync to SR2E/SR2F/SR30/SR33/SR34/SR3F + * Description : Set LCD timing + */ static void XGI_SetXG21CRTC(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { @@ -506,7 +506,7 @@ static void XGI_SetXG27CRTC(unsigned short RefreshRateTableIndex, /* SR0B */ Tempax = XGI_CRT1Table[index].CR[5]; - Tempax &= 0xC0; /* Tempax[7:6]: SR0B[7:6]: HRS[9:8]*/ + Tempax &= 0xC0; /* Tempax[7:6]: SR0B[7:6]: HRS[9:8] */ Tempbx |= Tempax << 2; /* Tempbx: HRS[9:0] */ Tempax = XGI_CRT1Table[index].CR[4]; /* CR5 HRE */ @@ -636,12 +636,12 @@ static void xgifb_set_lcd(int chip_id, xgifb_reg_or(pVBInfo->P3c4, 0x35, 0x80); } -/* - */ -/* Function : XGI_UpdateXG21CRTC */ -/* Input : */ -/* Output : CRT1 CRTC */ -/* Description : Modify CRT1 Hsync/Vsync to fix LCD mode timing */ -/* - */ +/* + * Function : XGI_UpdateXG21CRTC + * Input : + * Output : CRT1 CRTC + * Description : Modify CRT1 Hsync/Vsync to fix LCD mode timing + */ static void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex) @@ -830,7 +830,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeIdIndex, /* si+Ext_ResInfo */ modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; - if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /*301b*/ + if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /* 301b */ if (pVBInfo->LCDResInfo != Panel_1024x768) /* LCDXlat2VCLK */ VCLKIndex = VCLK108_2_315 + 5; @@ -1620,12 +1620,12 @@ static void XGI_SetLVDSRegs(unsigned short ModeIdIndex, (unsigned short) (temp3 & 0xff)); } -/* - */ -/* Function : XGI_GETLCDVCLKPtr */ -/* Input : */ -/* Output : al -> VCLK Index */ -/* Description : */ -/* - */ +/* + * Function : XGI_GETLCDVCLKPtr + * Input : + * Output : al -> VCLK Index + * Description : + */ static void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1, struct vb_device_info *pVBInfo) { @@ -2075,7 +2075,7 @@ static unsigned char XGI_GetLCDInfo(unsigned short ModeIdIndex, pVBInfo->LCDTypeInfo = 0; pVBInfo->LCDInfo = 0; - /* si+Ext_ResInfo // */ + /* si+Ext_ResInfo */ resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; temp = xgifb_reg_get(pVBInfo->P3d4, 0x36); /* Get LCD Res.Info */ tempbx = temp & 0x0F; @@ -2172,12 +2172,12 @@ static unsigned char XG21GPIODataTransfer(unsigned char ujDate) return ujRet; } -/**/ -/* output */ -/* bl[5] : LVDS signal */ -/* bl[1] : LVDS backlight */ -/* bl[0] : LVDS VDD */ -/**/ +/* + * output + * bl[5] : LVDS signal + * bl[
[PATCH v2 7/7] staging: xgifb: vb_setmode.c Align match parenthesis
Make suggested checkpatch modification for CHECK: Alignment should match open parenthesis Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_setmode.c | 299 + 1 file changed, 141 insertions(+), 158 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 61ab40b..7c7c8c8 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -167,7 +167,8 @@ static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo) } static unsigned char XGI_AjustCRT2Rate(unsigned short ModeIdIndex, - unsigned short RefreshRateTableIndex, unsigned short *i, + unsigned short RefreshRateTableIndex, + unsigned short *i, struct vb_device_info *pVBInfo) { unsigned short tempax, tempbx, resinfo, modeflag, infoflag; @@ -244,7 +245,7 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeIdIndex, } static void XGI_SetSync(unsigned short RefreshRateTableIndex, - struct vb_device_info *pVBInfo) + struct vb_device_info *pVBInfo) { unsigned short sync, temp; @@ -257,7 +258,7 @@ static void XGI_SetSync(unsigned short RefreshRateTableIndex, } static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, - struct xgi_hw_device_info *HwDeviceExtension) + struct xgi_hw_device_info *HwDeviceExtension) { unsigned char data, data1, pushax; unsigned short i, j; @@ -359,9 +360,9 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, } static void XGI_SetCRT1CRTC(unsigned short ModeIdIndex, - unsigned short RefreshRateTableIndex, - struct vb_device_info *pVBInfo, - struct xgi_hw_device_info *HwDeviceExtension) + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo, + struct xgi_hw_device_info *HwDeviceExtension) { unsigned char index, data; unsigned short i; @@ -397,7 +398,7 @@ static void XGI_SetCRT1CRTC(unsigned short ModeIdIndex, * Description : Set LCD timing */ static void XGI_SetXG21CRTC(unsigned short RefreshRateTableIndex, - struct vb_device_info *pVBInfo) + struct vb_device_info *pVBInfo) { unsigned char index, Tempax, Tempbx, Tempcx, Tempdx; unsigned short Temp1, Temp2, Temp3; @@ -665,19 +666,19 @@ static void XGI_UpdateXG21CRTC(unsigned short ModeNo, if (index != -1) { xgifb_reg_set(pVBInfo->P3d4, 0x02, - XGI_UpdateCRT1Table[index].CR02); + XGI_UpdateCRT1Table[index].CR02); xgifb_reg_set(pVBInfo->P3d4, 0x03, - XGI_UpdateCRT1Table[index].CR03); + XGI_UpdateCRT1Table[index].CR03); xgifb_reg_set(pVBInfo->P3d4, 0x15, - XGI_UpdateCRT1Table[index].CR15); + XGI_UpdateCRT1Table[index].CR15); xgifb_reg_set(pVBInfo->P3d4, 0x16, - XGI_UpdateCRT1Table[index].CR16); + XGI_UpdateCRT1Table[index].CR16); } } static void XGI_SetCRT1DE(unsigned short ModeIdIndex, - unsigned short RefreshRateTableIndex, - struct vb_device_info *pVBInfo) + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { unsigned short resindex, tempax, tempbx, tempcx, temp, modeflag; @@ -715,7 +716,7 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short)(tempcx & 0xff)); xgifb_reg_and_or(pVBInfo->P3d4, 0x0b, ~0x0c, - (unsigned short)((tempcx & 0x0ff00) >> 10)); +(unsigned short)((tempcx & 0x0ff00) >> 10)); xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short)(tempbx & 0xff)); tempax = 0; tempbx >>= 8; @@ -822,8 +823,8 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo, } static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeIdIndex, - unsigned short RefreshRateTableIndex, - struct vb_device_info *pVBInfo) + unsigned short RefreshRateTableIndex, + struct vb_device_info *pVBInfo) { unsigned short VCLKIndex, modeflag; @@ -951,8 +952,8 @@ static void XGI_SetCRT1FIFO(struct xgi_hw_device_info *HwDeviceExtension, } static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, -
[PATCH v2] staging: xgifb: vb_util.h Space after cast
Make suggested checkpatch modification for CHECK: No space is necessary after a cast Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/vb_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index 08db58b..052694e 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h @@ -18,7 +18,7 @@ static inline void xgifb_reg_and_or(unsigned long port, u8 index, u8 temp; temp = xgifb_reg_get(port, index); - temp = (u8) ((temp & data_and) | data_or); + temp = (u8)((temp & data_and) | data_or); xgifb_reg_set(port, index, temp); } @@ -28,7 +28,7 @@ static inline void xgifb_reg_and(unsigned long port, u8 index, u8 temp; temp = xgifb_reg_get(port, index); - temp = (u8) (temp & data_and); + temp = (u8)(temp & data_and); xgifb_reg_set(port, index, temp); } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: xgifb: XGI_main.h Align data columns
Make modifications to data column alignment Signed-off-by: Walt Feasel --- v2 makes changes to correct for email format patch submission drivers/staging/xgifb/XGI_main.h | 54 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h index 85079fe..7a80a90 100644 --- a/drivers/staging/xgifb/XGI_main.h +++ b/drivers/staging/xgifb/XGI_main.h @@ -139,7 +139,7 @@ static const struct _XGIbios_mode { static const unsigned short XGI310paneltype[] = { LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024, -LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, +LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960, LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200, LCD_1024x768, LCD_1024x768, LCD_1024x768}; @@ -174,7 +174,7 @@ static const struct _XGI_tvtype { {"NTSC",2}, {"pal", 1}, {"ntsc",2}, - {"\0", -1} + {"\0", -1} }; static const struct _XGI_vrate { @@ -183,44 +183,44 @@ static const struct _XGI_vrate { u16 yres; u16 refresh; } XGIfb_vrate[] = { - {1, 640, 480, 60}, {2, 640, 480, 72}, - {3, 640, 480, 75}, {4, 640, 480, 85}, + {1, 640, 480, 60}, {2, 640, 480, 72}, + {3, 640, 480, 75}, {4, 640, 480, 85}, {5, 640, 480, 100}, {6, 640, 480, 120}, - {7, 640, 480, 160}, {8, 640, 480, 200}, + {7, 640, 480, 160}, {8, 640, 480, 200}, - {1, 720, 480, 60}, - {1, 720, 576, 58}, - {1, 800, 480, 60}, {2, 800, 480, 75}, {3, 800, 480, 85}, - {1, 800, 600, 60}, {2, 800, 600, 72}, {3, 800, 600, 75}, - {4, 800, 600, 85}, {5, 800, 600, 100}, - {6, 800, 600, 120}, {7, 800, 600, 160}, + {1, 720, 480, 60}, + {1, 720, 576, 58}, + {1, 800, 480, 60}, {2, 800, 480, 75}, {3, 800, 480, 85}, + {1, 800, 600, 60}, {2, 800, 600, 72}, {3, 800, 600, 75}, + {4, 800, 600, 85}, {5, 800, 600, 100}, + {6, 800, 600, 120}, {7, 800, 600, 160}, - {1, 1024, 768, 60}, {2, 1024, 768, 70}, {3, 1024, 768, 75}, - {4, 1024, 768, 85}, {5, 1024, 768, 100}, {6, 1024, 768, 120}, - {1, 1024, 576, 60}, {2, 1024, 576, 75}, {3, 1024, 576, 85}, - {1, 1024, 600, 60}, - {1, 1152, 768, 60}, - {1, 1280, 720, 60}, {2, 1280, 720, 75}, {3, 1280, 720, 85}, - {1, 1280, 768, 60}, + {1, 1024, 768, 60}, {2, 1024, 768, 70}, {3, 1024, 768, 75}, + {4, 1024, 768, 85}, {5, 1024, 768, 100}, {6, 1024, 768, 120}, + {1, 1024, 576, 60}, {2, 1024, 576, 75}, {3, 1024, 576, 85}, + {1, 1024, 600, 60}, + {1, 1152, 768, 60}, + {1, 1280, 720, 60}, {2, 1280, 720, 75}, {3, 1280, 720, 85}, + {1, 1280, 768, 60}, {1, 1280, 1024, 60}, {2, 1280, 1024, 75}, {3, 1280, 1024, 85}, - {1, 1280, 960, 70}, - {1, 1400, 1050, 60}, - {1, 1600, 1200, 60}, {2, 1600, 1200, 65}, + {1, 1280, 960, 70}, + {1, 1400, 1050, 60}, + {1, 1600, 1200, 60}, {2, 1600, 1200, 65}, {3, 1600, 1200, 70}, {4, 1600, 1200, 75}, - {5, 1600, 1200, 85}, {6, 1600, 1200, 100}, + {5, 1600, 1200, 85}, {6, 1600, 1200, 100}, {7, 1600, 1200, 120}, - {1, 1920, 1440, 60}, {2, 1920, 1440, 65}, + {1, 1920, 1440, 60}, {2, 1920, 1440, 65}, {3, 1920, 1440, 70}, {4, 1920, 1440, 75}, - {5, 1920, 1440, 85}, {6, 1920, 1440, 100}, - {1, 2048, 1536, 60}, {2, 2048, 1536, 65}, + {5, 1920, 1440, 85}, {6, 1920, 1440, 100}, + {1, 2048, 1536, 60}, {2, 2048, 1536, 65}, {3, 2048, 1536, 70}, {4, 2048, 1536, 75}, - {5, 2048, 1536, 85}, - {0, 0, 0, 0} + {5, 2048, 1536, 85}, + {0,0,0, 0} }; static const struct _XGI_TV_filter { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits
On Thu, Nov 17, 2016 at 12:46:12PM +0100, Sergio Paracuellos wrote: > On Thu, Nov 17, 2016 at 12:33 PM, Dan Carpenter > wrote: > > Give it a shot and see if the warnings go away. I don't think the tag > > is correct. > > Just removing __iomem tag in shmem_data field of slic_shmemory struct > makes sparse happy. No warnings around. > > Should I send a v4 patch with the tag removed? Yes, please fix up this series and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: lustre: llog: fix wrong offset in llog_process_thread()
On Thu, Nov 17, 2016 at 06:29:08PM -0500, James Simmons wrote: > From: Mikhail Pershin > > - llh_cat_idx may become bigger than llog bitmap size in > llog_cat_set_first_idx() function > - it is wrong to use previous cur_offset as new buffer offset, > new offset should be calculated from value returned by > llog_next_block(). > - optimize llog_skip_over() to find llog entry offset by index > for llog with fixed-size records. > > Signed-off-by: Mikhail Pershin > Signed-off-by: Bob Glossman > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6714 > Reviewed-on: http://review.whamcloud.com/15316 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6163 > Reviewed-on: http://review.whamcloud.com/18819 > Reviewed-by: John L. Hammond > Reviewed-by: James Simmons > Reviewed-by: Oleg Drokin > Signed-off-by: James Simmons > --- > > ChangeLog: > > v1) Initial patch with umoddi issue > v2) Included fix from patch LU-6163 that fixed umoddi problem > v3) Remove no longer needed last_offset variable > > drivers/staging/lustre/lustre/obdclass/llog.c | 82 +--- > include/linux/fs.h|2 +- > 2 files changed, 59 insertions(+), 25 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c > b/drivers/staging/lustre/lustre/obdclass/llog.c > index 3bc1789..ae63047 100644 > --- a/drivers/staging/lustre/lustre/obdclass/llog.c > +++ b/drivers/staging/lustre/lustre/obdclass/llog.c > @@ -217,8 +217,7 @@ static int llog_process_thread(void *arg) > struct llog_log_hdr *llh = loghandle->lgh_hdr; > struct llog_process_cat_data*cd = lpi->lpi_catdata; > char*buf; > - __u64cur_offset; > - __u64last_offset; > + u64 cur_offset, tmp_offset; > int chunk_size; > int rc = 0, index = 1, last_index; > int saved_index = 0; > @@ -229,6 +228,8 @@ static int llog_process_thread(void *arg) > > cur_offset = llh->llh_hdr.lrh_len; > chunk_size = llh->llh_hdr.lrh_len; > + /* expect chunk_size to be power of two */ > + LASSERT(is_power_of_2(chunk_size)); > > buf = libcfs_kvzalloc(chunk_size, GFP_NOFS); > if (!buf) { > @@ -245,38 +246,50 @@ static int llog_process_thread(void *arg) > else > last_index = LLOG_HDR_BITMAP_SIZE(llh) - 1; > > - /* Record is not in this buffer. */ > - if (index > last_index) > - goto out; > - > while (rc == 0) { > + unsigned int buf_offset = 0; > struct llog_rec_hdr *rec; > + bool partial_chunk; > + off_t chunk_offset; > > /* skip records not set in bitmap */ > while (index <= last_index && > !ext2_test_bit(index, LLOG_HDR_BITMAP(llh))) > ++index; > > - LASSERT(index <= last_index + 1); > - if (index == last_index + 1) > + if (index > last_index) > break; > -repeat: > + > CDEBUG(D_OTHER, "index: %d last_index %d\n", > index, last_index); > - > +repeat: > /* get the buf with our target record; avoid old garbage */ > memset(buf, 0, chunk_size); > - last_offset = cur_offset; > rc = llog_next_block(lpi->lpi_env, loghandle, &saved_index, >index, &cur_offset, buf, chunk_size); > if (rc) > goto out; > > + /* > + * NB: after llog_next_block() call the cur_offset is the > + * offset of the next block after read one. > + * The absolute offset of the current chunk is calculated > + * from cur_offset value and stored in chunk_offset variable. > + */ > + tmp_offset = cur_offset; > + if (do_div(tmp_offset, chunk_size)) { > + partial_chunk = true; > + chunk_offset = cur_offset & ~(chunk_size - 1); > + } else { > + partial_chunk = false; > + chunk_offset = cur_offset - chunk_size; > + } > + > /* NB: when rec->lrh_len is accessed it is already swabbed >* since it is used at the "end" of the loop and the rec >* swabbing is done at the beginning of the loop. >*/ > - for (rec = (struct llog_rec_hdr *)buf; > + for (rec = (struct llog_rec_hdr *)(buf + buf_offset); >(char *)rec < buf + chunk_size; >rec = llog_rec_hdr_next(rec)) { > CDEBUG(D_OTHER, "processing rec 0x%p type %#x\n", > @@ -288,13 +301,28 @@ static int llog_process_thread(void *arg) > CDEBUG(D_OTHER, "af