tests: Run lib/igt.cocci

Found some open coded min()/max()/swap() macros.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
Ville Syrjälä
2014-12-03 14:51:16 +02:00
parent e1bdab9973
commit 8032f526ef
5 changed files with 9 additions and 24 deletions
+2 -2
View File
@@ -33,6 +33,7 @@
#include "intel_chipset.h"
#include "drmtest.h"
#include "igt_aux.h"
#include "igt_debugfs.h"
#include "ioctl_wrappers.h"
@@ -117,8 +118,7 @@ static void read_dfs(const char *fname, char *d, int maxlen)
static void _assert_dfs_entry(const char *fname, const char *s, bool inverse)
{
char tmp[1024];
const int l = strlen(s) < sizeof(tmp) ?
strlen(s) : sizeof(tmp);
const int l = min(strlen(s), sizeof(tmp));
read_dfs(fname, tmp, l + 1);
if (!inverse) {