Gedare Bloom started a new discussion on 
bsps/aarch64/raspberrypi/i2c/raspberrypi-i2c.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/363#note_125129

 > +    case raspberrypi_bscm1:
 > +      bus_path = "/dev/i2c-1";
 > +      break;
 > +    case raspberrypi_bscm3:
 > +      bus_path = "/dev/i2c-3";
 > +      break;
 > +    case raspberrypi_bscm4:
 > +      bus_path = "/dev/i2c-4";
 > +      break;
 > +    case raspberrypi_bscm5:
 > +      bus_path = "/dev/i2c-5";
 > +      break;
 > +    case raspberrypi_bscm6:
 > +      bus_path = "/dev/i2c-6";
 > +      break;
 > +    default:

you could check the correctness of `device` before you call the 
`i2c_bus_alloc_and_init`. This is preferable "Parameter checking should be done 
first with early error returns." 
https://docs.rtems.org/docs/main/eng/coding-conventions.html#readability

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/363#note_125129
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to