cleanup: fix building warnings
This commit is contained in:
parent
b4dac34167
commit
d55066e10d
|
@ -534,21 +534,21 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host,
|
||||||
|
|
||||||
err = mmcsd_send_app_op_cond(host, ocr, RT_NULL);
|
err = mmcsd_send_app_op_cond(host, ocr, RT_NULL);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto err2;
|
||||||
|
|
||||||
if (controller_is_spi(host))
|
if (controller_is_spi(host))
|
||||||
err = mmcsd_get_cid(host, resp);
|
err = mmcsd_get_cid(host, resp);
|
||||||
else
|
else
|
||||||
err = mmcsd_all_get_cid(host, resp);
|
err = mmcsd_all_get_cid(host, resp);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto err2;
|
||||||
|
|
||||||
card = rt_malloc(sizeof(struct rt_mmcsd_card));
|
card = rt_malloc(sizeof(struct rt_mmcsd_card));
|
||||||
if (!card)
|
if (!card)
|
||||||
{
|
{
|
||||||
LOG_E("malloc card failed!");
|
LOG_E("malloc card failed!");
|
||||||
err = -RT_ENOMEM;
|
err = -RT_ENOMEM;
|
||||||
goto err;
|
goto err2;
|
||||||
}
|
}
|
||||||
rt_memset(card, 0, sizeof(struct rt_mmcsd_card));
|
rt_memset(card, 0, sizeof(struct rt_mmcsd_card));
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host,
|
||||||
|
|
||||||
err1:
|
err1:
|
||||||
rt_free(card);
|
rt_free(card);
|
||||||
err:
|
err2:
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -645,7 +645,7 @@ err:
|
||||||
*/
|
*/
|
||||||
rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
||||||
{
|
{
|
||||||
rt_int32_t err;
|
rt_int32_t err = -RT_EINVAL;
|
||||||
rt_uint32_t current_ocr;
|
rt_uint32_t current_ocr;
|
||||||
/*
|
/*
|
||||||
* We need to get OCR a different way for SPI.
|
* We need to get OCR a different way for SPI.
|
||||||
|
@ -656,7 +656,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
||||||
|
|
||||||
err = mmcsd_spi_read_ocr(host, 0, &ocr);
|
err = mmcsd_spi_read_ocr(host, 0, &ocr);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ocr & VDD_165_195)
|
if (ocr & VDD_165_195)
|
||||||
|
@ -675,7 +675,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
||||||
if (!current_ocr)
|
if (!current_ocr)
|
||||||
{
|
{
|
||||||
err = -RT_ERROR;
|
err = -RT_ERROR;
|
||||||
goto err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -683,7 +683,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
|
||||||
*/
|
*/
|
||||||
err = mmcsd_sd_init_card(host, current_ocr);
|
err = mmcsd_sd_init_card(host, current_ocr);
|
||||||
if (err)
|
if (err)
|
||||||
goto err;
|
goto _err;
|
||||||
|
|
||||||
mmcsd_host_unlock(host);
|
mmcsd_host_unlock(host);
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ remove_card:
|
||||||
rt_mmcsd_blk_remove(host->card);
|
rt_mmcsd_blk_remove(host->card);
|
||||||
rt_free(host->card);
|
rt_free(host->card);
|
||||||
host->card = RT_NULL;
|
host->card = RT_NULL;
|
||||||
err:
|
_err:
|
||||||
|
|
||||||
LOG_D("init SD card failed!");
|
LOG_D("init SD card failed!");
|
||||||
|
|
||||||
|
|
|
@ -626,7 +626,7 @@ RTM_EXPORT(clock_gettime);
|
||||||
int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, struct timespec *rmtp)
|
int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, struct timespec *rmtp)
|
||||||
{
|
{
|
||||||
struct timespec ts = {0};
|
struct timespec ts = {0};
|
||||||
rt_err_t err;
|
rt_err_t err = -RT_EINVAL;
|
||||||
|
|
||||||
if (rqtp == RT_NULL)
|
if (rqtp == RT_NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -463,17 +463,17 @@ int lwp_thread_signal_suspend_check(rt_thread_t thread, int suspend_flag)
|
||||||
void lwp_thread_signal_catch(void *exp_frame)
|
void lwp_thread_signal_catch(void *exp_frame)
|
||||||
{
|
{
|
||||||
rt_base_t level;
|
rt_base_t level;
|
||||||
int signo;
|
int signo = 0;
|
||||||
struct rt_thread *thread;
|
struct rt_thread *thread;
|
||||||
struct rt_lwp *lwp;
|
struct rt_lwp *lwp;
|
||||||
lwp_siginfo_t siginfo;
|
lwp_siginfo_t siginfo = 0;
|
||||||
lwp_sigqueue_t pending;
|
lwp_sigqueue_t pending;
|
||||||
lwp_sigset_t *sig_mask;
|
lwp_sigset_t *sig_mask;
|
||||||
lwp_sigset_t save_sig_mask;
|
lwp_sigset_t save_sig_mask;
|
||||||
lwp_sigset_t new_sig_mask;
|
lwp_sigset_t new_sig_mask;
|
||||||
lwp_sighandler_t handler;
|
lwp_sighandler_t handler = 0;
|
||||||
siginfo_t usiginfo;
|
siginfo_t usiginfo;
|
||||||
siginfo_t *p_usi;
|
siginfo_t *p_usi = RT_NULL;
|
||||||
|
|
||||||
thread = rt_thread_self();
|
thread = rt_thread_self();
|
||||||
lwp = (struct rt_lwp*)thread->lwp;
|
lwp = (struct rt_lwp*)thread->lwp;
|
||||||
|
|
Loading…
Reference in New Issue