LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/3] dgnc: Remove unneeded dgnc_state array of strings
@ 2015-03-10 19:29 Giedrius Statkevičius
  2015-03-10 19:29 ` [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro Giedrius Statkevičius
  2015-03-10 19:29 ` [PATCH 3/3] dgnc: clean up comments at start of files Giedrius Statkevičius
  0 siblings, 2 replies; 5+ messages in thread
From: Giedrius Statkevičius @ 2015-03-10 19:29 UTC (permalink / raw)
  To: lidza.louina, markh
  Cc: gregkh, driverdev-devel, devel, linux-kernel, Giedrius Statkevičius

Dgnc_state array of strings is never used anywhere and it seems pretty
useless anyway since the board state enum names speak for themselves.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 8 --------
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 2 files changed, 9 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index fa1ee79..5ea6b19 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -139,14 +139,6 @@ static struct pci_driver dgnc_driver = {
 	.id_table       = dgnc_pci_tbl,
 };
 
-
-char *dgnc_state_text[] = {
-	"Board Failed",
-	"Board Found",
-	"Board READY",
-};
-
-
 /************************************************************************
  *
  * Driver load/unload functions
diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
index 734bdc2..3f840f5 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -403,6 +403,5 @@ extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern uint		dgnc_NumBoards;		/* Total number of boards */
 extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board structs */
-extern char		*dgnc_state_text[];	/* Array of state text */
 
 #endif
-- 
2.3.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro
  2015-03-10 19:29 [PATCH 1/3] dgnc: Remove unneeded dgnc_state array of strings Giedrius Statkevičius
@ 2015-03-10 19:29 ` Giedrius Statkevičius
  2015-03-11  8:45   ` Dan Carpenter
  2015-03-12 10:13   ` Greg KH
  2015-03-10 19:29 ` [PATCH 3/3] dgnc: clean up comments at start of files Giedrius Statkevičius
  1 sibling, 2 replies; 5+ messages in thread
From: Giedrius Statkevičius @ 2015-03-10 19:29 UTC (permalink / raw)
  To: lidza.louina, markh
  Cc: gregkh, driverdev-devel, devel, linux-kernel, Giedrius Statkevičius

In sysfs methods struct device is guaranteed to not be NULL thus bd will
not be NULL in any way. Also, checking for bd->magic != DGNC_BOARD_MAGIC
and bd->state != BOARD_READY is redundant because we already don't
initialize broken boards since "dgnc: Don't save boards in memory that
have failed to initialize" and make sysfs files after initializing the
board in dgnc_driver.c or IOW they are already set for successfully
initialized boards before their sysfs files created (412 and 593 lines
in dgnc_driver.c).

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
 drivers/staging/dgnc/dgnc_sysfs.c | 96 ++++++++++-----------------------------
 1 file changed, 23 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index a72e353..be13eb0 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -105,28 +105,10 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
 	driver_remove_file(driverfs, &driver_attr_pollrate);
 }
 
-
-#define DGNC_VERIFY_BOARD(p, bd)				\
-	do {							\
-		if (!p)						\
-			return 0;				\
-								\
-		bd = dev_get_drvdata(p);			\
-		if (!bd || bd->magic != DGNC_BOARD_MAGIC)	\
-			return 0;				\
-		if (bd->state != BOARD_READY)			\
-			return 0;				\
-	} while (0)
-
-
-
 static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	count += sprintf(buf + count, "\n      0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F");
 	for (i = 0; i < 0x40 * 2; i++) {
@@ -142,10 +124,8 @@ static DEVICE_ATTR(vpd, S_IRUSR, dgnc_vpd_show, NULL);
 
 static ssize_t dgnc_serial_number_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
 	int count = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	if (bd->serial_num[0] == '\0')
 		count += sprintf(buf + count, "<UNKNOWN>\n");
@@ -159,11 +139,8 @@ static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL);
 
 static ssize_t dgnc_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count,
@@ -177,11 +154,8 @@ static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL);
 
 static ssize_t dgnc_ports_baud_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count +=  snprintf(buf + count, PAGE_SIZE - count,
@@ -194,11 +168,8 @@ static DEVICE_ATTR(ports_baud, S_IRUSR, dgnc_ports_baud_show, NULL);
 
 static ssize_t dgnc_ports_msignals_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		if (bd->channels[i]->ch_open_count) {
@@ -222,11 +193,8 @@ static DEVICE_ATTR(ports_msignals, S_IRUSR, dgnc_ports_msignals_show, NULL);
 
 static ssize_t dgnc_ports_iflag_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
@@ -239,11 +207,8 @@ static DEVICE_ATTR(ports_iflag, S_IRUSR, dgnc_ports_iflag_show, NULL);
 
 static ssize_t dgnc_ports_cflag_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
@@ -256,11 +221,8 @@ static DEVICE_ATTR(ports_cflag, S_IRUSR, dgnc_ports_cflag_show, NULL);
 
 static ssize_t dgnc_ports_oflag_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
@@ -273,11 +235,8 @@ static DEVICE_ATTR(ports_oflag, S_IRUSR, dgnc_ports_oflag_show, NULL);
 
 static ssize_t dgnc_ports_lflag_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
@@ -290,11 +249,8 @@ static DEVICE_ATTR(ports_lflag, S_IRUSR, dgnc_ports_lflag_show, NULL);
 
 static ssize_t dgnc_ports_digi_flag_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
@@ -307,11 +263,8 @@ static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgnc_ports_digi_flag_show, NULL);
 
 static ssize_t dgnc_ports_rxcount_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
@@ -324,11 +277,8 @@ static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgnc_ports_rxcount_show, NULL);
 
 static ssize_t dgnc_ports_txcount_show(struct device *p, struct device_attribute *attr, char *buf)
 {
-	struct dgnc_board *bd;
-	int count = 0;
-	int i = 0;
-
-	DGNC_VERIFY_BOARD(p, bd);
+	int count = 0, i = 0;
+	struct dgnc_board *bd = dev_get_drvdata(p);
 
 	for (i = 0; i < bd->nasync; i++) {
 		count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
-- 
2.3.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/3] dgnc: clean up comments at start of files
  2015-03-10 19:29 [PATCH 1/3] dgnc: Remove unneeded dgnc_state array of strings Giedrius Statkevičius
  2015-03-10 19:29 ` [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro Giedrius Statkevičius
@ 2015-03-10 19:29 ` Giedrius Statkevičius
  1 sibling, 0 replies; 5+ messages in thread
From: Giedrius Statkevičius @ 2015-03-10 19:29 UTC (permalink / raw)
  To: lidza.louina, markh
  Cc: gregkh, driverdev-devel, devel, linux-kernel, Giedrius Statkevičius

Remove FSF address because it's known in the past that it has changed.
Also, remove the pointless "do not change the coding style" comments
because it's one of the reasons why it's in staging and it's quite
contradictory to what it says in TODO. Also, they contain wrong e-mails
of people which are responsible for these drivers - see TODO or
MAINTAINERS for that. We can preserve the original copyright at the top
of the most files because it shows who originally made them.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c     | 16 ----------------
 drivers/staging/dgnc/dgnc_cls.h     |  7 -------
 drivers/staging/dgnc/dgnc_driver.c  | 16 ----------------
 drivers/staging/dgnc/dgnc_driver.h  |  6 ------
 drivers/staging/dgnc/dgnc_kcompat.h |  6 ------
 drivers/staging/dgnc/dgnc_mgmt.c    | 16 ----------------
 drivers/staging/dgnc/dgnc_mgmt.h    |  6 ------
 drivers/staging/dgnc/dgnc_neo.c     | 16 ----------------
 drivers/staging/dgnc/dgnc_neo.h     |  7 -------
 drivers/staging/dgnc/dgnc_pci.h     |  6 ------
 drivers/staging/dgnc/dgnc_sysfs.c   | 16 ----------------
 drivers/staging/dgnc/dgnc_sysfs.h   |  6 ------
 drivers/staging/dgnc/dgnc_tty.c     | 15 ---------------
 drivers/staging/dgnc/dgnc_tty.h     |  6 ------
 drivers/staging/dgnc/dgnc_types.h   |  6 ------
 drivers/staging/dgnc/digi.h         |  6 ------
 drivers/staging/dgnc/dpacompat.h    |  6 ------
 17 files changed, 163 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index bedc522..29f89e5 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -11,22 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
- *
  */
 
 #include <linux/kernel.h>
diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h
index 032e4a4..84e3227 100644
--- a/drivers/staging/dgnc/dgnc_cls.h
+++ b/drivers/staging/dgnc/dgnc_cls.h
@@ -11,13 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
  */
 
 #ifndef __DGNC_CLS_H
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 5ea6b19..db7766c 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -11,22 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
- *
  */
 
 
diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h
index 3f840f5..ff0cccb 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -12,12 +12,6 @@
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
  *************************************************************************
  *
  * Driver includes
diff --git a/drivers/staging/dgnc/dgnc_kcompat.h b/drivers/staging/dgnc/dgnc_kcompat.h
index 566cad0..2206038 100644
--- a/drivers/staging/dgnc/dgnc_kcompat.h
+++ b/drivers/staging/dgnc/dgnc_kcompat.h
@@ -12,12 +12,6 @@
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
  *************************************************************************
  *
  * This file is intended to contain all the kernel "differences" between the
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 5544a8e..c4c0fe1 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -11,22 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
- *
  */
 
 /************************************************************************
diff --git a/drivers/staging/dgnc/dgnc_mgmt.h b/drivers/staging/dgnc/dgnc_mgmt.h
index 567f687..708abe9 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.h
+++ b/drivers/staging/dgnc/dgnc_mgmt.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DGNC_MGMT_H
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 1268aa9..f81df79 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -11,22 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
- *
  */
 
 
diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h
index 1a4abb1..d7e764a 100644
--- a/drivers/staging/dgnc/dgnc_neo.h
+++ b/drivers/staging/dgnc/dgnc_neo.h
@@ -11,13 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
  */
 
 #ifndef __DGNC_NEO_H
diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h
index 5b6f76d..617d40d 100644
--- a/drivers/staging/dgnc/dgnc_pci.h
+++ b/drivers/staging/dgnc/dgnc_pci.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DGNC_PCI_H
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index be13eb0..f290fcd 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -11,22 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *      NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *      This is shared code between Digi's CVS archive and the
- *      Linux Kernel sources.
- *      Changing the source just for reformatting needlessly breaks
- *      our CVS diff history.
- *
- *      Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *      Thank you.
- *
  */
 
 
diff --git a/drivers/staging/dgnc/dgnc_sysfs.h b/drivers/staging/dgnc/dgnc_sysfs.h
index 68c0de5..2758914 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.h
+++ b/drivers/staging/dgnc/dgnc_sysfs.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DGNC_SYSFS_H
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 8179342..d78e5bf 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -11,21 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *	NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- *	This is shared code between Digi's CVS archive and the
- *	Linux Kernel sources.
- *	Changing the source just for reformatting needlessly breaks
- *	our CVS diff history.
- *
- *	Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- *	Thank you.
  */
 
 /************************************************************************
diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h
index 3975f04..21d3369 100644
--- a/drivers/staging/dgnc/dgnc_tty.h
+++ b/drivers/staging/dgnc/dgnc_tty.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DGNC_TTY_H
diff --git a/drivers/staging/dgnc/dgnc_types.h b/drivers/staging/dgnc/dgnc_types.h
index 3aafced..2853d16 100644
--- a/drivers/staging/dgnc/dgnc_types.h
+++ b/drivers/staging/dgnc/dgnc_types.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DGNC_TYPES_H
diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h
index d6e0b9f..554fbeb 100644
--- a/drivers/staging/dgnc/digi.h
+++ b/drivers/staging/dgnc/digi.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *	NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 #ifndef __DIGI_H
diff --git a/drivers/staging/dgnc/dpacompat.h b/drivers/staging/dgnc/dpacompat.h
index 33cb394..f41a0e1 100644
--- a/drivers/staging/dgnc/dpacompat.h
+++ b/drivers/staging/dgnc/dpacompat.h
@@ -11,12 +11,6 @@
  * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *      NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  */
 
 
-- 
2.3.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro
  2015-03-10 19:29 ` [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro Giedrius Statkevičius
@ 2015-03-11  8:45   ` Dan Carpenter
  2015-03-12 10:13   ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2015-03-11  8:45 UTC (permalink / raw)
  To: Giedrius Statkevičius
  Cc: lidza.louina, markh, devel, gregkh, driverdev-devel, linux-kernel

On Tue, Mar 10, 2015 at 09:29:19PM +0200, Giedrius Statkevičius wrote:
>  static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, char *buf)
>  {
> -	struct dgnc_board *bd;
> -	int count = 0;
> -	int i = 0;
> -
> -	DGNC_VERIFY_BOARD(p, bd);
> +	int count = 0, i = 0;

Don't redo the patch, but really these should be on separate lines.
This is an unwritten rule.  :)  Also there is no need to set "i".

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro
  2015-03-10 19:29 ` [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro Giedrius Statkevičius
  2015-03-11  8:45   ` Dan Carpenter
@ 2015-03-12 10:13   ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2015-03-12 10:13 UTC (permalink / raw)
  To: Giedrius Statkevičius
  Cc: lidza.louina, markh, driverdev-devel, devel, linux-kernel

On Tue, Mar 10, 2015 at 09:29:19PM +0200, Giedrius Statkevičius wrote:
> In sysfs methods struct device is guaranteed to not be NULL thus bd will
> not be NULL in any way. Also, checking for bd->magic != DGNC_BOARD_MAGIC
> and bd->state != BOARD_READY is redundant because we already don't
> initialize broken boards since "dgnc: Don't save boards in memory that
> have failed to initialize" and make sysfs files after initializing the
> board in dgnc_driver.c or IOW they are already set for successfully
> initialized boards before their sysfs files created (412 and 593 lines
> in dgnc_driver.c).

As I didn't take your previous patch that this relies on, I can't take
this one at this point in time, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-12 10:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 19:29 [PATCH 1/3] dgnc: Remove unneeded dgnc_state array of strings Giedrius Statkevičius
2015-03-10 19:29 ` [PATCH 2/3] dgnc: remove DGNC_VERIFY_BOARD macro Giedrius Statkevičius
2015-03-11  8:45   ` Dan Carpenter
2015-03-12 10:13   ` Greg KH
2015-03-10 19:29 ` [PATCH 3/3] dgnc: clean up comments at start of files Giedrius Statkevičius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).