Skip to content

Commit

Permalink
misc: refactor to remove new gcc warnings
Browse files Browse the repository at this point in the history
JIRA: RTOS-927
  • Loading branch information
badochov committed Sep 27, 2024
1 parent 10cca0a commit 5c588e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sensors/libsensors-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int sensorsspi_open(const char *devSPI, const char *devSS, oid_t *spi, oid_t *ss

/* Configure pin as output */
dir = dirname(path);
sprintf(dir, "%s/dir", dir);
strcat(dir, "/dir");

ntries = 10;
while (lookup(dir, NULL, &oid) < 0) {
Expand All @@ -127,7 +127,7 @@ int sensorsspi_open(const char *devSPI, const char *devSS, oid_t *spi, oid_t *ss

/* Raise SS pin high */
dir = dirname(path);
sprintf(dir, "%s/port", dir);
strcat(dir, "/port");

ntries = 10;
while (lookup(dir, NULL, &oid) < 0) {
Expand Down
4 changes: 2 additions & 2 deletions storage/zynq7000-flash/qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int qspi_setPin(uint32_t pin)

static int qspi_initPins(void)
{
int res, i;
int res = EOK;
static const int pins[] = {
QSPI_CS,
QSPI_IO0,
Expand All @@ -416,7 +416,7 @@ static int qspi_initPins(void)
QSPI_FCLK
};

for (i = 0; i < sizeof(pins) / sizeof(pins[0]); ++i) {
for (size_t i = 0; i < (sizeof(pins) / sizeof(pins[0])); ++i) {
/* Pin should not be configured by the driver */
if (pins[i] < 0) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion tty/zynq7000-uart/zynq7000-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static void uart_klogClbk(const char *data, size_t size)

static void uart_mkDev(unsigned int id)
{
char path[12];
char path[20];

snprintf(path, sizeof(path), "/dev/uart%u", id);
if (create_dev(&uart_common.uart.oid, path) < 0) {
Expand Down

0 comments on commit 5c588e7

Please sign in to comment.