Commit 8c8022fc authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: jr3_pci: pass transform by reference

Local function `set_transforms` has a parameter of type `struct
jr3_pci_transform`.  This has a size 32 bytes, which is quite large for
passing around in a function call.  Change it to use type `const struct
jr3_pci_transform *`.  (In practice, it is probably inlined by the
compiler anyway, but doing this seems to save a few bytes.)
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4af8c819
...@@ -141,19 +141,19 @@ static int is_complete(struct jr3_channel __iomem *channel) ...@@ -141,19 +141,19 @@ static int is_complete(struct jr3_channel __iomem *channel)
} }
static void set_transforms(struct jr3_channel __iomem *channel, static void set_transforms(struct jr3_channel __iomem *channel,
struct jr3_pci_transform transf, short num) const struct jr3_pci_transform *transf, short num)
{ {
int i; int i;
num &= 0x000f; /* Make sure that 0 <= num <= 15 */ num &= 0x000f; /* Make sure that 0 <= num <= 15 */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
set_u16(&channel->transforms[num].link[i].link_type, set_u16(&channel->transforms[num].link[i].link_type,
transf.link[i].link_type); transf->link[i].link_type);
udelay(1); udelay(1);
set_s16(&channel->transforms[num].link[i].link_amount, set_s16(&channel->transforms[num].link[i].link_amount,
transf.link[i].link_amount); transf->link[i].link_amount);
udelay(1); udelay(1);
if (transf.link[i].link_type == end_x_form) if (transf->link[i].link_type == end_x_form)
break; break;
} }
} }
...@@ -505,7 +505,7 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s) ...@@ -505,7 +505,7 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s)
transf.link[i].link_amount = 0; transf.link[i].link_amount = 0;
} }
set_transforms(channel, transf, 0); set_transforms(channel, &transf, 0);
use_transform(channel, 0); use_transform(channel, 0);
spriv->state = state_jr3_init_transform_complete; spriv->state = state_jr3_init_transform_complete;
/* Allow 20 ms for completion */ /* Allow 20 ms for completion */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment