lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 06 Mar 2014 11:55:31 +0100
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Mauro Carvalho Chehab <m.chehab@...sung.com>,
	Paul Bolle <pebolle@...cali.nl>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] [media] v4l: omap4iss: Add DEBUG compiler flag

Hi Joe,

On Wednesday 05 March 2014 19:25:47 Joe Perches wrote:
> On Thu, 2014-03-06 at 02:52 +0100, Laurent Pinchart wrote:
> > I've thought about that, but it would require iss.h to be included before
> > all other headers. I've also thought about creating an iss-debug.h header
> > to be included first just to #define DEBUG, but decided to go for
> > handling the OMAP4 ISS debug option in the Makefile instead. If that's
> > ugly and discouraged as reported by Mauro I can try to come up with
> > something else.
> 
> Unless debugging logging statements are in system level static inlines,
> adding #define DEBUG to iss.h should otherwise produce the same output
> as -DDEBUG in a Makefile.

dev_dbg() is defined in include/linux/device.h as

#if defined(CONFIG_DYNAMIC_DEBUG)
#define dev_dbg(dev, format, ...)                    \
do {                                                 \
        dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
} while (0)
#elif defined(DEBUG)
#define dev_dbg(dev, format, arg...)            \
        dev_printk(KERN_DEBUG, dev, format, ##arg)
#else
#define dev_dbg(dev, format, arg...)                            \
({                                                              \
        if (0)                                                  \
                dev_printk(KERN_DEBUG, dev, format, ##arg);     \
        0;                                                      \
})
#endif

We thus need the #define DEBUG it appear before the first time device.h is 
included, either directly or indirectly. Adding #define DEBUG to iss.h won't 
work now as iss.h is included after all system includes (which is the usual 
practice, #include <...> come before #include "...").

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ