[PATCH 0/4] Detect and remove trace_printk
trace_printk is meant as a debugging tool, and should not be compiled into production code without specific debug Kconfig options enabled or source code changes. Patches 1 to 3 remove/disable trace_printk that should not be enabled by default. Patch 4 adds a config option that can be used to detect such trace_printk at compile time (instead of printing a nasty warning at runtime). Nicolas Boichat (4): usb: cdns3: gadget: Replace trace_printk by dev_dbg media: atomisp: Replace trace_printk by pr_info media: camss: vfe: Use trace_printk for debugging only kernel/trace: Add TRACING_ALLOW_PRINTK config option drivers/gpu/drm/i915/Kconfig.debug | 4 ++-- .../media/platform/qcom/camss/camss-vfe-4-1.c | 2 ++ .../media/platform/qcom/camss/camss-vfe-4-7.c | 2 ++ drivers/staging/media/atomisp/pci/hmm/hmm.c | 10 +- drivers/usb/cdns3/gadget.c | 2 +- fs/f2fs/Kconfig | 1 + include/linux/kernel.h | 17 - kernel/trace/Kconfig| 10 ++ samples/Kconfig | 2 ++ 9 files changed, 41 insertions(+), 9 deletions(-) -- 2.27.0.212.ge8ba1cc988-goog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/4] kernel/trace: Add TRACING_ALLOW_PRINTK config option
trace_printk is meant as a debugging tool, and should not be compiled into production code without specific debug Kconfig options enabled, or source code changes, as indicated by the warning that shows up on boot if any trace_printk is called: ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** ** ** ** trace_printk() being used. Allocating extra memory. ** ** ** ** This means that this is a DEBUG kernel and it is ** ** unsafe for production use. ** If this option is set to n, the kernel will generate a build-time error if trace_printk is used. Note that the code to handle trace_printk is still present, so this does not prevent people from compiling out-of-tree kernel modules with the option set to =y, or BPF programs. Signed-off-by: Nicolas Boichat --- Changes since v1: - Use static_assert instead of __static_assert (Jason Gunthorpe) - Fix issues that can be detected by this patch (running some randconfig in a loop, kernel test robot, or manual inspection), by: - Making some debug config options that use trace_printk depend on the new config option. - Adding 3 patches before this one. There is a question from Alexei whether the warning is warranted, and it's possibly too strongly worded, but the fact is, we do not want trace_printk to be sprinkled in kernel code by default, unless a very specific Kconfig command is enabled (or preprocessor macro). There's at least 3 reasons that I can come up with: 1. trace_printk introduces some overhead. 2. If the kernel keeps adding always-enabled trace_printk, it will be much harder for developers to make use of trace_printk for debugging. 3. People may assume that trace_printk is for debugging only, and may accidentally output sensitive data (theoritical at this stage). drivers/gpu/drm/i915/Kconfig.debug | 4 ++-- fs/f2fs/Kconfig| 1 + include/linux/kernel.h | 17 - kernel/trace/Kconfig | 10 ++ samples/Kconfig| 2 ++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug index 1cb28c20807c59d..fa30f9bdc82311f 100644 --- a/drivers/gpu/drm/i915/Kconfig.debug +++ b/drivers/gpu/drm/i915/Kconfig.debug @@ -84,7 +84,7 @@ config DRM_I915_ERRLOG_GEM config DRM_I915_TRACE_GEM bool "Insert extra ftrace output from the GEM internals" depends on DRM_I915_DEBUG_GEM - select TRACING + depends on TRACING_ALLOW_PRINTK default n help Enable additional and verbose debugging output that will spam @@ -98,7 +98,7 @@ config DRM_I915_TRACE_GEM config DRM_I915_TRACE_GTT bool "Insert extra ftrace output from the GTT internals" depends on DRM_I915_DEBUG_GEM - select TRACING + depends on TRACING_ALLOW_PRINTK default n help Enable additional and verbose debugging output that will spam diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index d13c5c6a978769b..d161d96cc1b7418 100644 --- a/fs/f2fs/Kconfig +++ b/fs/f2fs/Kconfig @@ -80,6 +80,7 @@ config F2FS_IO_TRACE bool "F2FS IO tracer" depends on F2FS_FS depends on FUNCTION_TRACER + depends on TRACING_ALLOW_PRINTK help F2FS IO trace is based on a function trace, which gathers process information and block IO patterns in the filesystem level. diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 196607aaf653082..8abce95b0c95a0e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -721,10 +721,15 @@ do { \ #define trace_printk(fmt, ...) \ do { \ char ___STR[] = __stringify((__VA_ARGS__)); \ + \ + static_assert( \ + IS_ENABLED(CONFIG_TRACING_ALLOW_PRINTK),\ + "trace_printk called, please enable CONFIG_TRACING_ALLOW_PRINTK."); \ + \ if (sizeof(___STR) > 3) \ do_trace_printk(fmt, ##__VA_ARGS__);\ else\ - trace_puts(fmt);\ + do_trace_puts(fmt); \ } while (0) #define do_trace_printk(fmt, args...) \ @@ -773,6 +778,13 @@ int __trace_printk(unsigned long ip, const char *fmt, ...); */ #define trace_puts(str) ({ \ + static_assert( \ + IS_ENABLED(CONFIG_
[PATCH 2/4] media: atomisp: Replace trace_printk by pr_info
trace_printk should not be used in production code, replace it call with pr_info. Signed-off-by: Nicolas Boichat --- drivers/staging/media/atomisp/pci/hmm/hmm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c index 42fef17798622f1..2bd39b4939f16d2 100644 --- a/drivers/staging/media/atomisp/pci/hmm/hmm.c +++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c @@ -735,11 +735,11 @@ ia_css_ptr hmm_host_vaddr_to_hrt_vaddr(const void *ptr) void hmm_show_mem_stat(const char *func, const int line) { - trace_printk("tol_cnt=%d usr_size=%d res_size=%d res_cnt=%d sys_size=%d dyc_thr=%d dyc_size=%d.\n", -hmm_mem_stat.tol_cnt, -hmm_mem_stat.usr_size, hmm_mem_stat.res_size, -hmm_mem_stat.res_cnt, hmm_mem_stat.sys_size, -hmm_mem_stat.dyc_thr, hmm_mem_stat.dyc_size); + pr_info("tol_cnt=%d usr_size=%d res_size=%d res_cnt=%d sys_size=%d dyc_thr=%d dyc_size=%d.\n", + hmm_mem_stat.tol_cnt, + hmm_mem_stat.usr_size, hmm_mem_stat.res_size, + hmm_mem_stat.res_cnt, hmm_mem_stat.sys_size, + hmm_mem_stat.dyc_thr, hmm_mem_stat.dyc_size); } void hmm_init_mem_stat(int res_pgnr, int dyc_en, int dyc_pgnr) -- 2.27.0.212.ge8ba1cc988-goog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] media: camss: vfe: Use trace_printk for debugging only
trace_printk should not be used in production code. Since tracing interrupts is presumably latency sensitive, pr_dbg is not appropriate, so guard the call with a preprocessor symbol that can be defined for debugging purpose. Signed-off-by: Nicolas Boichat --- drivers/media/platform/qcom/camss/camss-vfe-4-1.c | 2 ++ drivers/media/platform/qcom/camss/camss-vfe-4-7.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c index 174a36be6f5d866..0c57171fae4f9e9 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c @@ -936,8 +936,10 @@ static irqreturn_t vfe_isr(int irq, void *dev) vfe->ops->isr_read(vfe, &value0, &value1); +#ifdef CAMSS_VFE_TRACE_IRQ trace_printk("VFE: status0 = 0x%08x, status1 = 0x%08x\n", value0, value1); +#endif if (value0 & VFE_0_IRQ_STATUS_0_RESET_ACK) vfe->isr_ops.reset_ack(vfe); diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-7.c b/drivers/media/platform/qcom/camss/camss-vfe-4-7.c index 0dca8bf9281e774..307675925e5c779 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-4-7.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-4-7.c @@ -1058,8 +1058,10 @@ static irqreturn_t vfe_isr(int irq, void *dev) vfe->ops->isr_read(vfe, &value0, &value1); +#ifdef CAMSS_VFE_TRACE_IRQ trace_printk("VFE: status0 = 0x%08x, status1 = 0x%08x\n", value0, value1); +#endif if (value0 & VFE_0_IRQ_STATUS_0_RESET_ACK) vfe->isr_ops.reset_ack(vfe); -- 2.27.0.212.ge8ba1cc988-goog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] qlge.h: Adding the missing blank line after declarations
On Sat, Jun 27, 2020 at 02:07:58AM -0400, B K Karthik wrote: > Signed-off-by: B K Karthik > --- > drivers/staging/qlge/qlge.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/staging/qlge/qlge.h b/drivers/staging/qlge/qlge.h > index fc8c5ca8935d..0b971a633001 100644 > --- a/drivers/staging/qlge/qlge.h > +++ b/drivers/staging/qlge/qlge.h > @@ -2224,6 +2224,7 @@ static inline void ql_write_db_reg_relaxed(u32 val, > void __iomem *addr) > static inline u32 ql_read_sh_reg(__le32 *addr) > { > u32 reg; > + > reg = le32_to_cpu(*addr); > rmb(); > return reg; > -- > 2.20.1 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change. - You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] usb: cdns3: gadget: Replace trace_printk by dev_dbg
trace_printk should not be used in production code, replace it call with dev_dbg. Signed-off-by: Nicolas Boichat --- Unclear why a trace_printk was used in the first place, it's possible that some rate-limiting is necessary here. drivers/usb/cdns3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 5e24c2e57c0d8c8..c303ab7c62d1651 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -421,7 +421,7 @@ static int cdns3_start_all_request(struct cdns3_device *priv_dev, if ((priv_req->flags & REQUEST_INTERNAL) || (priv_ep->flags & EP_TDLCHK_EN) || priv_ep->use_streams) { - trace_printk("Blocking external request\n"); + dev_dbg(priv_dev->dev, "Blocking external request\n"); return ret; } } -- 2.27.0.212.ge8ba1cc988-goog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] fbtft-bus.c:
Hi K, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] [also build test ERROR on v5.8-rc2 next-20200626] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/B-K-Karthik/fbtft-bus-c/20200627-125213 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 92cd1b5d65f5c67147c7da39a3c2ad7e6ff81027 config: m68k-randconfig-r016-20200624 (attached as .config) compiler: m68k-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from include/linux/build_bug.h:5, from include/linux/bits.h:23, from include/linux/gpio/consumer.h:5, from drivers/staging/fbtft/fbtft-bus.c:4: include/linux/scatterlist.h: In function 'sg_set_buf': arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra] 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory) | ^~ include/linux/compiler.h:78:42: note: in definition of macro 'unlikely' 78 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON' 143 | BUG_ON(!virt_addr_valid(buf)); | ^~ include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid' 143 | BUG_ON(!virt_addr_valid(buf)); | ^~~ drivers/staging/fbtft/fbtft-bus.c: At top level: >> drivers/staging/fbtft/fbtft-bus.c:65:53: error: macro >> "define_fbtft_write_reg" requires 4 arguments, but only 3 given 65 | define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) | ^ drivers/staging/fbtft/fbtft-bus.c:14: note: macro "define_fbtft_write_reg" defined here 14 | #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)\ | >> drivers/staging/fbtft/fbtft-bus.c:65:23: error: expected ';' before 'void' 65 | define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) | ^ | ; drivers/staging/fbtft/fbtft-bus.c:67:57: error: macro "define_fbtft_write_reg" requires 4 arguments, but only 3 given 67 | define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) | ^ drivers/staging/fbtft/fbtft-bus.c:14: note: macro "define_fbtft_write_reg" defined here 14 | #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)\ | drivers/staging/fbtft/fbtft-bus.c:67:23: error: expected ';' before 'void' 67 | define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) | ^ | ; 68 | 69 | void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) | vim +/define_fbtft_write_reg +65 drivers/staging/fbtft/fbtft-bus.c 64 > 65 define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) 66 define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) 67 define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) 68 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: RT_TRACE in drivers/staging/rtl8188eu
On Sat, Jun 27, 2020 at 12:33:56AM -0700, Joe Perches wrote: > There are 3 parts of the email. > > 1: A description and patch for a logging defect > 2: A script to go along with the patch to do conversions > 3: Current diff for this defect > > > - > > The macro below in drivers/staging/rtl8188eu/include/rtw_debug.h > is defective as it emits multiple pr_info calls for each use > so the logging in dmesg is discontinuous. I recommend just deleting it. As it's obviously incorrect, and any "real" tracing should just use the real tracing infrastructure, this is not needed and can be removed. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8712: rtl8712_recv.h: Removing unnecessary blank line
Removing unnecessary blank line Signed-off-by: B K Karthik --- drivers/staging/rtl8712/rtl8712_recv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.h b/drivers/staging/rtl8712/rtl8712_recv.h index 3e385b2242d8..69d3d5b287d3 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.h +++ b/drivers/staging/rtl8712/rtl8712_recv.h @@ -84,7 +84,6 @@ union recvstat { unsigned int value[RXDESC_SIZE>>2]; }; - struct recv_buf { struct list_head list; spinlock_t recvbuf_lock; -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: RT_TRACE in drivers/staging/rtl8188eu
On Sat, Jun 27, 2020 at 01:12:42AM -0700, Joe Perches wrote: > On Sat, 2020-06-27 at 10:01 +0200, Greg KH wrote: > > On Sat, Jun 27, 2020 at 12:33:56AM -0700, Joe Perches wrote: > > > There are 3 parts of the email. > > > > > > 1: A description and patch for a logging defect > > > 2: A script to go along with the patch to do conversions > > > 3: Current diff for this defect > > > > > > > > > - > > > > > > The macro below in drivers/staging/rtl8188eu/include/rtw_debug.h > > > is defective as it emits multiple pr_info calls for each use > > > so the logging in dmesg is discontinuous. > > > > I recommend just deleting it. As it's obviously incorrect, and any > > "real" tracing should just use the real tracing infrastructure, this is > > not needed and can be removed. > > Don't get hung up on the name. > > It's not used for tracing, it's effectively just > a debugging mechanism, the same in all the other > rtl staging drivers. Ok, then it should be converted to "normal" dev_*() functions, where needed, the others deleted entirely (the dev_info attempts...) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8712: rtl8712_recv.h: Removing unnecessary blank line
On Sat, Jun 27, 2020 at 04:03:56AM -0400, B K Karthik wrote: > Removing unnecessary blank line That says what you are doing, but not why you are doing it... Stop, take a day or so, relax, and come back after reading a bunch about how to write a good changelog text (link has been provided to you many times already). There's no rush here. Take the time to get it right so you don't waste other people's time. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: RT_TRACE in drivers/staging/rtl8188eu
On Sat, 2020-06-27 at 10:01 +0200, Greg KH wrote: > On Sat, Jun 27, 2020 at 12:33:56AM -0700, Joe Perches wrote: > > There are 3 parts of the email. > > > > 1: A description and patch for a logging defect > > 2: A script to go along with the patch to do conversions > > 3: Current diff for this defect > > > > > > - > > > > The macro below in drivers/staging/rtl8188eu/include/rtw_debug.h > > is defective as it emits multiple pr_info calls for each use > > so the logging in dmesg is discontinuous. > > I recommend just deleting it. As it's obviously incorrect, and any > "real" tracing should just use the real tracing infrastructure, this is > not needed and can be removed. Don't get hung up on the name. It's not used for tracing, it's effectively just a debugging mechanism, the same in all the other rtl staging drivers. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
On 27/06/2020 07:07, Greg Kroah-Hartman wrote: > > A: http://en.wikipedia.org/wiki/Top_post > Q: Were do I find info about this thing called top-posting? > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > A: No. > Q: Should I include quotations after my reply? > > http://daringfireball.net/2007/07/on_top > > On Fri, Jun 26, 2020 at 11:42:49AM -0400, B K KARTHIK PES2201800185STUDENT > ECE DeptPESU EC Campus wrote: >> Oh, I'm sorry but wouldn't it be helpful if we had a file that lists >> all drivers that are scheduled for removal? > > The TODO file in the directory for the driver should have this > information in it. I don't know if all of the media drivers have this, > if not, then there is no way you could have known this. They have, and in addition the Kconfig entry will mention that the driver is deprecated. TODO of usbvision: The driver is deprecated and scheduled for removal by the end of 2020. In order to prevent removal the following actions would have to be taken: - clean up the code - convert to the vb2 framework - fix the disconnect and free-on-last-user handling (i.e., add a release callback for struct v4l2_device and rework the code to use that correctly). Regards, Hans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] fbtft-bus.c:
Hi K, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] [also build test ERROR on v5.8-rc2 next-20200626] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/B-K-Karthik/fbtft-bus-c/20200627-125213 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 92cd1b5d65f5c67147c7da39a3c2ad7e6ff81027 config: i386-randconfig-a005-20200624 (attached as .config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): drivers/staging/fbtft/fbtft-bus.c:65:53: error: macro "define_fbtft_write_reg" requires 4 arguments, but only 3 given define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) ^ >> drivers/staging/fbtft/fbtft-bus.c:15:1: error: expected '=', ',', ';', 'asm' >> or '__attribute__' before 'void' void func(struct fbtft_par *par, int len, ...) \ ^ >> drivers/staging/fbtft/fbtft-bus.c:66:1: note: in expansion of macro >> 'define_fbtft_write_reg' define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) ^~ drivers/staging/fbtft/fbtft-bus.c:67:57: error: macro "define_fbtft_write_reg" requires 4 arguments, but only 3 given define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) ^ drivers/staging/fbtft/fbtft-bus.c:69:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void' void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) ^~~~ vim +15 drivers/staging/fbtft/fbtft-bus.c c296d5f9957c03 Thomas Petazzoni 2014-12-31 7 c296d5f9957c03 Thomas Petazzoni 2014-12-31 8 /* c296d5f9957c03 Thomas Petazzoni 2014-12-31 9 * c296d5f9957c03 Thomas Petazzoni 2014-12-31 10 * void (*write_reg)(struct fbtft_par *par, int len, ...); c296d5f9957c03 Thomas Petazzoni 2014-12-31 11 * c296d5f9957c03 Thomas Petazzoni 2014-12-31 12 */ c296d5f9957c03 Thomas Petazzoni 2014-12-31 13 8d8825b420ffb3 Alfonso Lima Astor 2017-10-17 14 #define define_fbtft_write_reg(func, buffer_type, data_type, modifier)\ c296d5f9957c03 Thomas Petazzoni 2014-12-31 @15 void func(struct fbtft_par *par, int len, ...)\ c296d5f9957c03 Thomas Petazzoni 2014-12-31 16 { \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 17va_list args; \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 18int i, ret; \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 19int offset = 0; \ 8d8825b420ffb3 Alfonso Lima Astor 2017-10-17 20buffer_type *buf = (buffer_type *)par->buf; \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 21 \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 22if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {\ c296d5f9957c03 Thomas Petazzoni 2014-12-31 23va_start(args, len); \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 24for (i = 0; i < len; i++) { \ cc1c0eea8527bd Renato Soma2018-04-17 25buf[i] = modifier((data_type)va_arg(args, \ cc1c0eea8527bd Renato Soma2018-04-17 26 unsigned int)); \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 27} \ c296d5f9957c03 Thomas Petazzoni 2014-12-31 28va_end(args); \ cc1c0eea8527bd Renato Soma2018-04-17 29 fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, \ cc1c0eea8527bd Renato Soma2018-04-17 30 par->info->device, b
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
On Sat, Jun 27, 2020 at 10:28:31AM +0200, Hans Verkuil wrote: > On 27/06/2020 07:07, Greg Kroah-Hartman wrote: > > > > A: http://en.wikipedia.org/wiki/Top_post > > Q: Were do I find info about this thing called top-posting? > > A: Because it messes up the order in which people normally read text. > > Q: Why is top-posting such a bad thing? > > A: Top-posting. > > Q: What is the most annoying thing in e-mail? > > > > A: No. > > Q: Should I include quotations after my reply? > > > > http://daringfireball.net/2007/07/on_top > > > > On Fri, Jun 26, 2020 at 11:42:49AM -0400, B K KARTHIK PES2201800185STUDENT > > ECE DeptPESU EC Campus wrote: > >> Oh, I'm sorry but wouldn't it be helpful if we had a file that lists > >> all drivers that are scheduled for removal? > > > > The TODO file in the directory for the driver should have this > > information in it. I don't know if all of the media drivers have this, > > if not, then there is no way you could have known this. > > They have, and in addition the Kconfig entry will mention that the driver > is deprecated. > > TODO of usbvision: > > The driver is deprecated and scheduled for removal by the end > of 2020. > > In order to prevent removal the following actions would have to > be taken: > > - clean up the code > - convert to the vb2 framework > - fix the disconnect and free-on-last-user handling (i.e., add > a release callback for struct v4l2_device and rework the code > to use that correctly). Ah, great, nevermind then! B K, your wish is already granted, the text is present, you just needed to have noticed it :) greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: RT_TRACE in drivers/staging/rtl8188eu
On Sat, 2020-06-27 at 10:18 +0200, Greg KH wrote: > On Sat, Jun 27, 2020 at 01:12:42AM -0700, Joe Perches wrote: > > On Sat, 2020-06-27 at 10:01 +0200, Greg KH wrote: > > > On Sat, Jun 27, 2020 at 12:33:56AM -0700, Joe Perches wrote: > > > > There are 3 parts of the email. > > > > > > > > 1: A description and patch for a logging defect > > > > 2: A script to go along with the patch to do conversions > > > > 3: Current diff for this defect > > > > > > > > > > > > - > > > > > > > > The macro below in drivers/staging/rtl8188eu/include/rtw_debug.h > > > > is defective as it emits multiple pr_info calls for each use > > > > so the logging in dmesg is discontinuous. > > > > > > I recommend just deleting it. As it's obviously incorrect, and any > > > "real" tracing should just use the real tracing infrastructure, this is > > > not needed and can be removed. > > > > Don't get hung up on the name. > > > > It's not used for tracing, it's effectively just > > a debugging mechanism, the same in all the other > > rtl staging drivers. > > Ok, then it should be converted to "normal" dev_*() functions, where > needed, the others deleted entirely (the dev_info attempts...) Nope. These are the same as uses in drivers/net/wireless/realtek/rtlwifi. $ git grep -w RT_TRACE drivers/net/wireless/realtek | wc -l 2847 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
Thank you for the information. I will take care of all these things from the next time. sorry for wasting your time thanks, karthik On Sat, Jun 27, 2020 at 4:49 AM Greg Kroah-Hartman wrote: > > On Sat, Jun 27, 2020 at 10:28:31AM +0200, Hans Verkuil wrote: > > On 27/06/2020 07:07, Greg Kroah-Hartman wrote: > > > > > > A: http://en.wikipedia.org/wiki/Top_post > > > Q: Were do I find info about this thing called top-posting? > > > A: Because it messes up the order in which people normally read text. > > > Q: Why is top-posting such a bad thing? > > > A: Top-posting. > > > Q: What is the most annoying thing in e-mail? > > > > > > A: No. > > > Q: Should I include quotations after my reply? > > > > > > http://daringfireball.net/2007/07/on_top > > > > > > On Fri, Jun 26, 2020 at 11:42:49AM -0400, B K KARTHIK > > > PES2201800185STUDENT ECE DeptPESU EC Campus wrote: > > >> Oh, I'm sorry but wouldn't it be helpful if we had a file that lists > > >> all drivers that are scheduled for removal? > > > > > > The TODO file in the directory for the driver should have this > > > information in it. I don't know if all of the media drivers have this, > > > if not, then there is no way you could have known this. > > > > They have, and in addition the Kconfig entry will mention that the driver > > is deprecated. > > > > TODO of usbvision: > > > > The driver is deprecated and scheduled for removal by the end > > of 2020. > > > > In order to prevent removal the following actions would have to > > be taken: > > > > - clean up the code > > - convert to the vb2 framework > > - fix the disconnect and free-on-last-user handling (i.e., add > > a release callback for struct v4l2_device and rework the code > > to use that correctly). > > Ah, great, nevermind then! > > B K, your wish is already granted, the text is present, you just needed > to have noticed it :) > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: remove blank lines in header files
Remove blank lines in header files to clear checkpatch issues. CHECK: Please don't use multiple blank lines Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/include/hal_com.h | 1 - drivers/staging/rtl8188eu/include/ieee80211.h | 11 --- drivers/staging/rtl8188eu/include/odm.h | 4 drivers/staging/rtl8188eu/include/odm_debug.h | 2 -- drivers/staging/rtl8188eu/include/pwrseq.h| 3 --- drivers/staging/rtl8188eu/include/pwrseqcmd.h | 1 - drivers/staging/rtl8188eu/include/recv_osdep.h| 2 -- drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 5 - drivers/staging/rtl8188eu/include/rtl8188e_spec.h | 1 - drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 1 - drivers/staging/rtl8188eu/include/rtw_debug.h | 1 - drivers/staging/rtl8188eu/include/rtw_ioctl.h | 2 -- drivers/staging/rtl8188eu/include/rtw_ioctl_set.h | 1 - drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 3 --- drivers/staging/rtl8188eu/include/rtw_recv.h | 3 --- drivers/staging/rtl8188eu/include/rtw_rf.h| 1 - drivers/staging/rtl8188eu/include/rtw_security.h | 3 --- drivers/staging/rtl8188eu/include/rtw_xmit.h | 1 - drivers/staging/rtl8188eu/include/wifi.h | 5 - drivers/staging/rtl8188eu/include/wlan_bssdef.h | 3 --- 21 files changed, 55 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 35c0946bc65d..0a3acb378d6d 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -10,7 +10,6 @@ --*/ - #ifndef __DRV_TYPES_H__ #define __DRV_TYPES_H__ diff --git a/drivers/staging/rtl8188eu/include/hal_com.h b/drivers/staging/rtl8188eu/include/hal_com.h index 93cbbe7ba1fd..542e6e93ff8e 100644 --- a/drivers/staging/rtl8188eu/include/hal_com.h +++ b/drivers/staging/rtl8188eu/include/hal_com.h @@ -137,7 +137,6 @@ #include "HalVerDef.h" void dump_chip_info(struct HAL_VERSION ChipVersion); - /* return the final channel plan decision */ u8 hal_com_get_channel_plan(u8 hw_channel_plan, u8 sw_channel_plan, u8 def_channel_plan, bool load_fail); diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index 75f0ebe0faf5..83218e7ec0a9 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -90,7 +90,6 @@ enum { #define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6 #define IEEE_CRYPT_ERR_CARD_CONF_FAILED7 - #defineIEEE_CRYPT_ALG_NAME_LEN 16 #define WPA_CIPHER_NONEBIT(0) @@ -99,8 +98,6 @@ enum { #define WPA_CIPHER_TKIPBIT(3) #define WPA_CIPHER_CCMPBIT(4) - - #define WPA_SELECTOR_LEN 4 extern u8 RTW_WPA_OUI_TYPE[]; extern u8 WPA_AUTH_KEY_MGMT_NONE[]; @@ -113,7 +110,6 @@ extern u8 WPA_CIPHER_SUITE_WRAP[]; extern u8 WPA_CIPHER_SUITE_CCMP[]; extern u8 WPA_CIPHER_SUITE_WEP104[]; - #define RSN_HEADER_LEN 4 #define RSN_SELECTOR_LEN 4 @@ -192,7 +188,6 @@ enum NETWORK_TYPE { #define IsSupportedTxMCS(NetType) \ ((NetType) & (WIRELESS_11_24N | WIRELESS_11_5N) ? true : false) - struct ieee_param { u32 cmd; u8 sta_addr[ETH_ALEN]; @@ -270,11 +265,9 @@ struct sta_data { * WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ - #define IEEE80211_HLEN 30 #define IEEE80211_FRAME_LEN(IEEE80211_DATA_LEN + IEEE80211_HLEN) - /* this is stolen from ipw2200 driver */ #define IEEE_IBSS_MAC_HASH_SIZE 31 @@ -297,7 +290,6 @@ enum eap_type { #define RTW_IEEE80211_SCTL_FRAG0x000F #define RTW_IEEE80211_SCTL_SEQ 0xFFF0 - #define RTW_ERP_INFO_NON_ERP_PRESENT BIT(0) #define RTW_ERP_INFO_USE_PROTECTION BIT(1) #define RTW_ERP_INFO_BARKER_PREAMBLE_MODE BIT(2) @@ -354,7 +346,6 @@ struct ieee80211_snap_hdr { #define IEEE80211_CCK_RATE_LEN 4 #define IEEE80211_NUM_OFDM_RATESLEN8 - #define IEEE80211_CCK_RATE_1MB 0x02 #define IEEE80211_CCK_RATE_2MB 0x04 #define IEEE80211_CCK_RATE_5MB 0x0B @@ -613,7 +604,6 @@ enum rtw_ieee80211_back_parties { #define WME_TSPEC_DIRECTION_DOWNLINK 1 #define WME_TSPEC_DIRECTION_BI_DIRECTIONAL 3 - #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */ @@ -758,7 +748,6 @@ uintrtw_get_rateset_len(u8 *rateset); struct registry_priv; int rtw_generate_ie(struct registry_priv *pregistrypriv); - int rtw_get_bit_value_from_ieee_value(u8 val); bool rtw_is_cckrates_included(u8 *rate); diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/
Re: [PATCH] staging: media: usbvision: removing prohibited space before ',' (ctx:WxW)
On Sat, 2020-06-27 at 10:49 +0200, Greg Kroah-Hartman wrote: > On Sat, Jun 27, 2020 at 10:28:31AM +0200, Hans Verkuil wrote: > > On 27/06/2020 07:07, Greg Kroah-Hartman wrote: > > > A: http://en.wikipedia.org/wiki/Top_post > > > Q: Were do I find info about this thing called top-posting? > > > A: Because it messes up the order in which people normally read text. > > > Q: Why is top-posting such a bad thing? > > > A: Top-posting. > > > Q: What is the most annoying thing in e-mail? > > > > > > A: No. > > > Q: Should I include quotations after my reply? > > > > > > http://daringfireball.net/2007/07/on_top > > > > > > On Fri, Jun 26, 2020 at 11:42:49AM -0400, B K KARTHIK > > > PES2201800185STUDENT ECE DeptPESU EC Campus wrote: > > > > Oh, I'm sorry but wouldn't it be helpful if we had a file that lists > > > > all drivers that are scheduled for removal? > > > > > > The TODO file in the directory for the driver should have this > > > information in it. I don't know if all of the media drivers have this, > > > if not, then there is no way you could have known this. > > > > They have, and in addition the Kconfig entry will mention that the driver > > is deprecated. > > > > TODO of usbvision: > > > > The driver is deprecated and scheduled for removal by the end > > of 2020. > > > > In order to prevent removal the following actions would have to > > be taken: > > > > - clean up the code > > - convert to the vb2 framework > > - fix the disconnect and free-on-last-user handling (i.e., add > > a release callback for struct v4l2_device and rework the code > > to use that correctly). > > Ah, great, nevermind then! > > B K, your wish is already granted, the text is present, you just needed > to have noticed it :) > > greg k-h You should mark the entry in MAINTAINERS as obsolete so checkpatch tells people not to send patches. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 04fceaee5200..7c136018d153 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17906,7 +17906,7 @@ F: include/uapi/linux/uvcvideo.h USB VISION DRIVER M: Hans Verkuil L: linux-me...@vger.kernel.org -S: Odd Fixes +S: Odd Fixes / Obsolete W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git F: drivers/staging/media/usbvision/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] replace pr_err with netdev_err
Replace all pr_errs with netdev_err. Suggested-by: Joe Perches Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 568 1 file changed, 289 insertions(+), 279 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 63e965966ced..32fbd30a6a2e 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -647,7 +647,7 @@ static void ql_get_mac_protocol_registers(struct ql_adapter *qdev, u32 *buf) max_offset = MAC_ADDR_MAX_MGMT_TU_DP_WCOUNT; break; default: - pr_err("Bad type!!! 0x%08x\n", type); + netdev_err(qdev->ndev, "Bad type!!! 0x%08x\n", type); max_index = 0; max_offset = 0; break; @@ -1335,9 +1335,8 @@ static void ql_dump_intr_states(struct ql_adapter *qdev) for (i = 0; i < qdev->intr_count; i++) { ql_write32(qdev, INTR_EN, qdev->intr_context[i].intr_read_mask); value = ql_read32(qdev, INTR_EN); - pr_err("%s: Interrupt %d is %s\n", - qdev->ndev->name, i, - (value & INTR_EN_EN ? "enabled" : "disabled")); + netdev_err(qdev->ndev, "Interrupt %d is %s\n", i, + (value & INTR_EN_EN ? "enabled" : "disabled")); } } @@ -1345,13 +1344,14 @@ static void ql_dump_intr_states(struct ql_adapter *qdev) do { \ u32 data; \ ql_read_xgmac_reg(qdev, reg, &data);\ - pr_err("%s: %s = 0x%.08x\n", qdev->ndev->name, #reg, data); \ + netdev_err(qdev->ndev, "%s = 0x%.08x\n", #reg, data); \ } while (0) void ql_dump_xgmac_control_regs(struct ql_adapter *qdev) { if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) { - pr_err("%s: Couldn't get xgmac sem\n", __func__); + netdev_err(qdev->ndev, "%s: Couldn't get xgmac sem\n", + __func__); return; } DUMP_XGMAC(qdev, PAUSE_SRC_LO); @@ -1388,25 +1388,28 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) return; for (i = 0; i < 4; i++) { if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { - pr_err("%s: Failed read of mac index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of mac index register\n", + __func__); break; } if (value[0]) - pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", - qdev->ndev->name, i, value[1], value[0], - value[2]); + netdev_err(qdev->ndev, + "CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", + i, value[1], value[0], value[2]); } for (i = 0; i < 32; i++) { if (ql_get_mac_addr_reg (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) { - pr_err("%s: Failed read of mac index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of mac index register\n", + __func__); break; } if (value[0]) - pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", - qdev->ndev->name, i, value[1], value[0]); + netdev_err(qdev->ndev, + "MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", + i, value[1], value[0]); } ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); } @@ -1422,23 +1425,25 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) for (i = 0; i < 16; i++) { value = 0; if (ql_get_routing_reg(qdev, i, &value)) { - pr_err("%s: Failed read of routing index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of routing index register\n", + __func__); break; } if (value) - pr_err("%s: Routing Mask %d = 0x%.08x\n", - qdev->ndev->name, i, value); + netdev_err(qdev->ndev, +
[PATCH 2/4] fix else after return or break
Remove unnecessary elses after return or break. Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 23 ++- drivers/staging/qlge/qlge_main.c | 8 drivers/staging/qlge/qlge_mpi.c | 4 ++-- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 058889687907..87433510a224 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1391,12 +1391,11 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of mac index register\n", __func__); return; - } else { - if (value[0]) - pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", - qdev->ndev->name, i, value[1], value[0], - value[2]); } + if (value[0]) + pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", + qdev->ndev->name, i, value[1], value[0], + value[2]); } for (i = 0; i < 32; i++) { if (ql_get_mac_addr_reg @@ -1404,11 +1403,10 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of mac index register\n", __func__); return; - } else { - if (value[0]) - pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", - qdev->ndev->name, i, value[1], value[0]); } + if (value[0]) + pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", + qdev->ndev->name, i, value[1], value[0]); } ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); } @@ -1427,11 +1425,10 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of routing index register\n", __func__); return; - } else { - if (value) - pr_err("%s: Routing Mask %d = 0x%.08x\n", - qdev->ndev->name, i, value); } + if (value) + pr_err("%s: Routing Mask %d = 0x%.08x\n", + qdev->ndev->name, i, value); } ql_sem_unlock(qdev, SEM_RT_IDX_MASK); } diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index aaecf2b0f9a1..0054c454506b 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3778,10 +3778,10 @@ static int ql_wol(struct ql_adapter *qdev) "Failed to set magic packet on %s.\n", qdev->ndev->name); return status; - } else - netif_info(qdev, drv, qdev->ndev, - "Enabled magic packet successfully on %s.\n", - qdev->ndev->name); + } + netif_info(qdev, drv, qdev->ndev, + "Enabled magic packet successfully on %s.\n", + qdev->ndev->name); wol |= MB_WOL_MAGIC_PKT; } diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c index 3bb08d290525..fa178fc642a6 100644 --- a/drivers/staging/qlge/qlge_mpi.c +++ b/drivers/staging/qlge/qlge_mpi.c @@ -276,8 +276,8 @@ static void ql_link_up(struct ql_adapter *qdev, struct mbox_params *mbcp) netif_err(qdev, ifup, qdev->ndev, "Failed to init CAM/Routing tables.\n"); return; - } else - clear_bit(QL_CAM_RT_SET, &qdev->flags); + } + clear_bit(QL_CAM_RT_SET, &qdev->flags); } /* Queue up a worker to check the frame -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] fix ql_sem_unlock
Some functions return without releasing the lock. Replace return with break. Suggested-by Dan Carpenter . Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 87433510a224..63e965966ced 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1390,7 +1390,7 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { pr_err("%s: Failed read of mac index register\n", __func__); - return; + break; } if (value[0]) pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", @@ -1402,7 +1402,7 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) { pr_err("%s: Failed read of mac index register\n", __func__); - return; + break; } if (value[0]) pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", @@ -1424,7 +1424,7 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) if (ql_get_routing_reg(qdev, i, &value)) { pr_err("%s: Failed read of routing index register\n", __func__); - return; + break; } if (value) pr_err("%s: Routing Mask %d = 0x%.08x\n", -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] fix trailing */ in block comment
Remove trailing "*/" in block comments. Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_main.c | 3 ++- drivers/staging/qlge/qlge_mpi.c | 10 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index 1650de13842f..aaecf2b0f9a1 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3244,7 +3244,8 @@ static void ql_set_irq_mask(struct ql_adapter *qdev, struct intr_context *ctx) */ ctx->irq_mask = (1 << qdev->rx_ring[vect].cq_id); /* Add the TX ring(s) serviced by this vector -* to the mask. */ +* to the mask. +*/ for (j = 0; j < tx_rings_per_vector; j++) { ctx->irq_mask |= (1 << qdev->rx_ring[qdev->rss_ring_count + diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c index 60c08d9cc034..3bb08d290525 100644 --- a/drivers/staging/qlge/qlge_mpi.c +++ b/drivers/staging/qlge/qlge_mpi.c @@ -389,7 +389,8 @@ static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp) * This can get called iteratively from the mpi_work thread * when events arrive via an interrupt. * It also gets called when a mailbox command is polling for - * it's completion. */ + * it's completion. + */ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) { int status; @@ -520,7 +521,7 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) * changed when a mailbox command is waiting * for a response and an AEN arrives and * is handled. -* */ +*/ mbcp->out_count = orig_count; return status; } @@ -555,7 +556,8 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) * here because some AEN might arrive while * we're waiting for the mailbox command to * complete. If more than 5 seconds expire we can -* assume something is wrong. */ +* assume something is wrong. +*/ count = jiffies + HZ * MAILBOX_TIMEOUT; do { /* Wait for the interrupt to come in. */ @@ -1178,7 +1180,7 @@ void ql_mpi_idc_work(struct work_struct *work) /* Signal the resulting link up AEN * that the frame routing and mac addr * needs to be set. -* */ +*/ set_bit(QL_CAM_RT_SET, &qdev->flags); /* Do ACK if required */ if (timeout) { -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: qlge: coding style fix for the qlge driver
These patches fix three coding style problems for all files under drivers/staging/qlge, - trailing */ in block comment - unnecessary else after return or break - pr_err preferred over netdev_err and a bug about releasing lock. Coiby Xu (4): fix trailing */ in block comment fix else after return or break fix ql_sem_unlock replace pr_err with netdev_err drivers/staging/qlge/qlge_dbg.c | 583 --- drivers/staging/qlge/qlge_main.c | 11 +- drivers/staging/qlge/qlge_mpi.c | 14 +- 3 files changed, 309 insertions(+), 299 deletions(-) -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: qlge: fix else after return or break
On Fri, Jun 26, 2020 at 05:06:33PM -0700, Joe Perches wrote: On Sat, 2020-06-27 at 07:57 +0800, Coiby Xu wrote: On Thu, Jun 25, 2020 at 03:13:14PM -0700, Joe Perches wrote: > On Fri, 2020-06-26 at 05:57 +0800, Coiby Xu wrote: > > Remove unnecessary elses after return or break. > > unrelated trivia: [] > looks like all of these could use netdev_err [] should we also replace all pr_errs with netdev_err in ql_dump_* functions? Ideally, anywhere a struct netdevice * is available, it should be used to output netdev_ in preference to pr_. Thank you for the explaining! -- Best regards, Coiby ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] fix trailing */ in block comment
On Sat, Jun 27, 2020 at 06:14:44PM +0800, Coiby Xu wrote: > Remove trailing "*/" in block comments. > > Signed-off-by: Coiby Xu The subject lines of all of your patches should match other patches for this driver. It should look like "staging: qlge: ..." Please fix up and resend a v2 of this series. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[GIT PULL] Staging driver fixes for 5.8-rc3
The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git tags/staging-5.8-rc3 for you to fetch changes up to b65a2d8c8614386f7e8d38ea150749f8a862f431: Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() (2020-06-16 21:25:38 +0200) Staging driver fixes for 5.8-rc3 Here are a small number of tiny staging driver fixes for 5.8-rc3. Not much here, but there were some reported problems to be fixed: - 3 wfx driver fixes - rtl8723bs driver fix All of these have been in linux-next with no reported issues. Signed-off-by: Greg Kroah-Hartman Dan Carpenter (1): Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() Jérôme Pouiller (3): staging: wfx: fix AC priority staging: wfx: drop useless loop staging: wfx: fix coherency of hif_scan() prototype drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 4 +++- drivers/staging/wfx/hif_tx.c | 6 -- drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/queue.c| 21 + drivers/staging/wfx/scan.c | 6 +++--- 5 files changed, 20 insertions(+), 19 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wfx: Get descriptors for GPIOs
The code has the functionality to insert the GPIO lines using the global GPIO numbers through module parameters. As we are clearly deprecating the use of global GPIO numbers look up the GPIO descriptors from the device instead. This usually falls back to device hardware descriptions using e.g. device tree or ACPI. This device clearly supports device tree when used over SPI for example. For example, this can be supplied in the device tree like so: wfx@0x01 { compatible = "silabs,wf200"; reset-gpios = <&gpio0 1>; wakeup-gpios = <&gpio0 2>; }; Cc: Jérôme Pouiller Signed-off-by: Linus Walleij --- drivers/staging/wfx/bus_spi.c | 11 + drivers/staging/wfx/main.c| 42 --- drivers/staging/wfx/main.h| 2 -- 3 files changed, 9 insertions(+), 46 deletions(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index e8da61fb096b..88ca5d453e83 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -8,7 +8,6 @@ */ #include #include -#include #include #include #include @@ -21,10 +20,6 @@ #include "main.h" #include "bh.h" -static int gpio_reset = -2; -module_param(gpio_reset, int, 0644); -MODULE_PARM_DESC(gpio_reset, "gpio number for reset. -1 for none."); - #define SET_WRITE 0x7FFF/* usage: and operation */ #define SET_READ 0x8000 /* usage: or operation */ @@ -211,10 +206,14 @@ static int wfx_spi_probe(struct spi_device *func) bus->need_swab = true; spi_set_drvdata(func, bus); - bus->gpio_reset = wfx_get_gpio(&func->dev, gpio_reset, "reset"); + bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset" + GPIOD_OUT_HIGH); + if (IS_ERR(bus->gpio_reset)) + return PTR_ERR(bus->gpio_reset); if (!bus->gpio_reset) { dev_warn(&func->dev, "try to load firmware anyway\n"); } else { + gpiod_set_consumer_name(bus->gpio_reset, "wfx reset"); if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED) gpiod_toggle_active_low(bus->gpio_reset); gpiod_set_value_cansleep(bus->gpio_reset, 1); diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 6bd96f476388..cd58173f7294 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -41,10 +40,6 @@ MODULE_DESCRIPTION("Silicon Labs 802.11 Wireless LAN driver for WFx"); MODULE_AUTHOR("Jérôme Pouiller "); MODULE_LICENSE("GPL"); -static int gpio_wakeup = -2; -module_param(gpio_wakeup, int, 0644); -MODULE_PARM_DESC(gpio_wakeup, "gpio number for wakeup. -1 for none."); - #define RATETAB_ENT(_rate, _rateid, _flags) { \ .bitrate = (_rate), \ .hw_value = (_rateid), \ @@ -170,38 +165,6 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) return false; } -struct gpio_desc *wfx_get_gpio(struct device *dev, - int override, const char *label) -{ - struct gpio_desc *ret; - char label_buf[256]; - - if (override >= 0) { - snprintf(label_buf, sizeof(label_buf), "wfx_%s", label); - ret = ERR_PTR(devm_gpio_request_one(dev, override, - GPIOF_OUT_INIT_LOW, - label_buf)); - if (!ret) - ret = gpio_to_desc(override); - } else if (override == -1) { - ret = NULL; - } else { - ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW); - } - if (IS_ERR_OR_NULL(ret)) { - if (!ret || PTR_ERR(ret) == -ENOENT) - dev_warn(dev, "gpio %s is not defined\n", label); - else - dev_warn(dev, "error while requesting gpio %s\n", -label); - ret = NULL; - } else { - dev_dbg(dev, "using gpio %d for %s\n", - desc_to_gpio(ret), label); - } - return ret; -} - /* NOTE: wfx_send_pds() destroy buf */ int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len) { @@ -340,7 +303,10 @@ struct wfx_dev *wfx_init_common(struct device *dev, memcpy(&wdev->pdata, pdata, sizeof(*pdata)); of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds); - wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup"); + wdev->pdata.gpio_wakeup = devm_gpiod_get(dev, "wakeup", GPIOD_IN); + if (IS_ERR(wdev->pdata.gpio_wakeup)) + return PTR_ERR(wdev->pdata.gpio_wakeup); + gpiod_set_consumer_name(wdev->pdata.gpio_wakep, "wfx wakeup"); wfx_sl_fill_pdata(dev, &wdev->pdata);
[PATCH v2 0/4] staging: qlge: coding style fix for the qlge driver
v2 - let all patches' subject lines match the pattern "staging: qlge: ..." These patches fix three coding style problems for all files under drivers/staging/qlge, - trailing */ in block comment - unnecessary else after return or break - pr_err preferred over netdev_err and a bug about releasing lock. Coiby Xu (4): fix trailing */ in block comment fix else after return or break fix ql_sem_unlock replace pr_err with netdev_err drivers/staging/qlge/qlge_dbg.c | 583 --- drivers/staging/qlge/qlge_main.c | 11 +- drivers/staging/qlge/qlge_mpi.c | 14 +- 3 files changed, 309 insertions(+), 299 deletions(-) -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/4] staging: qlge: fix trailing */ in block comment
Remove trailing "*/" in block comments. Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_main.c | 3 ++- drivers/staging/qlge/qlge_mpi.c | 10 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index 1650de13842f..aaecf2b0f9a1 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3244,7 +3244,8 @@ static void ql_set_irq_mask(struct ql_adapter *qdev, struct intr_context *ctx) */ ctx->irq_mask = (1 << qdev->rx_ring[vect].cq_id); /* Add the TX ring(s) serviced by this vector -* to the mask. */ +* to the mask. +*/ for (j = 0; j < tx_rings_per_vector; j++) { ctx->irq_mask |= (1 << qdev->rx_ring[qdev->rss_ring_count + diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c index 60c08d9cc034..3bb08d290525 100644 --- a/drivers/staging/qlge/qlge_mpi.c +++ b/drivers/staging/qlge/qlge_mpi.c @@ -389,7 +389,8 @@ static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp) * This can get called iteratively from the mpi_work thread * when events arrive via an interrupt. * It also gets called when a mailbox command is polling for - * it's completion. */ + * it's completion. + */ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) { int status; @@ -520,7 +521,7 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) * changed when a mailbox command is waiting * for a response and an AEN arrives and * is handled. -* */ +*/ mbcp->out_count = orig_count; return status; } @@ -555,7 +556,8 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) * here because some AEN might arrive while * we're waiting for the mailbox command to * complete. If more than 5 seconds expire we can -* assume something is wrong. */ +* assume something is wrong. +*/ count = jiffies + HZ * MAILBOX_TIMEOUT; do { /* Wait for the interrupt to come in. */ @@ -1178,7 +1180,7 @@ void ql_mpi_idc_work(struct work_struct *work) /* Signal the resulting link up AEN * that the frame routing and mac addr * needs to be set. -* */ +*/ set_bit(QL_CAM_RT_SET, &qdev->flags); /* Do ACK if required */ if (timeout) { -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/4] staging: qlge: fix ql_sem_unlock
Some functions return without releasing the lock. Replace return with break. Suggested-by Dan Carpenter . Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 87433510a224..63e965966ced 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1390,7 +1390,7 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { pr_err("%s: Failed read of mac index register\n", __func__); - return; + break; } if (value[0]) pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", @@ -1402,7 +1402,7 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) { pr_err("%s: Failed read of mac index register\n", __func__); - return; + break; } if (value[0]) pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", @@ -1424,7 +1424,7 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) if (ql_get_routing_reg(qdev, i, &value)) { pr_err("%s: Failed read of routing index register\n", __func__); - return; + break; } if (value) pr_err("%s: Routing Mask %d = 0x%.08x\n", -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/4] staging: qlge: fix else after return or break
Remove unnecessary elses after return or break. Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 23 ++- drivers/staging/qlge/qlge_main.c | 8 drivers/staging/qlge/qlge_mpi.c | 4 ++-- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 058889687907..87433510a224 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -1391,12 +1391,11 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of mac index register\n", __func__); return; - } else { - if (value[0]) - pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", - qdev->ndev->name, i, value[1], value[0], - value[2]); } + if (value[0]) + pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", + qdev->ndev->name, i, value[1], value[0], + value[2]); } for (i = 0; i < 32; i++) { if (ql_get_mac_addr_reg @@ -1404,11 +1403,10 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of mac index register\n", __func__); return; - } else { - if (value[0]) - pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", - qdev->ndev->name, i, value[1], value[0]); } + if (value[0]) + pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", + qdev->ndev->name, i, value[1], value[0]); } ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); } @@ -1427,11 +1425,10 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) pr_err("%s: Failed read of routing index register\n", __func__); return; - } else { - if (value) - pr_err("%s: Routing Mask %d = 0x%.08x\n", - qdev->ndev->name, i, value); } + if (value) + pr_err("%s: Routing Mask %d = 0x%.08x\n", + qdev->ndev->name, i, value); } ql_sem_unlock(qdev, SEM_RT_IDX_MASK); } diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index aaecf2b0f9a1..0054c454506b 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3778,10 +3778,10 @@ static int ql_wol(struct ql_adapter *qdev) "Failed to set magic packet on %s.\n", qdev->ndev->name); return status; - } else - netif_info(qdev, drv, qdev->ndev, - "Enabled magic packet successfully on %s.\n", - qdev->ndev->name); + } + netif_info(qdev, drv, qdev->ndev, + "Enabled magic packet successfully on %s.\n", + qdev->ndev->name); wol |= MB_WOL_MAGIC_PKT; } diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c index 3bb08d290525..fa178fc642a6 100644 --- a/drivers/staging/qlge/qlge_mpi.c +++ b/drivers/staging/qlge/qlge_mpi.c @@ -276,8 +276,8 @@ static void ql_link_up(struct ql_adapter *qdev, struct mbox_params *mbcp) netif_err(qdev, ifup, qdev->ndev, "Failed to init CAM/Routing tables.\n"); return; - } else - clear_bit(QL_CAM_RT_SET, &qdev->flags); + } + clear_bit(QL_CAM_RT_SET, &qdev->flags); } /* Queue up a worker to check the frame -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/4] staging: qlge: replace pr_err with netdev_err
Replace all pr_errs with netdev_err. Suggested-by: Joe Perches Signed-off-by: Coiby Xu --- drivers/staging/qlge/qlge_dbg.c | 568 1 file changed, 289 insertions(+), 279 deletions(-) diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c index 63e965966ced..32fbd30a6a2e 100644 --- a/drivers/staging/qlge/qlge_dbg.c +++ b/drivers/staging/qlge/qlge_dbg.c @@ -647,7 +647,7 @@ static void ql_get_mac_protocol_registers(struct ql_adapter *qdev, u32 *buf) max_offset = MAC_ADDR_MAX_MGMT_TU_DP_WCOUNT; break; default: - pr_err("Bad type!!! 0x%08x\n", type); + netdev_err(qdev->ndev, "Bad type!!! 0x%08x\n", type); max_index = 0; max_offset = 0; break; @@ -1335,9 +1335,8 @@ static void ql_dump_intr_states(struct ql_adapter *qdev) for (i = 0; i < qdev->intr_count; i++) { ql_write32(qdev, INTR_EN, qdev->intr_context[i].intr_read_mask); value = ql_read32(qdev, INTR_EN); - pr_err("%s: Interrupt %d is %s\n", - qdev->ndev->name, i, - (value & INTR_EN_EN ? "enabled" : "disabled")); + netdev_err(qdev->ndev, "Interrupt %d is %s\n", i, + (value & INTR_EN_EN ? "enabled" : "disabled")); } } @@ -1345,13 +1344,14 @@ static void ql_dump_intr_states(struct ql_adapter *qdev) do { \ u32 data; \ ql_read_xgmac_reg(qdev, reg, &data);\ - pr_err("%s: %s = 0x%.08x\n", qdev->ndev->name, #reg, data); \ + netdev_err(qdev->ndev, "%s = 0x%.08x\n", #reg, data); \ } while (0) void ql_dump_xgmac_control_regs(struct ql_adapter *qdev) { if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) { - pr_err("%s: Couldn't get xgmac sem\n", __func__); + netdev_err(qdev->ndev, "%s: Couldn't get xgmac sem\n", + __func__); return; } DUMP_XGMAC(qdev, PAUSE_SRC_LO); @@ -1388,25 +1388,28 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) return; for (i = 0; i < 4; i++) { if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { - pr_err("%s: Failed read of mac index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of mac index register\n", + __func__); break; } if (value[0]) - pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", - qdev->ndev->name, i, value[1], value[0], - value[2]); + netdev_err(qdev->ndev, + "CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n", + i, value[1], value[0], value[2]); } for (i = 0; i < 32; i++) { if (ql_get_mac_addr_reg (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) { - pr_err("%s: Failed read of mac index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of mac index register\n", + __func__); break; } if (value[0]) - pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", - qdev->ndev->name, i, value[1], value[0]); + netdev_err(qdev->ndev, + "MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", + i, value[1], value[0]); } ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); } @@ -1422,23 +1425,25 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) for (i = 0; i < 16; i++) { value = 0; if (ql_get_routing_reg(qdev, i, &value)) { - pr_err("%s: Failed read of routing index register\n", - __func__); + netdev_err(qdev->ndev, + "%s: Failed read of routing index register\n", + __func__); break; } if (value) - pr_err("%s: Routing Mask %d = 0x%.08x\n", - qdev->ndev->name, i, value); + netdev_err(qdev->ndev, +
Re: [PATCH 1/4] fix trailing */ in block comment
On Sat, Jun 27, 2020 at 12:47:08PM +0200, Greg Kroah-Hartman wrote: On Sat, Jun 27, 2020 at 06:14:44PM +0800, Coiby Xu wrote: Remove trailing "*/" in block comments. Signed-off-by: Coiby Xu The subject lines of all of your patches should match other patches for this driver. It should look like "staging: qlge: ..." Please fix up and resend a v2 of this series. thanks, greg k-h Thank you for pointing out this issue! -- Best regards, Coiby ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/4] staging: qlge: coding style fix for the qlge driver
Looks Good! Thanks. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: remove unnecessary comments in hal8188e_phy_cfg.h
Remove unnecessary comments in hal8188e_phy_cfg.h to improve readability and clear multiple blank lines checkpatch issues. CHECK: Please don't use multiple blank lines Signed-off-by: Michael Straube --- .../rtl8188eu/include/hal8188e_phy_cfg.h | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h b/drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h index 0c5b2b0948f5..78b44bf55f28 100644 --- a/drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h +++ b/drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h @@ -7,8 +7,6 @@ #ifndef __INC_HAL8188EPHYCFG_H__ #define __INC_HAL8188EPHYCFG_H__ - -/*--Define Parameters---*/ #define LOOP_LIMIT 5 #define MAX_STALL_TIME 50 /* us */ #define AntennaDiversityValue 0x80 @@ -17,11 +15,6 @@ #define MAX_AGGR_NUM 0x07 - -/*--Define Parameters---*/ - - -/*--Define structure*/ enum sw_chnl_cmd_id { CmdID_End, CmdID_SetTxPowerLevel, @@ -145,21 +138,7 @@ struct bb_reg_def { */ }; -/*--Define structure*/ - - -/*Export global variable*/ -/*Export global variable*/ - - -/*Export Marco Definition---*/ -/*Export Marco Definition---*/ - - -/*--Exported Function prototype-*/ -/* */ /* BB and RF register read/write */ -/* */ /* Read initi reg value for tx power setting. */ void rtl8192c_PHY_GetHWRegOriginalValue(struct adapter *adapter); @@ -181,8 +160,6 @@ void PHY_EnableHostClkReq(struct adapter *adapter); bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant); -/*--Exported Function prototype-*/ - #define PHY_SetMacReg PHY_SetBBReg #defineSIC_HW_SUPPORT 0 -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8188eu: remove unnecessary comments in hal8188e_phy_cfg.h
On Sat, Jun 27, 2020 at 05:15:44PM +0200, Michael Straube wrote: > @@ -145,21 +138,7 @@ struct bb_reg_def { >*/ > }; > > -/*--Define > structure*/ > - > - > -/*Export global > variable*/ > -/*Export global > variable*/ > - > - > -/*Export Marco > Definition---*/ > -/*Export Marco > Definition---*/ > - > - > -/*--Exported Function > prototype-*/ > -/* */ > /* BB and RF register read/write */ You can probably delete this line as well. ;) > -/* */ > > /* Read initi reg value for tx power setting. */ > void rtl8192c_PHY_GetHWRegOriginalValue(struct adapter *adapter); regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/4] staging: kpc2000: kpc_dma: Convert set_page_dirty() --> set_page_dirty_lock()
On Wed, Jun 17, 2020 at 7:50 AM Souptick Joarder wrote: > > First, convert set_page_dirty() to set_page_dirty_lock() > > Second, there is an interval in there after set_page_dirty() and > before put_page(), in which the device could be running and setting > pages dirty. Moving set_page_dirty_lock() after dma_unmap_sg(). > > Signed-off-by: Souptick Joarder > Suggested-by: John Hubbard > Cc: Dan Carpenter > Cc: Bharath Vedartham > --- > drivers/staging/kpc2000/kpc_dma/fileops.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c > b/drivers/staging/kpc2000/kpc_dma/fileops.c > index b136353..bcce86c 100644 > --- a/drivers/staging/kpc2000/kpc_dma/fileops.c > +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c > @@ -214,13 +214,13 @@ void transfer_complete_cb(struct aio_cb_data *acd, > size_t xfr_count, u32 flags) > BUG_ON(!acd->ldev); > BUG_ON(!acd->ldev->pldev); > > + dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, > acd->ldev->dir); > + > for (i = 0 ; i < acd->page_count ; i++) { > if (!PageReserved(acd->user_pages[i])) Question -> is PageReserved() used with specific purpose not PageDirty() ?? > - set_page_dirty(acd->user_pages[i]); > + set_page_dirty_lock(acd->user_pages[i]); > } > > - dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, > acd->ldev->dir); > - > for (i = 0 ; i < acd->page_count ; i++) > put_page(acd->user_pages[i]); > > -- > 1.9.1 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wfx: Get descriptors for GPIOs
Hi Linus, I love your patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] url: https://github.com/0day-ci/linux/commits/Linus-Walleij/staging-wfx-Get-descriptors-for-GPIOs/20200627-200038 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git a8e773132f131511357d9529c289ed52330e232a config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project ee3620643dfc88a178fa4ca116cf83014e4ee547) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): >> drivers/staging/wfx/main.c:308:10: warning: incompatible integer to pointer >> conversion returning 'long' from a function with result type 'struct wfx_dev >> *' [-Wint-conversion] return PTR_ERR(wdev->pdata.gpio_wakeup); ^~~~ >> drivers/staging/wfx/main.c:309:38: error: no member named 'gpio_wakep' in >> 'struct wfx_platform_data'; did you mean 'gpio_wakeup'? gpiod_set_consumer_name(wdev->pdata.gpio_wakep, "wfx wakeup"); ^~ gpio_wakeup drivers/staging/wfx/main.h:25:20: note: 'gpio_wakeup' declared here struct gpio_desc *gpio_wakeup; ^ 1 warning and 1 error generated. -- >> drivers/staging/wfx/bus_spi.c:210:9: error: expected ')' GPIOD_OUT_HIGH); ^ drivers/staging/wfx/bus_spi.c:209:43: note: to match this '(' bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset" ^ 1 error generated. vim +309 drivers/staging/wfx/main.c 245 246 struct wfx_dev *wfx_init_common(struct device *dev, 247 const struct wfx_platform_data *pdata, 248 const struct hwbus_ops *hwbus_ops, 249 void *hwbus_priv) 250 { 251 struct ieee80211_hw *hw; 252 struct wfx_dev *wdev; 253 254 hw = ieee80211_alloc_hw(sizeof(struct wfx_dev), &wfx_ops); 255 if (!hw) 256 return NULL; 257 258 SET_IEEE80211_DEV(hw, dev); 259 260 ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); 261 ieee80211_hw_set(hw, AMPDU_AGGREGATION); 262 ieee80211_hw_set(hw, CONNECTION_MONITOR); 263 ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); 264 ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); 265 ieee80211_hw_set(hw, SIGNAL_DBM); 266 ieee80211_hw_set(hw, SUPPORTS_PS); 267 ieee80211_hw_set(hw, MFP_CAPABLE); 268 269 hw->vif_data_size = sizeof(struct wfx_vif); 270 hw->sta_data_size = sizeof(struct wfx_sta_priv); 271 hw->queues = 4; 272 hw->max_rates = 8; 273 hw->max_rate_tries = 8; 274 hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + 275 sizeof(struct hif_msg) 276 + sizeof(struct hif_req_tx) 277 + 4 /* alignment */ + 8 /* TKIP IV */; 278 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 279 BIT(NL80211_IFTYPE_ADHOC) | 280 BIT(NL80211_IFTYPE_AP); 281 hw->wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | 282 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 | 283 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P | 284 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U; 285 hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; 286 hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; 287 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 288 hw->wiphy->max_ap_assoc_sta = HIF_LINK_ID_MAX; 289 hw->wiphy->max_scan_ssids = 2; 290
Re: [GIT PULL] Staging driver fixes for 5.8-rc3
The pull request you sent on Sat, 27 Jun 2020 13:40:37 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > tags/staging-5.8-rc3 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/42afe7d1c6ef77212250af3459e549d1a944cc8a Thank you! -- Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: atomisp: Convert to GPIO descriptors
Convert the atomisp LM3554 driver to use GPIO descriptors fully. It was already retrieveing the GPIO lines as descriptors but for some reason converting them back into global GPIO numbers. There is no reason to do this, just deal with the descriptors as-is. Cc: Mauro Carvalho Chehab Signed-off-by: Linus Walleij --- .../media/atomisp/i2c/atomisp-lm3554.c| 68 --- .../media/atomisp/include/media/lm3554.h | 7 +- 2 files changed, 32 insertions(+), 43 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index 809010af7855..7ca7378b1859 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -19,14 +19,13 @@ #include #include #include -#include +#include #include #include "../include/media/lm3554.h" #include #include #include -#include #include "../include/linux/atomisp_gmin_platform.h" #include "../include/linux/atomisp.h" @@ -173,7 +172,7 @@ static void lm3554_flash_off_delay(struct timer_list *t) struct lm3554 *flash = from_timer(flash, t, flash_off_delay); struct lm3554_platform_data *pdata = flash->pdata; - gpio_set_value(pdata->gpio_strobe, 0); + gpiod_set_value(pdata->gpio_strobe, 0); } static int lm3554_hw_strobe(struct i2c_client *client, bool strobe) @@ -209,7 +208,7 @@ static int lm3554_hw_strobe(struct i2c_client *client, bool strobe) * so must strobe off here */ if (timer_pending) - gpio_set_value(pdata->gpio_strobe, 0); + gpiod_set_value(pdata->gpio_strobe, 0); /* Restore flash current settings */ ret = lm3554_set_flash(flash); @@ -217,7 +216,7 @@ static int lm3554_hw_strobe(struct i2c_client *client, bool strobe) goto err; /* Strobe on Flash */ - gpio_set_value(pdata->gpio_strobe, 1); + gpiod_set_value(pdata->gpio_strobe, 1); return 0; err: @@ -627,7 +626,7 @@ static int __lm3554_s_power(struct lm3554 *flash, int power) int ret; /*initialize flash driver*/ - gpio_set_value(pdata->gpio_reset, power); + gpiod_set_value(pdata->gpio_reset, power); usleep_range(100, 100 + 1); if (power) { @@ -766,33 +765,22 @@ static int lm3554_gpio_init(struct i2c_client *client) struct lm3554_platform_data *pdata = flash->pdata; int ret; - if (!gpio_is_valid(pdata->gpio_reset)) + if (!pdata->gpio_reset) return -EINVAL; - ret = gpio_direction_output(pdata->gpio_reset, 0); + ret = gpiod_direction_output(pdata->gpio_reset, 0); if (ret < 0) - goto err_gpio_reset; + return ret; dev_info(&client->dev, "flash led reset successfully\n"); - if (!gpio_is_valid(pdata->gpio_strobe)) { - ret = -EINVAL; - goto err_gpio_dir_reset; - } + if (!pdata->gpio_strobe) + return -EINVAL; - ret = gpio_direction_output(pdata->gpio_strobe, 0); + ret = gpiod_direction_output(pdata->gpio_strobe, 0); if (ret < 0) - goto err_gpio_strobe; + return ret; return 0; - -err_gpio_strobe: - gpio_free(pdata->gpio_strobe); -err_gpio_dir_reset: - gpio_direction_output(pdata->gpio_reset, 0); -err_gpio_reset: - gpio_free(pdata->gpio_reset); - - return ret; } static int lm3554_gpio_uninit(struct i2c_client *client) @@ -802,16 +790,14 @@ static int lm3554_gpio_uninit(struct i2c_client *client) struct lm3554_platform_data *pdata = flash->pdata; int ret; - ret = gpio_direction_output(pdata->gpio_strobe, 0); + ret = gpiod_direction_output(pdata->gpio_strobe, 0); if (ret < 0) return ret; - ret = gpio_direction_output(pdata->gpio_reset, 0); + ret = gpiod_direction_output(pdata->gpio_reset, 0); if (ret < 0) return ret; - gpio_free(pdata->gpio_strobe); - gpio_free(pdata->gpio_reset); return 0; } @@ -819,18 +805,18 @@ static void *lm3554_platform_data_func(struct i2c_client *client) { static struct lm3554_platform_data platform_data; - platform_data.gpio_reset = - desc_to_gpio(gpiod_get_index(&client->dev, -NULL, 2, GPIOD_OUT_LOW)); - platform_data.gpio_strobe = - desc_to_gpio(gpiod_get_index(&client->dev, -NULL, 0, GPIOD_OUT_LOW)); - platform_data.gpio_torch = - desc_to_gpio(gpiod_get_index(&client->dev, -NULL, 1, GPIOD_OUT_LOW)); - dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n", -platform_data.gpio_reset, platform_data.gpio_strobe, -platform_data.gpio_torc
[no subject]
MONEY-GRAM TRANSFERRED PAYMENT INFO: Below is the sender’s information 1. MG. REFERENCE NO#: 36360857 2. SENDER'S NAME: Johnson Williams 3. AMOUNT TO PICKUP: US$10,000 Go to any Money Gram office near you and pick up the payment Track the Reference Number by visiting and click the link below (https://secure.moneygram.com/embed/track) and enter the Reference Number: 36360857 and the Last Name: Williams, you will find the payment available for pickup instantly. Yours Sincerely, Mrs. Helen Marvis United Nations Liaison Office Directorate for International Payments ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: wfx: Get descriptors for GPIOs
The code has the functionality to insert the GPIO lines using the global GPIO numbers through module parameters. As we are clearly deprecating the use of global GPIO numbers look up the GPIO descriptors from the device instead. This usually falls back to device hardware descriptions using e.g. device tree or ACPI. This device clearly supports device tree when used over SPI for example. For example, this can be supplied in the device tree like so: wfx@0x01 { compatible = "silabs,wf200"; reset-gpios = <&gpio0 1>; wakeup-gpios = <&gpio0 2>; }; Cc: Jérôme Pouiller Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Fixed a cast and a variable name. - I still don't know how to compile this but hey the zeroday robot does. --- drivers/staging/wfx/bus_spi.c | 11 + drivers/staging/wfx/main.c| 42 --- drivers/staging/wfx/main.h| 2 -- 3 files changed, 9 insertions(+), 46 deletions(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index e8da61fb096b..88ca5d453e83 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -8,7 +8,6 @@ */ #include #include -#include #include #include #include @@ -21,10 +20,6 @@ #include "main.h" #include "bh.h" -static int gpio_reset = -2; -module_param(gpio_reset, int, 0644); -MODULE_PARM_DESC(gpio_reset, "gpio number for reset. -1 for none."); - #define SET_WRITE 0x7FFF/* usage: and operation */ #define SET_READ 0x8000 /* usage: or operation */ @@ -211,10 +206,14 @@ static int wfx_spi_probe(struct spi_device *func) bus->need_swab = true; spi_set_drvdata(func, bus); - bus->gpio_reset = wfx_get_gpio(&func->dev, gpio_reset, "reset"); + bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset" + GPIOD_OUT_HIGH); + if (IS_ERR(bus->gpio_reset)) + return PTR_ERR(bus->gpio_reset); if (!bus->gpio_reset) { dev_warn(&func->dev, "try to load firmware anyway\n"); } else { + gpiod_set_consumer_name(bus->gpio_reset, "wfx reset"); if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED) gpiod_toggle_active_low(bus->gpio_reset); gpiod_set_value_cansleep(bus->gpio_reset, 1); diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 6bd96f476388..4d9119529c94 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -41,10 +40,6 @@ MODULE_DESCRIPTION("Silicon Labs 802.11 Wireless LAN driver for WFx"); MODULE_AUTHOR("Jérôme Pouiller "); MODULE_LICENSE("GPL"); -static int gpio_wakeup = -2; -module_param(gpio_wakeup, int, 0644); -MODULE_PARM_DESC(gpio_wakeup, "gpio number for wakeup. -1 for none."); - #define RATETAB_ENT(_rate, _rateid, _flags) { \ .bitrate = (_rate), \ .hw_value = (_rateid), \ @@ -170,38 +165,6 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) return false; } -struct gpio_desc *wfx_get_gpio(struct device *dev, - int override, const char *label) -{ - struct gpio_desc *ret; - char label_buf[256]; - - if (override >= 0) { - snprintf(label_buf, sizeof(label_buf), "wfx_%s", label); - ret = ERR_PTR(devm_gpio_request_one(dev, override, - GPIOF_OUT_INIT_LOW, - label_buf)); - if (!ret) - ret = gpio_to_desc(override); - } else if (override == -1) { - ret = NULL; - } else { - ret = devm_gpiod_get(dev, label, GPIOD_OUT_LOW); - } - if (IS_ERR_OR_NULL(ret)) { - if (!ret || PTR_ERR(ret) == -ENOENT) - dev_warn(dev, "gpio %s is not defined\n", label); - else - dev_warn(dev, "error while requesting gpio %s\n", -label); - ret = NULL; - } else { - dev_dbg(dev, "using gpio %d for %s\n", - desc_to_gpio(ret), label); - } - return ret; -} - /* NOTE: wfx_send_pds() destroy buf */ int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len) { @@ -340,7 +303,10 @@ struct wfx_dev *wfx_init_common(struct device *dev, memcpy(&wdev->pdata, pdata, sizeof(*pdata)); of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds); - wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup"); + wdev->pdata.gpio_wakeup = devm_gpiod_get(dev, "wakeup", GPIOD_IN); + if (IS_ERR(wdev->pdata.gpio_wakeup)) + return PTR_CAST(wdev->pdata.gp
Re: [PATCH] fbtft-bus.c: Removing that prohibited space before ')'
Hi K, Thank you for the patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] [also build test ERROR on v5.8-rc2 next-20200626] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/B-K-Karthik/fbtft-bus-c-Removing-that-prohibited-space-before/20200627-125315 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 92cd1b5d65f5c67147c7da39a3c2ad7e6ff81027 config: x86_64-randconfig-r015-20200628 (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a43b99a1e38e2beffb68a6db93f216f511e7fd41) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): >> drivers/staging/fbtft/fbtft-bus.c:65:53: error: too few arguments provided >> to function-like macro invocation define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) ^ drivers/staging/fbtft/fbtft-bus.c:14:9: note: macro 'define_fbtft_write_reg' defined here #define define_fbtft_write_reg(func, buffer_type, data_type, modifier) \ ^ >> drivers/staging/fbtft/fbtft-bus.c:65:1: error: unknown type name >> 'define_fbtft_write_reg' define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) ^ drivers/staging/fbtft/fbtft-bus.c:67:57: error: too few arguments provided to function-like macro invocation define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) ^ drivers/staging/fbtft/fbtft-bus.c:14:9: note: macro 'define_fbtft_write_reg' defined here #define define_fbtft_write_reg(func, buffer_type, data_type, modifier) \ ^ drivers/staging/fbtft/fbtft-bus.c:67:1: error: unknown type name 'define_fbtft_write_reg' define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) ^ >> drivers/staging/fbtft/fbtft-bus.c:86:3: error: non-void function >> 'fbtft_write_reg8_bus9' should return a value [-Wreturn-type] return; ^ drivers/staging/fbtft/fbtft-bus.c:109:3: error: non-void function 'fbtft_write_reg8_bus9' should return a value [-Wreturn-type] return; ^ 6 errors generated. vim +65 drivers/staging/fbtft/fbtft-bus.c 64 > 65 define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8) 66 define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16) > 67 define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16) 68 69 void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...) 70 { 71 va_list args; 72 int i, ret; 73 int pad = 0; 74 u16 *buf = (u16 *)par->buf; 75 76 if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) { 77 va_start(args, len); 78 for (i = 0; i < len; i++) 79 *(((u8 *)buf) + i) = (u8)va_arg(args, unsigned int); 80 va_end(args); 81 fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, 82par->info->device, u8, buf, len, "%s: ", 83__func__); 84 } 85 if (len <= 0) > 86 return; 87 88 if (par->spi && (par->spi->bits_per_word == 8)) { 89 /* we're emulating 9-bit, pad start of buffer with no-ops 90 * (assuming here that zero is a no-op) 91 */ 92 pad = (len % 4) ? 4 - (len % 4) : 0; 93 for (i = 0; i < pad; i++) 94 *buf++ = 0x000; 95 } 96 97 va_start(args, len); 98 *buf++ = (u8)va_arg(args, unsigned int); 99 i = len - 1; 100 while (i--) { 101 *buf = (u8)va_arg(args, unsigned int); 102 *buf++ |= 0x100; /* dc=1 */ 103 } 104 va_end(args); 105 ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16)); 106 if (ret < 0) { 107
Re: [PATCH v2] staging: wfx: Get descriptors for GPIOs
Hi Linus, I love your patch! Yet something to improve: [auto build test ERROR on staging/staging-testing] url: https://github.com/0day-ci/linux/commits/Linus-Walleij/staging-wfx-Get-descriptors-for-GPIOs/20200628-073632 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 5bfb7eadc5874a3a08dd173d66a16a1ed0548444 config: i386-allyesconfig (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 reproduce (this is a W=1 build): # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): drivers/staging/wfx/main.c: In function 'wfx_init_common': >> drivers/staging/wfx/main.c:308:10: error: implicit declaration of function >> 'PTR_CAST'; did you mean 'ERR_CAST'? [-Werror=implicit-function-declaration] 308 | return PTR_CAST(wdev->pdata.gpio_wakeup); | ^~~~ | ERR_CAST >> drivers/staging/wfx/main.c:308:10: warning: returning 'int' from a function >> with return type 'struct wfx_dev *' makes pointer from integer without a >> cast [-Wint-conversion] 308 | return PTR_CAST(wdev->pdata.gpio_wakeup); | ^ cc1: some warnings being treated as errors vim +308 drivers/staging/wfx/main.c 245 246 struct wfx_dev *wfx_init_common(struct device *dev, 247 const struct wfx_platform_data *pdata, 248 const struct hwbus_ops *hwbus_ops, 249 void *hwbus_priv) 250 { 251 struct ieee80211_hw *hw; 252 struct wfx_dev *wdev; 253 254 hw = ieee80211_alloc_hw(sizeof(struct wfx_dev), &wfx_ops); 255 if (!hw) 256 return NULL; 257 258 SET_IEEE80211_DEV(hw, dev); 259 260 ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); 261 ieee80211_hw_set(hw, AMPDU_AGGREGATION); 262 ieee80211_hw_set(hw, CONNECTION_MONITOR); 263 ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); 264 ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); 265 ieee80211_hw_set(hw, SIGNAL_DBM); 266 ieee80211_hw_set(hw, SUPPORTS_PS); 267 ieee80211_hw_set(hw, MFP_CAPABLE); 268 269 hw->vif_data_size = sizeof(struct wfx_vif); 270 hw->sta_data_size = sizeof(struct wfx_sta_priv); 271 hw->queues = 4; 272 hw->max_rates = 8; 273 hw->max_rate_tries = 8; 274 hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + 275 sizeof(struct hif_msg) 276 + sizeof(struct hif_req_tx) 277 + 4 /* alignment */ + 8 /* TKIP IV */; 278 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 279 BIT(NL80211_IFTYPE_ADHOC) | 280 BIT(NL80211_IFTYPE_AP); 281 hw->wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | 282 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 | 283 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P | 284 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U; 285 hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; 286 hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; 287 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 288 hw->wiphy->max_ap_assoc_sta = HIF_LINK_ID_MAX; 289 hw->wiphy->max_scan_ssids = 2; 290 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; 291 hw->wiphy->n_iface_combinations = ARRAY_SIZE(wfx_iface_combinations); 292 hw->wiphy->iface_combinations = wfx_iface_combinations; 293 hw->wiphy->bands[NL80211_BAND_2GHZ] = devm_kmalloc(dev, sizeof(wfx_band_2ghz), GFP_KERNEL); 294 // FIXME: also copy wfx_rates and wfx_2ghz_chantable 295 memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, 296 sizeof(wfx_band_2ghz)); 297 298 wdev = hw->priv; 299 wdev->hw = hw; 300 wdev->dev = dev; 301 wdev->hwbus_ops = hwbus_ops; 302 wdev->hwbus_priv = hwbus_priv; 303 memcpy(&wdev->pdata, pdata, sizeof(*pdata)); 304 of_property_read_string(dev->of_node, "config-file", 305 &wdev->pdata.file_pds); 306 wdev->pdata.gpio_wakeup = devm_gpiod_get(dev, "wakeup", GPIOD_IN); 307 if (IS_ERR(wdev->pdata.gpio_wakeup)) > 308 return PTR_CAST(wdev->pdata.gpio_wakeup); 309 gpiod_set_consumer_name(w
[staging:staging-testing] BUILD SUCCESS 5bfb7eadc5874a3a08dd173d66a16a1ed0548444
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing branch HEAD: 5bfb7eadc5874a3a08dd173d66a16a1ed0548444 staging: rtl8188eu: remove blank lines in header files elapsed time: 725m configs tested: 124 configs skipped: 7 The following configs have been built successfully. More configs may be tested in the coming days. arm defconfig arm allyesconfig arm allmodconfig arm64allyesconfig arm64 defconfig arm64allmodconfig arm64 allnoconfig arm allnoconfig arc haps_hs_smp_defconfig powerpc g5_defconfig mipsjmr3927_defconfig sh se7751_defconfig arm imx_v6_v7_defconfig armxcep_defconfig arm pxa255-idp_defconfig arm tango4_defconfig arm pxa_defconfig arm lpc18xx_defconfig mips ip27_defconfig arm eseries_pxa_defconfig mips loongson3_defconfig arm axm55xx_defconfig mips pistachio_defconfig arm ixp4xx_defconfig arm spear13xx_defconfig pariscallnoconfig armlart_defconfig arm bcm2835_defconfig sh sh7785lcr_32bit_defconfig i386 allnoconfig i386 allyesconfig i386defconfig i386 debian-10.3 ia64 allmodconfig ia64defconfig ia64 allnoconfig ia64 allyesconfig m68k allmodconfig m68k allnoconfig m68k sun3_defconfig m68kdefconfig m68k allyesconfig nios2 defconfig nios2allyesconfig openriscdefconfig c6x allyesconfig c6x allnoconfig openrisc allyesconfig nds32 defconfig nds32 allnoconfig csky allyesconfig cskydefconfig alpha defconfig alphaallyesconfig xtensa allyesconfig h8300allyesconfig h8300allmodconfig xtensa defconfig arc defconfig arc allyesconfig sh allmodconfig shallnoconfig microblazeallnoconfig mips allyesconfig mips allnoconfig mips allmodconfig parisc defconfig parisc allyesconfig parisc allmodconfig powerpc defconfig powerpc allyesconfig powerpc rhel-kconfig powerpc allmodconfig powerpc allnoconfig x86_64 randconfig-a002-20200628 x86_64 randconfig-a004-20200628 x86_64 randconfig-a003-20200628 x86_64 randconfig-a005-20200628 x86_64 randconfig-a001-20200628 x86_64 randconfig-a006-20200628 i386 randconfig-a002-20200624 i386 randconfig-a006-20200624 i386 randconfig-a003-20200624 i386 randconfig-a001-20200624 i386 randconfig-a005-20200624 i386 randconfig-a004-20200624 i386 randconfig-a006-20200628 i386 randconfig-a002-20200628 i386 randconfig-a003-20200628 i386 randconfig-a001-20200628 i386 randconfig-a005-20200628 i386 randconfig-a004-20200628 i386 randconfig-a013-20200628 i386 randconfig-a016-20200628 i386 randconfig-a014-20200628 i386 randconfig-a012-20200628 i386 randconfig-a015-20200628 i386 randconfig-a011-20200628 riscvallyesconfig riscv allnoconfig riscv
[PATCH] staging: media: atomisp: i2c: atomisp-ov2680.c: fixed a brace coding style issue.
Fixed a coding style issue. Signed-off-by: B K Karthik --- drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 90d125ba080f..c90730513438 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -495,11 +495,11 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 value) ret = ov2680_read_reg(client, 1, OV2680_MIRROR_REG, &val); if (ret) return ret; - if (value) { + if (value) val |= OV2680_FLIP_MIRROR_BIT_ENABLE; - } else { + else val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE; - } + ret = ov2680_write_reg(client, 1, OV2680_MIRROR_REG, val); if (ret) -- 2.20.1 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel