From: Romain Forlot Date: Wed, 26 Apr 2017 22:44:17 +0000 (+0200) Subject: Don't use heavy weapon to get some basic calculation X-Git-Tag: 5.0.2~289 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=512336b68da052f167bdfb8f2b9a9992ed3f1688;p=apps%2Fagl-service-can-low-level.git Don't use heavy weapon to get some basic calculation Change-Id: Ibc820dea7efbc2d7a50671ce66804217c6707d56 Signed-off-by: Romain Forlot --- diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.cpp b/CAN-binder/low-can-binding/can/can-bus-dev.cpp index 4737d113..7f7a7624 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include "can-bus.hpp" #include "can-message.hpp" @@ -132,7 +131,7 @@ int can_bus_dev_t::create_rx_filter(const can_signal_t& s) memset(&cfd, 0, sizeof(cfd)); memset(&bcm_msg.msg_head, 0, sizeof(bcm_msg.msg_head)); uint8_t bit_size = s.get_bit_size(); - float val = (float)exp2(bit_size)-1; + float val = (float)(1 << bit_size)-1; bcm_msg.msg_head.opcode = RX_SETUP; bcm_msg.msg_head.can_id = can_id;