From: kernel test robot <lkp@intel.com>
To: Tony Chung <tony467913@gmail.com>, johan@kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Tony Chung <tony467913@gmail.com>
Subject: Re: [PATCH] usb: serial: mos7840: Fix coding style warnings
Date: Fri, 25 Oct 2024 01:37:07 +0800 [thread overview]
Message-ID: <202410250138.OhF04o8W-lkp@intel.com> (raw)
In-Reply-To: <20241023091414.18098-1-tony467913@gmail.com>
Hi Tony,
kernel test robot noticed the following build errors:
[auto build test ERROR on johan-usb-serial/usb-next]
[also build test ERROR on johan-usb-serial/usb-linus usb/usb-testing usb/usb-next usb/usb-linus tty/tty-testing tty/tty-next tty/tty-linus linus/master v6.12-rc4 next-20241024]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Tony-Chung/usb-serial-mos7840-Fix-coding-style-warnings/20241023-171615
base: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-next
patch link: https://lore.kernel.org/r/20241023091414.18098-1-tony467913%40gmail.com
patch subject: [PATCH] usb: serial: mos7840: Fix coding style warnings
config: i386-buildonly-randconfig-005-20241024 (https://download.01.org/0day-ci/archive/20241025/202410250138.OhF04o8W-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410250138.OhF04o8W-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410250138.OhF04o8W-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/usb/serial/mos7840.c:15:
In file included from include/linux/tty.h:11:
In file included from include/linux/tty_port.h:5:
In file included from include/linux/kfifo.h:40:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
drivers/usb/serial/mos7840.c:923:25: warning: missing terminating '"' character [-Winvalid-pp-token]
923 | dev_err_console(port, "%s - usb_submit_urb(write bulk) failed
| ^
drivers/usb/serial/mos7840.c:924:22: warning: missing terminating '"' character [-Winvalid-pp-token]
924 | with status = %d\n", __func__, status);
| ^
>> drivers/usb/serial/mos7840.c:923:3: error: unterminated function-like macro invocation
923 | dev_err_console(port, "%s - usb_submit_urb(write bulk) failed
| ^
include/linux/usb/serial.h:399:9: note: macro 'dev_err_console' defined here
399 | #define dev_err_console(usport, fmt, ...) \
| ^
>> drivers/usb/serial/mos7840.c:1832:23: error: expected '}'
1832 | MODULE_LICENSE("GPL");
| ^
drivers/usb/serial/mos7840.c:921:14: note: to match this '{'
921 | if (status) {
| ^
>> drivers/usb/serial/mos7840.c:1832:23: error: expected '}'
1832 | MODULE_LICENSE("GPL");
| ^
drivers/usb/serial/mos7840.c:851:1: note: to match this '{'
851 | {
| ^
>> drivers/usb/serial/mos7840.c:879:8: error: use of undeclared label 'exit'
879 | goto exit;
| ^
3 warnings and 4 errors generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GET_FREE_REGION
Depends on [n]: SPARSEMEM [=n]
Selected by [y]:
- RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]
vim +923 drivers/usb/serial/mos7840.c
840
841 /*****************************************************************************
842 * mos7840_write
843 * this function is called by the tty driver when data should be written to
844 * the port.
845 * If successful, we return the number of bytes written, otherwise we
846 * return a negative error number.
847 *****************************************************************************/
848
849 static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
850 const unsigned char *data, int count)
851 {
852 struct moschip_port *mos7840_port = usb_get_serial_port_data(port);
853 struct usb_serial *serial = port->serial;
854 int status;
855 int i;
856 int bytes_sent = 0;
857 int transfer_size;
858 unsigned long flags;
859 struct urb *urb;
860 /* __u16 Data; */
861 const unsigned char *current_position = data;
862
863 /* try to find a free urb in the list */
864 urb = NULL;
865
866 spin_lock_irqsave(&mos7840_port->pool_lock, flags);
867 for (i = 0; i < NUM_URBS; ++i) {
868 if (!mos7840_port->busy[i]) {
869 mos7840_port->busy[i] = 1;
870 urb = mos7840_port->write_urb_pool[i];
871 dev_dbg(&port->dev, "URB:%d\n", i);
872 break;
873 }
874 }
875 spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
876
877 if (urb == NULL) {
878 dev_dbg(&port->dev, "%s - no more free urbs\n", __func__);
> 879 goto exit;
880 }
881
882 if (urb->transfer_buffer == NULL) {
883 urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
884 GFP_ATOMIC);
885 if (!urb->transfer_buffer) {
886 bytes_sent = -ENOMEM;
887 goto exit;
888 }
889 }
890 transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE);
891
892 memcpy(urb->transfer_buffer, current_position, transfer_size);
893
894 /* fill urb with data and submit */
895 if ((serial->num_ports == 2) && (((__u16)port->port_number % 2) != 0)) {
896 usb_fill_bulk_urb(urb,
897 serial->dev,
898 usb_sndbulkpipe(serial->dev,
899 (port->bulk_out_endpointAddress) + 2),
900 urb->transfer_buffer,
901 transfer_size,
902 mos7840_bulk_out_data_callback, mos7840_port);
903 } else {
904 usb_fill_bulk_urb(urb,
905 serial->dev,
906 usb_sndbulkpipe(serial->dev,
907 port->bulk_out_endpointAddress),
908 urb->transfer_buffer,
909 transfer_size,
910 mos7840_bulk_out_data_callback, mos7840_port);
911 }
912
913 dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress);
914
915 if (mos7840_port->has_led)
916 mos7840_led_activity(port);
917
918 /* send it down the pipe */
919 status = usb_submit_urb(urb, GFP_ATOMIC);
920
921 if (status) {
922 mos7840_port->busy[i] = 0;
> 923 dev_err_console(port, "%s - usb_submit_urb(write bulk) failed
924 with status = %d\n", __func__, status);
925 bytes_sent = status;
926 goto exit;
927 }
928 bytes_sent = transfer_size;
929 port->icount.tx += transfer_size;
930 dev_dbg(&port->dev, "icount.tx is %d:\n", port->icount.tx);
931 exit:
932 return bytes_sent;
933
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-10-24 17:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 9:14 [PATCH] usb: serial: mos7840: Fix coding style warnings Tony Chung
2024-10-23 10:04 ` Greg KH
2024-10-24 17:37 ` kernel test robot [this message]
2024-10-24 17:58 ` kernel test robot
2024-10-25 6:17 ` [PATCH v2 0/6] " Tony Chung
2025-02-11 9:15 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 1/6] driver: usb: serial: mos7840: fix " Tony Chung
2025-02-11 9:20 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 2/6] drivers: usb: serial: mos7840: Fix Block comments coding " Tony Chung
2025-02-11 9:27 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 3/6] drivers: usb: serial: mos7840: fix " Tony Chung
2025-02-11 9:28 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 4/6] drivers: usb: serial: mos7840: using '__func__' to replace function name in dbg message Tony Chung
2025-02-11 9:29 ` Johan Hovold
2025-02-11 9:32 ` Greg KH
2025-02-11 9:38 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 5/6] drivers: usb: serial: mos7840: replace 'unsigned' w/ 'unsigned int' Tony Chung
2025-02-11 9:31 ` Johan Hovold
2024-10-25 6:17 ` [PATCH v2 6/6] drivers: usb: serial: mos7840: fix the quoted string split across lines Tony Chung
2025-02-11 9:32 ` Johan Hovold
2024-10-25 7:49 ` [PATCH] usb: serial: mos7840: Fix coding style warnings kernel test robot
2024-10-28 5:27 ` Tony Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202410250138.OhF04o8W-lkp@intel.com \
--to=lkp@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tony467913@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox