Commit 720a9bec authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 69afc090
...@@ -387,7 +387,7 @@ static long dgrp_dpa_ioctl(struct file *file, unsigned int cmd, ...@@ -387,7 +387,7 @@ static long dgrp_dpa_ioctl(struct file *file, unsigned int cmd,
port = getchan.ch_port; port = getchan.ch_port;
if (port < 0 || port > nd->nd_chan_count) if (port > nd->nd_chan_count)
return -EINVAL; return -EINVAL;
ch = nd->nd_chan + port; ch = nd->nd_chan + port;
......
...@@ -1671,6 +1671,9 @@ static int dgrp_send(struct nd_struct *nd, long tmax) ...@@ -1671,6 +1671,9 @@ static int dgrp_send(struct nd_struct *nd, long tmax)
* do the job. * do the job.
*/ */
/* FIXME: jiffies - ch->ch_waketime can never
be < 0. Someone needs to work out what is
actually intended here */
if (ch->ch_pun.un_open_count && if (ch->ch_pun.un_open_count &&
(ch->ch_pun.un_flag & (ch->ch_pun.un_flag &
(UN_EMPTY|UN_TIME|UN_LOW|UN_PWAIT)) != 0) { (UN_EMPTY|UN_TIME|UN_LOW|UN_PWAIT)) != 0) {
......
...@@ -177,7 +177,7 @@ static ssize_t dgrp_node_description_show(struct device *c, ...@@ -177,7 +177,7 @@ static ssize_t dgrp_node_description_show(struct device *c,
if (!nd) if (!nd)
return 0; return 0;
if (nd->nd_state == NS_READY && nd->nd_ps_desc) if (nd->nd_state == NS_READY)
return snprintf(buf, PAGE_SIZE, "%s\n", nd->nd_ps_desc); return snprintf(buf, PAGE_SIZE, "%s\n", nd->nd_ps_desc);
return 0; return 0;
} }
......
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