Re: [PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
Ok. I will check and send it again. Thanks. Daeseok Youn. 2014-03-09 15:38 GMT+09:00, Greg KH : > On Fri, Mar 07, 2014 at 09:03:04AM +0900, Daeseok Youn wrote: >> >> The mkret() change a value of error from positive to >> negative. This patch is modified to return negative value >> when it failed. It doesn't need to call with function >> for changing from positive to negative. >> >> Signed-off-by: Daeseok Youn >> --- >> drivers/staging/cxt1e1/linux.c | 72 >> +-- >> drivers/staging/cxt1e1/musycc.c|2 +- >> drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- >> 3 files changed, 48 insertions(+), 66 deletions(-) > > This patch doesn't apply to my tree, can you refresh it, and patch 4 and > resend? > > thanks, > > greg k-h > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
Ok. I will check and send it again. Thanks. Daeseok Youn. 2014-03-09 15:38 GMT+09:00, Greg KH gre...@linuxfoundation.org: On Fri, Mar 07, 2014 at 09:03:04AM +0900, Daeseok Youn wrote: The mkret() change a value of error from positive to negative. This patch is modified to return negative value when it failed. It doesn't need to call with function for changing from positive to negative. Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/cxt1e1/linux.c | 72 +-- drivers/staging/cxt1e1/musycc.c|2 +- drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- 3 files changed, 48 insertions(+), 66 deletions(-) This patch doesn't apply to my tree, can you refresh it, and patch 4 and resend? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
On Fri, Mar 07, 2014 at 09:03:04AM +0900, Daeseok Youn wrote: > > The mkret() change a value of error from positive to > negative. This patch is modified to return negative value > when it failed. It doesn't need to call with function > for changing from positive to negative. > > Signed-off-by: Daeseok Youn > --- > drivers/staging/cxt1e1/linux.c | 72 +-- > drivers/staging/cxt1e1/musycc.c|2 +- > drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- > 3 files changed, 48 insertions(+), 66 deletions(-) This patch doesn't apply to my tree, can you refresh it, and patch 4 and resend? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
On Fri, Mar 07, 2014 at 09:03:04AM +0900, Daeseok Youn wrote: The mkret() change a value of error from positive to negative. This patch is modified to return negative value when it failed. It doesn't need to call with function for changing from positive to negative. Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/cxt1e1/linux.c | 72 +-- drivers/staging/cxt1e1/musycc.c|2 +- drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- 3 files changed, 48 insertions(+), 66 deletions(-) This patch doesn't apply to my tree, can you refresh it, and patch 4 and resend? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
The mkret() change a value of error from positive to negative. This patch is modified to return negative value when it failed. It doesn't need to call with function for changing from positive to negative. Signed-off-by: Daeseok Youn --- drivers/staging/cxt1e1/linux.c | 72 +-- drivers/staging/cxt1e1/musycc.c|2 +- drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- 3 files changed, 48 insertions(+), 66 deletions(-) diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c index 549efd1..5d7ddd4 100644 --- a/drivers/staging/cxt1e1/linux.c +++ b/drivers/staging/cxt1e1/linux.c @@ -145,16 +145,6 @@ get_hdlc_name(hdlc_device *hdlc) return dev->name; } - -static status_t -mkret(int bsd) -{ - if (bsd > 0) - return -bsd; - else - return bsd; -} - /***/ #include @@ -292,8 +282,8 @@ chan_open(struct net_device *ndev) } ret = c4_chan_up(priv->ci, priv->channum); - if (ret) - return -ret; + if (ret < 0) + return ret; try_module_get(THIS_MODULE); netif_start_queue(ndev); return 0; /* no error = success */ @@ -523,8 +513,8 @@ do_get_port(struct net_device *ndev, void *data) if (!ci) return -EINVAL; /* get card info */ - ret = mkret(c4_get_port(ci, pp.portnum)); - if (ret) + ret = c4_get_port(ci, pp.portnum); + if (ret < 0) return ret; if (copy_to_user(data, >port[pp.portnum].p, sizeof(struct sbecom_port_param))) @@ -551,7 +541,7 @@ do_set_port(struct net_device *ndev, void *data) return -ENXIO; memcpy(>port[pp.portnum].p, , sizeof(struct sbecom_port_param)); - return mkret(c4_set_port(ci, pp.portnum)); + return c4_set_port(ci, pp.portnum); } /* work the port loopback mode as per directed */ @@ -566,7 +556,7 @@ do_port_loop(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - return mkret(c4_loop_port(ci, pp.portnum, pp.port_mode)); + return c4_loop_port(ci, pp.portnum, pp.port_mode); } /* set the specified register with the given value / or just read it */ @@ -582,8 +572,8 @@ do_framer_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_frame_rw(ci, )); - if (ret) + ret = c4_frame_rw(ci, ); + if (ret < 0) return ret; if (copy_to_user(data, , sizeof(struct sbecom_port_param))) return -EFAULT; @@ -603,7 +593,8 @@ do_pld_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_pld_rw(ci, )); + + ret = c4_pld_rw(ci, ); if (ret) return ret; if (copy_to_user(data, , sizeof(struct sbecom_port_param))) @@ -624,8 +615,8 @@ do_musycc_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_musycc_rw(ci, )); - if (ret) + ret = c4_musycc_rw(ci, ); + if (ret < 0) return ret; if (copy_to_user(data, , sizeof(struct c4_musycc_param))) return -EFAULT; @@ -642,8 +633,8 @@ do_get_chan(struct net_device *ndev, void *data) sizeof(struct sbecom_chan_param))) return -EFAULT; - ret = mkret(c4_get_chan(cp.channum, )); - if (ret) + ret = c4_get_chan(cp.channum, ); + if (ret < 0) return ret; if (copy_to_user(data, , sizeof(struct sbecom_chan_param))) @@ -655,7 +646,6 @@ static status_t do_set_chan(struct net_device *ndev, void *data) { struct sbecom_chan_param cp; - int ret; ci_t *ci; if (copy_from_user(, data, sizeof(struct sbecom_chan_param))) @@ -663,13 +653,7 @@ do_set_chan(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - switch (ret = mkret(c4_set_chan(cp.channum, ))) - { - case 0: - return 0; - default: - return ret; - } + return c4_set_chan(cp.channum, ); } static status_t @@ -688,8 +672,8 @@ do_create_chan(struct net_device *ndev, void *data) dev = create_chan(ndev, ci, ); if (!dev) return -EBUSY; - ret = mkret(c4_new_chan(ci, cp.port, cp.channum, dev)); - if (ret) { + ret = c4_new_chan(ci, cp.port, cp.channum, dev); + if (ret < 0) { /* needed due to Ioctl calling sequence */ rtnl_unlock();
[PATCH 3/4] staging: cxtie1: remove unneeded mkret() calls
The mkret() change a value of error from positive to negative. This patch is modified to return negative value when it failed. It doesn't need to call with function for changing from positive to negative. Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/cxt1e1/linux.c | 72 +-- drivers/staging/cxt1e1/musycc.c|2 +- drivers/staging/cxt1e1/pmcc4_drv.c | 40 ++-- 3 files changed, 48 insertions(+), 66 deletions(-) diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c index 549efd1..5d7ddd4 100644 --- a/drivers/staging/cxt1e1/linux.c +++ b/drivers/staging/cxt1e1/linux.c @@ -145,16 +145,6 @@ get_hdlc_name(hdlc_device *hdlc) return dev-name; } - -static status_t -mkret(int bsd) -{ - if (bsd 0) - return -bsd; - else - return bsd; -} - /***/ #include linux/workqueue.h @@ -292,8 +282,8 @@ chan_open(struct net_device *ndev) } ret = c4_chan_up(priv-ci, priv-channum); - if (ret) - return -ret; + if (ret 0) + return ret; try_module_get(THIS_MODULE); netif_start_queue(ndev); return 0; /* no error = success */ @@ -523,8 +513,8 @@ do_get_port(struct net_device *ndev, void *data) if (!ci) return -EINVAL; /* get card info */ - ret = mkret(c4_get_port(ci, pp.portnum)); - if (ret) + ret = c4_get_port(ci, pp.portnum); + if (ret 0) return ret; if (copy_to_user(data, ci-port[pp.portnum].p, sizeof(struct sbecom_port_param))) @@ -551,7 +541,7 @@ do_set_port(struct net_device *ndev, void *data) return -ENXIO; memcpy(ci-port[pp.portnum].p, pp, sizeof(struct sbecom_port_param)); - return mkret(c4_set_port(ci, pp.portnum)); + return c4_set_port(ci, pp.portnum); } /* work the port loopback mode as per directed */ @@ -566,7 +556,7 @@ do_port_loop(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - return mkret(c4_loop_port(ci, pp.portnum, pp.port_mode)); + return c4_loop_port(ci, pp.portnum, pp.port_mode); } /* set the specified register with the given value / or just read it */ @@ -582,8 +572,8 @@ do_framer_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_frame_rw(ci, pp)); - if (ret) + ret = c4_frame_rw(ci, pp); + if (ret 0) return ret; if (copy_to_user(data, pp, sizeof(struct sbecom_port_param))) return -EFAULT; @@ -603,7 +593,8 @@ do_pld_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_pld_rw(ci, pp)); + + ret = c4_pld_rw(ci, pp); if (ret) return ret; if (copy_to_user(data, pp, sizeof(struct sbecom_port_param))) @@ -624,8 +615,8 @@ do_musycc_rw(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - ret = mkret(c4_musycc_rw(ci, mp)); - if (ret) + ret = c4_musycc_rw(ci, mp); + if (ret 0) return ret; if (copy_to_user(data, mp, sizeof(struct c4_musycc_param))) return -EFAULT; @@ -642,8 +633,8 @@ do_get_chan(struct net_device *ndev, void *data) sizeof(struct sbecom_chan_param))) return -EFAULT; - ret = mkret(c4_get_chan(cp.channum, cp)); - if (ret) + ret = c4_get_chan(cp.channum, cp); + if (ret 0) return ret; if (copy_to_user(data, cp, sizeof(struct sbecom_chan_param))) @@ -655,7 +646,6 @@ static status_t do_set_chan(struct net_device *ndev, void *data) { struct sbecom_chan_param cp; - int ret; ci_t *ci; if (copy_from_user(cp, data, sizeof(struct sbecom_chan_param))) @@ -663,13 +653,7 @@ do_set_chan(struct net_device *ndev, void *data) ci = get_ci_by_dev(ndev); if (!ci) return -EINVAL; - switch (ret = mkret(c4_set_chan(cp.channum, cp))) - { - case 0: - return 0; - default: - return ret; - } + return c4_set_chan(cp.channum, cp); } static status_t @@ -688,8 +672,8 @@ do_create_chan(struct net_device *ndev, void *data) dev = create_chan(ndev, ci, cp); if (!dev) return -EBUSY; - ret = mkret(c4_new_chan(ci, cp.port, cp.channum, dev)); - if (ret) { + ret = c4_new_chan(ci, cp.port, cp.channum, dev); + if (ret 0) { /* needed due to Ioctl