diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-07-01 14:48:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-21 11:04:19 +0300 |
commit | b88668fec959fec0e77196455ec82778d8065941 (patch) | |
tree | 76ff3eee45a97759ba0a60c22eb5b4b581447409 /drivers/usb/gadget | |
parent | ec017d6b60f8aa400987fe95cd839e9ba5dda41d (diff) | |
download | linux-b88668fec959fec0e77196455ec82778d8065941.tar.xz |
usb: gadget: f_ncm: remove spurious if statement
the current logic is:
struct sk_buff *skb2 = NULL;
...
if (!skb && !ncm->skb_tx_data)
return NULL;
if (skb) {
...
} else if (ncm->skb_tx_data)
...
}
return skb2;
Which means that first if statement is simply not needed.
Cc: Brooke Basile <brookebasile@gmail.com>
Cc: "Bryan O'Donoghue" <bryan.odonoghue@linaro.org>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Link: https://lore.kernel.org/r/20210701114834.884597-4-zenczykowski@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_ncm.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 77f55b3c805a..cab17ae4fa34 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1025,9 +1025,6 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port, const int rem = le16_to_cpu(ntb_parameters.wNdpInPayloadRemainder); const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; - if (!skb && !ncm->skb_tx_data) - return NULL; - if (skb) { /* Add the CRC if required up front */ if (ncm->is_crc) { |