net: sierra: shut up sparse restricted type warnings
PATCH 1/1 net: sierra: shut up sparse restricted type warnings
Removes the warnings
drivers/net/usb/sierra_net.c:343:45: warning: incorrect type in assignment (different base types)
drivers/net/usb/sierra_net.c:343:45: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/net/usb/sierra_net.c:343:45: got restricted __be16 [usertype] <noident>
and
drivers/net/usb/sierra_net.c:658:18: warning: cast to restricted __le16
--- drivers/net/usb/sierra_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/sierra_net.c +2 -2
@@ -340,7 +340,7 @@ static void sierra_net_set_ctx_index(struct sierra_net_data *priv, u8 ctx_ix)dev_dbg (&(priv->usbnet->udev->dev),"%s %d" , __func__, ctx_ix); priv->tx_hdr_template[0 ] =0x3F ; priv->tx_hdr_template[1 ] = ctx_ix; - *((u16 *)&priv->tx_hdr_template[2 ]) = + *((__be16 *)&priv->tx_hdr_template[2 ]) =cpu_to_be16 (SIERRA_NET_HIP_EXT_IP_OUT_ID ); }
@@ -632,7 +632,7 @@ static int sierra_net_change_mtu(struct net_device *net, int new_mtu)static int sierra_net_get_fw_attr (struct usbnet *dev,u16 *datap) {int result =0 ; -u16 *attrdata; +__le16 *attrdata; attrdata =kmalloc (sizeof (*attrdata),GFP_KERNEL );if (!attrdata)
Signature · 6 lines
1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1351237449-23643-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org
PATCH 1/1 net: cdc_ncm: big endian fix
Probably doesn't matter much since the value is used as a boolean anyway, but it removes the sparse warning:
drivers/net/usb/cdc_ncm.c:1090:32: warning: incorrect type in assignment (different base types)
drivers/net/usb/cdc_ncm.c:1090:32: expected unsigned short [unsigned] [usertype] connected
drivers/net/usb/cdc_ncm.c:1090:32: got restricted __le16 [usertype] wValue
--- drivers/net/usb/cdc_ncm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/cdc_ncm.c +1 -1
@@ -1087,7 +1087,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)* USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be * sent by device after USB_CDC_NOTIFY_SPEED_CHANGE. */ - ctx->connected = event->wValue; + ctx->connected =le16_to_cpu (event->wValue); printk(KERN_INFO KBUILD_MODNAME ": %s: network connection:" " %sconnected\n",
Signature · 6 lines
1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH net-next] net: cdc_ncm: big endian fix
From: Bjørn Mork <[email protected]>
Date: Fri, 26 Oct 2012 09:44:08 +0200
Quoted 8 lines
Probably doesn't matter much since the value is used as a boolean anyway, but it removes the sparse warning:
drivers/net/usb/cdc_ncm.c:1090:32: warning: incorrect type in assignment (different base types)
drivers/net/usb/cdc_ncm.c:1090:32: expected unsigned short [unsigned] [usertype] connected
drivers/net/usb/cdc_ncm.c:1090:32: got restricted__le16[usertype] wValueSigned-off-by Bjørn Mork <[email protected]>
Applied.
PATCH v2 1/1 net: sierra: shut up sparse restricted type warnings
In reply to a message not in the archiveRemoves the warnings
drivers/net/usb/sierra_net.c:343:45: warning: incorrect type in assignment (different base types)
drivers/net/usb/sierra_net.c:343:45: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/net/usb/sierra_net.c:343:45: got restricted __be16 [usertype] <noident>
and
drivers/net/usb/sierra_net.c:658:18: warning: cast to restricted __le16
---
v2: rebased on top of the latest fixes which were just applied to net-next
drivers/net/usb/sierra_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/sierra_net.c +2 -2
@@ -339,7 +339,7 @@ static void sierra_net_set_ctx_index(struct sierra_net_data *priv, u8 ctx_ix)dev_dbg (&(priv->usbnet->udev->dev),"%s %d" , __func__, ctx_ix); priv->tx_hdr_template[0 ] =0x3F ; priv->tx_hdr_template[1 ] = ctx_ix; - *((u16 *)&priv->tx_hdr_template[2 ]) = + *((__be16 *)&priv->tx_hdr_template[2 ]) =cpu_to_be16 (SIERRA_NET_HIP_EXT_IP_OUT_ID ); }
@@ -631,7 +631,7 @@ static int sierra_net_change_mtu(struct net_device *net, int new_mtu)static int sierra_net_get_fw_attr (struct usbnet *dev,u16 *datap) {int result =0 ; -u16 attrdata; +__le16 attrdata; result = usbnet_read_cmd(dev,/* _u8 vendor specific request */
Signature · 6 lines
1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Bjørn Mork <[email protected]>
Date: Fri, 26 Oct 2012 09:44:07 +0200
Quoted 11 lines
Removes the warnings
drivers/net/usb/sierra_net.c:343:45: warning: incorrect type in assignment (different base types)
drivers/net/usb/sierra_net.c:343:45: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/net/usb/sierra_net.c:343:45: got restricted__be16[usertype] <noident>and
drivers/net/usb/sierra_net.c:658:18: warning: cast to restricted__le16Signed-off-by Bjørn Mork <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 net: cdc_ncm: error path lock fix
In reply to Bjørn MorkFixes the sparse warning
drivers/net/usb/cdc_ncm.c:836:9: warning: context imbalance in 'cdc_ncm_txpath_bh' - different lock contexts for basic block
--- drivers/net/usb/cdc_ncm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/usb/cdc_ncm.c +2 -0
@@ -842,6 +842,8 @@ static void cdc_ncm_txpath_bh(unsigned long param)netif_tx_lock_bh (ctx->netdev);usbnet_start_xmit (NULL , ctx->netdev);netif_tx_unlock_bh (ctx->netdev); + }else { +spin_unlock_bh (&ctx->mtx); } }
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1351237449-23643-3-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org
Re: [PATCH net-next] net: cdc_ncm: error path lock fix
From: Bjørn Mork <[email protected]>
Date: Fri, 26 Oct 2012 09:44:09 +0200
Quoted 5 lines
Fixes the sparse warning
drivers/net/usb/cdc_ncm.c:836:9: warning: context imbalance in 'cdc_ncm_txpath_bh' - different lock contexts for basic blockSigned-off-by Bjørn Mork <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html