Skip to content

Commit

Permalink
Staging: comedi: adl_pci9118: Fix endian sparse warning
Browse files Browse the repository at this point in the history
Fix following sparse warning:
warning: cast to restricted __be16

data is pointer of type void and can be used to store any type of data.
barray and array have the same 16 bit offset.

Signed-off-by: Ksenija Stanojevic <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
KsenijaS authored and gregkh committed Nov 16, 2015
1 parent 212efdb commit 2aadecb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/comedi/drivers/adl_pci9118.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,11 @@ static void pci9118_ai_munge(struct comedi_device *dev,
unsigned short *array = data;
unsigned int num_samples = comedi_bytes_to_samples(s, num_bytes);
unsigned int i;
__be16 *barray = data;

for (i = 0; i < num_samples; i++) {
if (devpriv->usedma)
array[i] = be16_to_cpu(array[i]);
array[i] = be16_to_cpu(barray[i]);
if (s->maxdata == 0xffff)
array[i] ^= 0x8000;
else
Expand Down

0 comments on commit 2aadecb

Please sign in to comment.