[PATCH 11/22] staging: comedi: s626: remove MC_TEST macro

Dan Carpenter dan.carpenter at oracle.com
Mon Mar 25 13:00:03 UTC 2013


On Fri, Mar 22, 2013 at 03:58:01PM -0700, H Hartley Sweeten wrote:
> This macro relies on a local variable having a specific name. Replace
> it with a new helper function, s626_mc_test().
> 
> -#define MC_TEST(REGADRS, CTRLWORD)	((readl(devpriv->base_addr+(REGADRS)) & CTRLWORD) != 0)
> +static bool s626_mc_test(struct comedi_device *dev,
> +			 unsigned int cmd, unsigned int reg)
> +{
> +	struct s626_private *devpriv = dev->private;
> +	unsigned int val;
> +
> +	val = readl(devpriv->base_addr + reg);
> +
> +	return (reg & cmd) ? true : false;
                ^^^
This should be "val" instead of "reg".

regards,
dan carpenter




More information about the devel mailing list