Re: [PATCH updated] net: add ability to clear per-interface network statistics via procfs

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: James Cammarata <jimi@...>
Cc: Eric Dumazet <dada1@...>, <linux-kernel@...>, Linux Netdev List <netdev@...>
Date: Saturday, May 17, 2008 - 8:31 pm

James Cammarata wrote:

You need to stop your mail client word-wrapping patches.  It looks like
something has converted tabs to spaces, too.

[...]

This is redundant with the kernel-doc comment.


This doesn't check for a space after, which you rely on later on.  (What if
length == 15?)  Also, explicitly writing the length of a literal string is
error-prone.  Seems like it would be better to do something like:

	static const char command[] = "net clear-stats ";
        ...
        if (!strncmp(command, buffer, sizeof(command) - 1)) {


Shouldn't this return an error if the device doesn't exist?


This won't work; the function updates err unconditionally further up!


The context for this chunk seems to be too short.

There are a few formatting oddities; checkpatch.pl will point them out.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH updated] net: add ability to clear per-interface ..., Ben Hutchings, (Sat May 17, 8:31 pm)
Re: [PATCH] net: add ability to clear stats via ethtool - e1..., Stephen Hemminger, (Fri May 30, 10:41 pm)