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  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:	Tue, 26 Aug 2008 12:00:54 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Ron Mercer <ron.mercer@...gic.com>
Cc:	jeff@...zik.org, netdev@...r.kernel.org
Subject: Re: [PATCH 5/6] [RFC] qlge: New Driver: Adding driver header file qlge.h.

Ron Mercer wrote:
> 
> Signed-off-by: Ron Mercer <ron.mercer@...gic.com>
> ---
>  drivers/net/qlge/qlge.h | 1602 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 1602 insertions(+), 0 deletions(-)
>  create mode 100755 drivers/net/qlge/qlge.h
> 
> diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
> new file mode 100755
> index 0000000..11a07fd
> --- /dev/null
> +++ b/drivers/net/qlge/qlge.h
[...]
> +#define PFX "qlge: "
> +#define QPRINTK(nlevel, klevel, fmt, args...) \
> +	((void)((NETIF_MSG_##nlevel & qdev->msg_enable) && \
> +	printk(KERN_##klevel PFX "%s: %s: " fmt, qdev->ndev->name, \
> +		__FUNCTION__ , ## args)))

Macros that refer to local variables are nasty.  qdev should be a macro
parameter.  __FUNCTION__ (gcc extension) should be replaced with __func__
(C99).  Finally, this should call dev_printk() - something like this:

#define QPRINTK(qdev, nlevel, klevel, fmt, args...)		\
	if (!((qdev)->msg_enable & NETIF_MSG_##nlevel))		\
		;						\
	else							\
		dev_printk(KERN_##klevel, &((qdev)->pdev->dev),	\
			   "%s: " fmt, __func__, ##args)

> +/*
> + * IOCB Definitions...
> + */
> +#pragma pack(1)
[...]

Ew, no.  You should use __packed at the end of each structure definition.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists