Could you please let me know where did you get this code? I am trying to find where BMC150_REG_MAG_X_LSB is declared to try and identify its function, nevertheless, I am not able to find it in GitHub - quark-mcu/qmsi .
However, if you are using the BMC150, you could try this guide: IoT - Intel® Quark™ Microcontroller D2000 - Accelerometer Tutorial | Intel® Software . It explains an example which applies this sensor.
You should go to the ISSM folder, then: \firmware\bsp\1.0\board\drivers\bmc150
I've resolved my issue already, thanks!