From: Chris Cesare Date: Thu, 9 Jun 2016 19:39:03 +0000 (-0400) Subject: staging: comedi: serial2002: Fix unnecessary cast styling issue X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c9b0f2b63f47ec35ca5e6588df488bb7e51efb43;p=linux-beck.git staging: comedi: serial2002: Fix unnecessary cast styling issue checkpatch.pl warns that a cast of 1 to (long long) is unnecessary. Remove the cast and also add code to check and make sure that maxdata_list[chan] is not shifted too far, as suggested by Ian Abbott. Signed-off-by Chris Cesare Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index b7779468d75f..0d33e520f635 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -379,7 +379,10 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s, range_table_list[chan] = (const struct comedi_lrange *)&range[j]; } - maxdata_list[chan] = ((long long)1 << cfg[j].bits) - 1; + if (cfg[j].bits < 32) + maxdata_list[chan] = (1u << cfg[j].bits) - 1; + else + maxdata_list[chan] = 0xffffffff; chan++; } }