[PATCH linux-next] ieee802154: cc2520: remove the unneeded result variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xu Panda <xu.panda@xxxxxxxxxx>

Return the value cc2520_write_register() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Xu Panda <xu.panda@xxxxxxxxxx>
---
 drivers/net/ieee802154/cc2520.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index c69b87d3837d..abe331c795df 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -632,7 +632,6 @@ static int
 cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
 {
        struct cc2520_private *priv = hw->priv;
-       int ret;

        dev_dbg(&priv->spi->dev, "trying to set channel\n");

@@ -640,10 +639,8 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
        WARN_ON(channel < CC2520_MINCHANNEL);
        WARN_ON(channel > CC2520_MAXCHANNEL);

-       ret = cc2520_write_register(priv, CC2520_FREQCTRL,
-                                   11 + 5 * (channel - 11));
-
-       return ret;
+       return cc2520_write_register(priv, CC2520_FREQCTRL,
+                                    11 + 5 * (channel - 11));
 }

 static int
-- 
2.15.2




[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux