On Wed, Sep 27, 2017 at 01:14:50PM -0400, David Kershner wrote:
> Clean up unneeded parenthesis reported by checkpatch.pl.
>
> Signed-off-by: David Kershner <[email protected]>
> Reviewed-by: Tim Sell <[email protected]>
> ---
> drivers/staging/unisys/visornic/visornic_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/unisys/visornic/visornic_main.c
> b/drivers/staging/unisys/visornic/visornic_main.c
> index f318888..735d7e5 100644
> --- a/drivers/staging/unisys/visornic/visornic_main.c
> +++ b/drivers/staging/unisys/visornic/visornic_main.c
> @@ -901,7 +901,7 @@ static int visornic_xmit(struct sk_buff *skb, struct
> net_device *netdev)
> return NETDEV_TX_OK;
> }
>
> - if ((len < ETH_MIN_PACKET_SIZE) &&
> + if (len < ETH_MIN_PACKET_SIZE &&
> ((skb_end_pointer(skb) - skb->data) >= ETH_MIN_PACKET_SIZE)) {
^ ^
These parentheses don't add anything either. This condition just seems
weird to me. Shouldn't we just return -EINVAL if the size is
< ETH_MIN_PACKET_SIZE. Or alternatively, can we just allocate more
memory? (I know pants all about networking so I might be completely
wrong).
> /* pad the packet out to minimum size */
> padlen = ETH_MIN_PACKET_SIZE - len;
> @@ -1452,7 +1452,7 @@ static ssize_t info_debugfs_read(struct file *file,
> char __user *buf,
> rcu_read_lock();
> for_each_netdev_rcu(current->nsproxy->net_ns, dev) {
> /* Only consider netdevs that are visornic, and are open */
> - if ((dev->netdev_ops != &visornic_dev_ops) ||
> + if (dev->netdev_ops != &visornic_dev_ops ||
> (!netif_queue_stopped(dev)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Let's remove these parentheses as well.
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel