From: kernel test robot <lkp@intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: drivers/usb/gadget/udc/fsl_udc_core.c:878:13: warning: variable 'udc' is uninitialized when used here
Date: Fri, 5 Apr 2024 02:59:44 +0800 [thread overview]
Message-ID: <202404050227.TTvcCPBu-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c85af715cac0a951eea97393378e84bb49384734
commit: 6025f20f16c25d262680f6e1040d4bcdc0ecd0f3 usb: gadget: fsl-udc: Replace custom log wrappers by dev_{err,warn,dbg,vdbg}
date: 4 weeks ago
config: powerpc-randconfig-002-20240405 (https://download.01.org/0day-ci/archive/20240405/202404050227.TTvcCPBu-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240405/202404050227.TTvcCPBu-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/202404050227.TTvcCPBu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/usb/gadget/udc/fsl_udc_core.c:878:13: warning: variable 'udc' is uninitialized when used here [-Wuninitialized]
dev_vdbg(&udc->gadget.dev, "%s, bad params\n", __func__);
^~~
include/linux/dev_printk.h:257:18: note: expanded from macro 'dev_vdbg'
#define dev_vdbg dev_dbg
^
include/linux/dev_printk.h:155:18: note: expanded from macro 'dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~
include/linux/dynamic_debug.h:274:7: note: expanded from macro 'dynamic_dev_dbg'
dev, fmt, ##__VA_ARGS__)
^~~
include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
_dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
__dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~
drivers/usb/gadget/udc/fsl_udc_core.c:871:21: note: initialize the variable 'udc' to silence this warning
struct fsl_udc *udc;
^
= NULL
1 warning generated.
vim +/udc +878 drivers/usb/gadget/udc/fsl_udc_core.c
864
865 /* queues (submits) an I/O request to an endpoint */
866 static int
867 fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
868 {
869 struct fsl_ep *ep = container_of(_ep, struct fsl_ep, ep);
870 struct fsl_req *req = container_of(_req, struct fsl_req, req);
871 struct fsl_udc *udc;
872 unsigned long flags;
873 int ret;
874
875 /* catch various bogus parameters */
876 if (!_req || !req->req.complete || !req->req.buf
877 || !list_empty(&req->queue)) {
> 878 dev_vdbg(&udc->gadget.dev, "%s, bad params\n", __func__);
879 return -EINVAL;
880 }
881 if (unlikely(!_ep || !ep->ep.desc)) {
882 dev_vdbg(&udc->gadget.dev, "%s, bad ep\n", __func__);
883 return -EINVAL;
884 }
885 if (usb_endpoint_xfer_isoc(ep->ep.desc)) {
886 if (req->req.length > ep->ep.maxpacket)
887 return -EMSGSIZE;
888 }
889
890 udc = ep->udc;
891 if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN)
892 return -ESHUTDOWN;
893
894 req->ep = ep;
895
896 ret = usb_gadget_map_request(&ep->udc->gadget, &req->req, ep_is_in(ep));
897 if (ret)
898 return ret;
899
900 req->req.status = -EINPROGRESS;
901 req->req.actual = 0;
902 req->dtd_count = 0;
903
904 /* build dtds and push them to device queue */
905 if (!fsl_req_to_dtd(req, gfp_flags)) {
906 spin_lock_irqsave(&udc->lock, flags);
907 fsl_queue_td(ep, req);
908 } else {
909 return -ENOMEM;
910 }
911
912 /* irq handler advances the queue */
913 if (req != NULL)
914 list_add_tail(&req->queue, &ep->queue);
915 spin_unlock_irqrestore(&udc->lock, flags);
916
917 return 0;
918 }
919
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-04 19:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202404050227.TTvcCPBu-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=u.kleine-koenig@pengutronix.de \
/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