]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: dgrp: fix some warnings
authorAlan Cox <alan@linux.intel.com>
Thu, 11 Oct 2012 16:21:03 +0000 (17:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 22:44:30 +0000 (15:44 -0700)
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>
drivers/staging/dgrp/dgrp_dpa_ops.c
drivers/staging/dgrp/dgrp_net_ops.c
drivers/staging/dgrp/dgrp_sysfs.c

index 49e670915e5ca4aec40a1afb96f0a1bfe48cb17d..021cca498f2c510ccb6bcd63a23582e39b094f16 100644 (file)
@@ -387,7 +387,7 @@ static long dgrp_dpa_ioctl(struct file *file, unsigned int cmd,
 
                port = getchan.ch_port;
 
-               if (port < 0 || port > nd->nd_chan_count)
+               if (port > nd->nd_chan_count)
                        return -EINVAL;
 
                ch = nd->nd_chan + port;
index ab839ea3b44cb2f4e69186f82b6efe537cbe2f25..067d975554463b0f63768a0e5ac97b324df12250 100644 (file)
@@ -1671,6 +1671,9 @@ static int dgrp_send(struct nd_struct *nd, long tmax)
                                 * 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 &&
                                    (ch->ch_pun.un_flag &
                                    (UN_EMPTY|UN_TIME|UN_LOW|UN_PWAIT)) != 0) {
index e5a3c88d016e03210d6e77348674f9c57226e64d..129be3caa97eff8340ed9a83cb0e69d2f718fbbb 100644 (file)
@@ -177,7 +177,7 @@ static ssize_t dgrp_node_description_show(struct device *c,
        if (!nd)
                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 0;
 }