Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: dgrp: fix some warnings

Just squashing these to get them out of the analysis queue.

nd_ps_desc is an array not a pointer so comparing it with NULL is silly (be
nice if gcc shouted about this). And there are some slightly pointless
comparisons too.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
720a9bec 69afc090

+5 -2
+1 -1
drivers/staging/dgrp/dgrp_dpa_ops.c
··· 387 387 388 388 port = getchan.ch_port; 389 389 390 - if (port < 0 || port > nd->nd_chan_count) 390 + if (port > nd->nd_chan_count) 391 391 return -EINVAL; 392 392 393 393 ch = nd->nd_chan + port;
+3
drivers/staging/dgrp/dgrp_net_ops.c
··· 1671 1671 * do the job. 1672 1672 */ 1673 1673 1674 + /* FIXME: jiffies - ch->ch_waketime can never 1675 + be < 0. Someone needs to work out what is 1676 + actually intended here */ 1674 1677 if (ch->ch_pun.un_open_count && 1675 1678 (ch->ch_pun.un_flag & 1676 1679 (UN_EMPTY|UN_TIME|UN_LOW|UN_PWAIT)) != 0) {
+1 -1
drivers/staging/dgrp/dgrp_sysfs.c
··· 177 177 if (!nd) 178 178 return 0; 179 179 180 - if (nd->nd_state == NS_READY && nd->nd_ps_desc) 180 + if (nd->nd_state == NS_READY) 181 181 return snprintf(buf, PAGE_SIZE, "%s\n", nd->nd_ps_desc); 182 182 return 0; 183 183 }