All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, Josh Hay <joshua.a.hay@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com
Subject: Re: [net-next 06/10] ixgbe: eliminate Smatch warnings in ixgbe_debugfs.c
Date: Wed, 21 Nov 2012 14:04:09 +0300	[thread overview]
Message-ID: <20121121110409.GG6186@mwanda> (raw)
In-Reply-To: <1353494856-12344-7-git-send-email-jeffrey.t.kirsher@intel.com>

On Wed, Nov 21, 2012 at 02:47:32AM -0800, Jeff Kirsher wrote:
> +	len = simple_write_to_buffer(ixgbe_dbg_reg_ops_buf,
> +				     sizeof(ixgbe_dbg_reg_ops_buf)-1,
> +				     ppos,
> +				     buffer,
> +				     count);
> +	if (len < 0)
> +		return -EFAULT;

Any negative return is bad.

	if (len)
		return len;

> +
> +	ixgbe_dbg_reg_ops_buf[len] = '\0';
>  
>  	if (strncmp(ixgbe_dbg_reg_ops_buf, "write", 5) == 0) {
>  		u32 reg, value;
> @@ -187,15 +196,15 @@ static ssize_t ixgbe_dbg_netdev_ops_write(struct file *filp,
>  	if (count >= sizeof(ixgbe_dbg_netdev_ops_buf))
>  		return -ENOSPC;
>  
> -	bytes_not_copied = copy_from_user(ixgbe_dbg_netdev_ops_buf,
> -					  buffer, count);
> -	if (bytes_not_copied < 0)
> -		return bytes_not_copied;
> -	else if (bytes_not_copied < count)
> -		count -= bytes_not_copied;
> -	else
> -		return -ENOSPC;
> -	ixgbe_dbg_netdev_ops_buf[count] = '\0';
> +	len = simple_write_to_buffer(ixgbe_dbg_netdev_ops_buf,
> +				     sizeof(ixgbe_dbg_netdev_ops_buf)-1,
> +				     ppos,
> +				     buffer,
> +				     count);
> +	if (len < 0)
> +		return -EFAULT;

Same.

> +
> +	ixgbe_dbg_netdev_ops_buf[len] = '\0';

regards,
dan carpenter

  reply	other threads:[~2012-11-21 11:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 10:47 [net-next 00/10][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-11-21 10:47 ` [net-next 01/10] ixgbe: Reformat output of ixgbe_dump Jeff Kirsher
2012-11-21 10:47 ` [net-next 02/10] ixgbe: convert to use simple_open() Jeff Kirsher
2012-11-21 10:47 ` [net-next 03/10] ixgbe: use ETQF filter name instead of magic number Jeff Kirsher
2012-11-21 10:47 ` [net-next 04/10] ixgbe: remove needless queuing for L4 ptp packets Jeff Kirsher
2012-11-21 10:47 ` [net-next 05/10] ixgbe: ethtool correctly identify autoneg setting Jeff Kirsher
2012-11-21 10:47 ` [net-next 06/10] ixgbe: eliminate Smatch warnings in ixgbe_debugfs.c Jeff Kirsher
2012-11-21 11:04   ` Dan Carpenter [this message]
2012-11-21 17:04     ` David Miller
2012-11-27  1:06     ` Hay, Joshua A
2012-11-27  7:18       ` Dan Carpenter
2012-11-21 10:47 ` [net-next 07/10] ixgbe: fdb: only allow NUD_PERM fdb entries Jeff Kirsher
2012-11-21 10:47 ` [net-next 08/10] igb: Update PTP Rx filters Jeff Kirsher
2012-11-21 11:37   ` Richard Cochran
2012-11-21 10:47 ` [net-next 09/10] igb: No longer rely on APME to determine WoL settings Jeff Kirsher
2012-11-21 10:47 ` [net-next 10/10] igb: Do not parse past IP header on fragments beyond the first Jeff Kirsher

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=20121121110409.GG6186@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=joshua.a.hay@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /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.