All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] cdc_ncm: Implement the 32-bit version of NCM Transfer Block
Date: Mon, 09 Mar 2020 09:31:45 +0800	[thread overview]
Message-ID: <202003090944.ovsekr7Y%lkp@intel.com> (raw)
In-Reply-To: <20200305203318.8980-1-bay@hackerdom.ru>

[-- Attachment #1: Type: text/plain, Size: 3839 bytes --]

Hi Alexander,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on linus/master v5.6-rc4 next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alexander-Bersenev/cdc_ncm-Implement-the-32-bit-version-of-NCM-Transfer-Block/20200306-061934
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/net/usb/cdc_ncm.c:1175:24: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le16 [usertype] wLength @@    got restricted __le16 [usertype] wLength @@
   drivers/net/usb/cdc_ncm.c:1175:24: sparse:    expected restricted __le16 [usertype] wLength
   drivers/net/usb/cdc_ncm.c:1175:24: sparse:    got restricted __le32 [usertype]

vim +1175 drivers/net/usb/cdc_ncm.c

  1123	
  1124	static struct usb_cdc_ncm_ndp32 *cdc_ncm_ndp32(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign, size_t reserve)
  1125	{
  1126		struct usb_cdc_ncm_ndp32 *ndp32 = NULL;
  1127		struct usb_cdc_ncm_nth32 *nth32 = (void *)skb->data;
  1128		size_t ndpoffset = le32_to_cpu(nth32->dwNdpIndex);
  1129	
  1130		/* If NDP should be moved to the end of the NCM package, we can't follow the
  1131		 * NTH32 header as we would normally do. NDP isn't written to the SKB yet, and
  1132		 * the wNdpIndex field in the header is actually not consistent with reality. It will be later.
  1133		 */
  1134		if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) {
  1135			if (ctx->delayed_ndp32->dwSignature == sign)
  1136				return ctx->delayed_ndp32;
  1137	
  1138			/* We can only push a single NDP to the end. Return
  1139			 * NULL to send what we've already got and queue this
  1140			 * skb for later.
  1141			 */
  1142			else if (ctx->delayed_ndp32->dwSignature)
  1143				return NULL;
  1144		}
  1145	
  1146		/* follow the chain of NDPs, looking for a match */
  1147		while (ndpoffset) {
  1148			ndp32 = (struct usb_cdc_ncm_ndp32 *)(skb->data + ndpoffset);
  1149			if  (ndp32->dwSignature == sign)
  1150				return ndp32;
  1151			ndpoffset = le32_to_cpu(ndp32->dwNextNdpIndex);
  1152		}
  1153	
  1154		/* align new NDP */
  1155		if (!(ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END))
  1156			cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
  1157	
  1158		/* verify that there is room for the NDP and the datagram (reserve) */
  1159		if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
  1160			return NULL;
  1161	
  1162		/* link to it */
  1163		if (ndp32)
  1164			ndp32->dwNextNdpIndex = cpu_to_le32(skb->len);
  1165		else
  1166			nth32->dwNdpIndex = cpu_to_le32(skb->len);
  1167	
  1168		/* push a new empty NDP */
  1169		if (!(ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END))
  1170			ndp32 = skb_put_zero(skb, ctx->max_ndp_size);
  1171		else
  1172			ndp32 = ctx->delayed_ndp32;
  1173	
  1174		ndp32->dwSignature = sign;
> 1175		ndp32->wLength = cpu_to_le32(sizeof(struct usb_cdc_ncm_ndp32) + sizeof(struct usb_cdc_ncm_dpe32));
  1176		return ndp32;
  1177	}
  1178	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  parent reply	other threads:[~2020-03-09  1:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 20:33 [PATCH] cdc_ncm: Implement the 32-bit version of NCM Transfer Block Alexander Bersenev
2020-03-06  1:36 ` kbuild test robot
2020-03-09  1:31 ` kbuild test robot [this message]
2020-03-09  5:04 ` David Miller
2020-03-09 10:17 ` Oliver Neukum
     [not found]   ` <CAPomEdycThBH5D3Eo3dNCPRrEg0W2fQ9JS9j6TbANTDVChVcog@mail.gmail.com>
2020-03-10 14:17     ` Fwd: " Александр Берсенев
2020-03-10 14:24     ` Александр Берсенев
2020-03-10  8:37 ` kbuild test robot
2020-03-12  5:59 ` David Miller

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=202003090944.ovsekr7Y%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.