[PATCH RFC] staging: comedi: fix coding style issues
fix IF_0 and IF_1 warnings by checkpatch.pl Signed-off-by: Ayush --- compile tested only. drivers/staging/comedi/drivers/dt2801.c | 29 - 1 file changed, 29 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index 0d571d817b4e..bb01416084e4 100644 --- a/drivers/staging/comedi/drivers/dt2801.c +++ b/drivers/staging/comedi/drivers/dt2801.c @@ -87,17 +87,6 @@ #define DT2801_STATUS 1 #define DT2801_CMD 1 -#if 0 -/* ignore 'defined but not used' warning */ -static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = { - 4, { - BIP_RANGE(10), - BIP_RANGE(5), - BIP_RANGE(2.5), - BIP_RANGE(1.25) - } -}; -#endif static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { 4, { BIP_RANGE(10), @@ -107,17 +96,6 @@ static const struct comedi_lrange range_dt2801_ai_pgl_bipolar = { } }; -#if 0 -/* ignore 'defined but not used' warning */ -static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = { - 4, { - UNI_RANGE(10), - UNI_RANGE(5), - UNI_RANGE(2.5), - UNI_RANGE(1.25) - } -}; -#endif static const struct comedi_lrange range_dt2801_ai_pgl_unipolar = { 4, { UNI_RANGE(10), @@ -580,14 +558,7 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it) /* ai subdevice */ s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_GROUND; -#if 1 s->n_chan = n_ai_chans; -#else - if (it->options[2]) - s->n_chan = board->ad_chan; - else - s->n_chan = board->ad_chan / 2; -#endif s->maxdata = (1 << board->adbits) - 1; s->range_table = ai_range_lkup(board->adrangetype, it->options[3]); s->insn_read = dt2801_ai_insn_read; -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: fix pointer declaration style
Fix some pointer declarations where '*' is not adjacent to data name. This fixes checkpatch.pl error: "POINTER_LOCATION: "foo * bar" should be "foo *bar"" Signed-off-by: Ayush --- compile tested only. drivers/staging/rtl8723bs/include/hal_intf.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/hal_intf.h b/drivers/staging/rtl8723bs/include/hal_intf.h index 1de5acaef8ff..426c8d58c444 100644 --- a/drivers/staging/rtl8723bs/include/hal_intf.h +++ b/drivers/staging/rtl8723bs/include/hal_intf.h @@ -257,8 +257,8 @@ struct hal_ops { bool(*Efuse_PgPacketWrite_BT)(struct adapter *padapter, u8 offset, u8 word_en, u8 *data, bool bPseudoTest); s32 (*xmit_thread_handler)(struct adapter *padapter); - void (*hal_notch_filter)(struct adapter * adapter, bool enable); - void (*hal_reset_security_engine)(struct adapter * adapter); + void (*hal_notch_filter)(struct adapter *adapter, bool enable); + void (*hal_reset_security_engine)(struct adapter *adapter); s32 (*c2h_handler)(struct adapter *padapter, u8 *c2h_evt); c2h_id_filter c2h_id_filter_ccx; @@ -384,8 +384,8 @@ void rtw_hal_dm_watchdog_in_lps(struct adapter *padapter); s32 rtw_hal_xmit_thread_handler(struct adapter *padapter); -void rtw_hal_notch_filter(struct adapter * adapter, bool enable); -void rtw_hal_reset_security_engine(struct adapter * adapter); +void rtw_hal_notch_filter(struct adapter *adapter, bool enable); +void rtw_hal_reset_security_engine(struct adapter *adapter); bool rtw_hal_c2h_valid(struct adapter *adapter, u8 *buf); s32 rtw_hal_c2h_handler(struct adapter *adapter, u8 *c2h_evt); -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wimax: i2400m: fix some incorrect type warnings
Fix some "incorrect type in assignment" warnings reported by sparse in tx.c sparse warnings: wimax/i2400m/tx.c:788:35: warning: cast to restricted __le16 wimax/i2400m/tx.c:788:33: warning: incorrect type in assignment (different base types) wimax/i2400m/tx.c:788:33:expected restricted __le16 [usertype] num_pls wimax/i2400m/tx.c:788:33:got unsigned short [usertype] wimax/i2400m/tx.c:896:32: warning: cast to restricted __le32 wimax/i2400m/tx.c:896:30: warning: incorrect type in assignment (different base types) wimax/i2400m/tx.c:896:30:expected restricted __le32 [usertype] barker wimax/i2400m/tx.c:896:30:got unsigned int [usertype] wimax/i2400m/tx.c:897:34: warning: cast to restricted __le32 wimax/i2400m/tx.c:897:32: warning: incorrect type in assignment (different base types) wimax/i2400m/tx.c:897:32:expected restricted __le32 [usertype] sequence wimax/i2400m/tx.c:897:32:got unsigned int [usertype] wimax/i2400m/tx.c:899:15: warning: cast to restricted __le32 wimax/i2400m/tx.c:899:15: warning: cast from restricted __le16 Signed-off-by: Ayush --- compile tested on linux-next (tag: next-20210212). drivers/staging/wimax/i2400m/tx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wimax/i2400m/tx.c b/drivers/staging/wimax/i2400m/tx.c index e9436212fe54..8c01f42876ea 100644 --- a/drivers/staging/wimax/i2400m/tx.c +++ b/drivers/staging/wimax/i2400m/tx.c @@ -785,7 +785,7 @@ int i2400m_tx(struct i2400m *i2400m, const void *buf, size_t buf_len, d_printf(3, dev, "pld 0x%08x (type 0x%1x len 0x%04zx\n", le32_to_cpu(tx_msg->pld[num_pls].val), pl_type, buf_len); - tx_msg->num_pls = le16_to_cpu(num_pls+1); + tx_msg->num_pls = cpu_to_le16(num_pls + 1); tx_msg->size += padded_len; d_printf(2, dev, "TX: appended %zu b (up to %u b) pl #%u\n", padded_len, tx_msg->size, num_pls+1); @@ -893,10 +893,10 @@ struct i2400m_msg_hdr *i2400m_tx_msg_get(struct i2400m *i2400m, current->pid, (void *) tx_msg - i2400m->tx_buf, (size_t) tx_msg->offset, (size_t) tx_msg->size, (size_t) tx_msg_moved->size); - tx_msg_moved->barker = le32_to_cpu(I2400M_H2D_PREVIEW_BARKER); - tx_msg_moved->sequence = le32_to_cpu(i2400m->tx_sequence++); + tx_msg_moved->barker = cpu_to_le32(I2400M_H2D_PREVIEW_BARKER); + tx_msg_moved->sequence = cpu_to_le32(i2400m->tx_sequence++); - pls = le32_to_cpu(tx_msg_moved->num_pls); + pls = le16_to_cpu(tx_msg_moved->num_pls); i2400m->tx_pl_num += pls; /* Update stats */ if (pls > i2400m->tx_pl_max) i2400m->tx_pl_max = pls; -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: atomisp: fix coding style issues in timer.c
- Fix unneeded brace in if condition(also, brace was on next line). - Fix leading space warning before struct ia_css_clock_tick *curr_ts. compile tested only (on next-20210129) Signed-off-by: Ayush --- .../staging/media/atomisp/pci/runtime/timer/src/timer.c| 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c index 679ef8242574..7ca435180c5f 100644 --- a/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c +++ b/drivers/staging/media/atomisp/pci/runtime/timer/src/timer.c @@ -20,13 +20,12 @@ #include "assert_support.h" int -ia_css_timer_get_current_tick( -struct ia_css_clock_tick *curr_ts) { +ia_css_timer_get_current_tick(struct ia_css_clock_tick *curr_ts) +{ assert(curr_ts); if (!curr_ts) - { return -EINVAL; - } + curr_ts->ticks = (clock_value_t)gp_timer_read(GP_TIMER_SEL); return 0; } -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wimax/i2400m: fix coding style issues
- fix "multiple blank lines" issues. - fix a couple of parenthesis alignment issues. - fix no space before parenthesis issue. - fix no blank line after declaration. compile tested only (on next-20210202). Signed-off-by: Ayush --- drivers/staging/wimax/i2400m/debugfs.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wimax/i2400m/debugfs.c b/drivers/staging/wimax/i2400m/debugfs.c index 1c640b41ea4c..80a6f833d1c2 100644 --- a/drivers/staging/wimax/i2400m/debugfs.c +++ b/drivers/staging/wimax/i2400m/debugfs.c @@ -15,7 +15,6 @@ #include #include "i2400m.h" - #define D_SUBMODULE debugfs #include "debug-levels.h" @@ -27,8 +26,8 @@ int debugfs_netdev_queue_stopped_get(void *data, u64 *val) return 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_netdev_queue_stopped, - debugfs_netdev_queue_stopped_get, - NULL, "%llu\n"); +debugfs_netdev_queue_stopped_get, +NULL, "%llu\n"); /* * We don't allow partial reads of this file, as then the reader would @@ -59,7 +58,6 @@ ssize_t i2400m_rx_stats_read(struct file *filp, char __user *buffer, return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf)); } - /* Any write clears the stats */ static ssize_t i2400m_rx_stats_write(struct file *filp, const char __user *buffer, @@ -89,7 +87,6 @@ const struct file_operations i2400m_rx_stats_fops = { .llseek = default_llseek, }; - /* See i2400m_rx_stats_read() */ static ssize_t i2400m_tx_stats_read(struct file *filp, char __user *buffer, @@ -142,21 +139,21 @@ const struct file_operations i2400m_tx_stats_fops = { .llseek = default_llseek, }; - /* Write 1 to ask the device to go into suspend */ static int debugfs_i2400m_suspend_set(void *data, u64 val) { int result; struct i2400m *i2400m = data; + result = i2400m_cmd_enter_powersave(i2400m); if (result >= 0) result = 0; return result; } DEFINE_DEBUGFS_ATTRIBUTE(fops_i2400m_suspend, - NULL, debugfs_i2400m_suspend_set, - "%llu\n"); +NULL, debugfs_i2400m_suspend_set, +"%llu\n"); /* * Reset the device @@ -170,7 +167,8 @@ int debugfs_i2400m_reset_set(void *data, u64 val) int result; struct i2400m *i2400m = data; enum i2400m_reset_type rt = val; - switch(rt) { + + switch (rt) { case I2400M_RT_WARM: case I2400M_RT_COLD: case I2400M_RT_BUS: @@ -184,8 +182,8 @@ int debugfs_i2400m_reset_set(void *data, u64 val) return result; } DEFINE_DEBUGFS_ATTRIBUTE(fops_i2400m_reset, - NULL, debugfs_i2400m_reset_set, - "%llu\n"); +NULL, debugfs_i2400m_reset_set, +"%llu\n"); void i2400m_debugfs_add(struct i2400m *i2400m) { -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wimax/i2400m: fix coding style issues
> > - Your patch did many different things all at once, making it difficult > to review. All Linux kernel patches need to only do one thing at a > time. If you need to do multiple things (such as clean up all coding > style issues in a file/driver), do it in a sequence of patches, each > one doing only one thing. This will make it easier to review the > patches to ensure that they are correct, and to help alleviate any > merge issues that larger patches can cause. > Okay sir, I will break down the patch and send the patch series in v2. > - It looks like you did not use your "real" name for the patch on either > the Signed-off-by: line, or the From: line (both of which have to > match). Please read the kernel file, Documentation/SubmittingPatches > for how to do this correctly. > Actually my legal name is only "Ayush", I do not have a last name. I use my name as "Ayush Ayush" wherever I need last name. So for signing off commits, should I use "Ayush Ayush" or "Ayush" will also work? Regards, Ayush ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wimax/i2400m: fix coding style issues
> Do you really not have a last name, like Cher? Exactly, my legal name only has first name. > > We generally want people to send these as separate patches. > > But in this case, we're just going to delete the driver. Don't bother > sending cleanups for this because it will be deleted soon. > >> compile tested only (on next-20210202). > > Don't put this in the commit message. Put it under the --- cut off line > if you want. > Noted. Regards, Ayush ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel