svn commit: r321861 - vendor-sys/ena-com/dist

Marcin Wojtas mw at FreeBSD.org
Tue Aug 1 10:44:31 UTC 2017


Author: mw
Date: Tue Aug  1 10:44:29 2017
New Revision: 321861
URL: https://svnweb.freebsd.org/changeset/base/321861

Log:
  ena_plat.h: delete WARN_ON dead code
  
  gcc issues a "useless statement" error about unlikely(__ret_warn_on); in the
  WARN_ON in ena_plat.h. In WARN_ONs defined elsewhere, this terminal statement is
  part of a statement-expression, but not here. Rather than make this WARN_ON like
  the others, just delete it, as it is apparently unused anyway: the only caller
  (ENA_ASSERT) always passes false.
  
  This fixes buildkernel for ena-com with gcc.
  
  Submitted by: rlibby
  Reviewed by: mw
  Approved by: cognet (mentor)

Modified:
  vendor-sys/ena-com/dist/ena_plat.h

Modified: vendor-sys/ena-com/dist/ena_plat.h
==============================================================================
--- vendor-sys/ena-com/dist/ena_plat.h	Tue Aug  1 10:11:20 2017	(r321860)
+++ vendor-sys/ena-com/dist/ena_plat.h	Tue Aug  1 10:44:29 2017	(r321861)
@@ -139,21 +139,12 @@ extern struct ena_bus_space ebs;
 #define MAX_ERRNO 4095
 #define IS_ERR_VALUE(x) unlikely((x) <= (unsigned long)MAX_ERRNO)
 
-#define WARN_ON(condition)						\
-	do {								\
-		int __ret_warn_on = !!(condition);			\
-		if (unlikely(__ret_warn_on))				\
-			printf("%s %s", __FUNCTION__, __FILE__);	\
-		unlikely(__ret_warn_on);				\
-	} while (0)
-
 #define ENA_ASSERT(cond, format, arg...)				\
 	do {								\
 		if (unlikely(!(cond))) {				\
 			ena_trc_err(					\
 				"Assert failed on %s:%s:%d:" format,	\
 				__FILE__, __func__, __LINE__, ##arg);	\
-			WARN_ON(cond);					\
 		}							\
 	} while (0)
 


More information about the svn-src-all mailing list