mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-02 09:30:10 +00:00
drivers: net: fsl-mc: remove explicit cast
Remove all the explicit casts from the void* returned by calloc. With this we also improve a bit the length of those lines and there is no need to split the assignment. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
parent
8ecf1ca093
commit
6dcf5e4477
1 changed files with 5 additions and 8 deletions
|
@ -812,7 +812,7 @@ int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr)
|
||||||
* Initialize the global default MC portal
|
* Initialize the global default MC portal
|
||||||
* And check that the MC firmware is responding portal commands:
|
* And check that the MC firmware is responding portal commands:
|
||||||
*/
|
*/
|
||||||
root_mc_io = (struct fsl_mc_io *)calloc(sizeof(struct fsl_mc_io), 1);
|
root_mc_io = calloc(sizeof(struct fsl_mc_io), 1);
|
||||||
if (!root_mc_io) {
|
if (!root_mc_io) {
|
||||||
printf(" No memory: calloc() failed\n");
|
printf(" No memory: calloc() failed\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -979,8 +979,7 @@ static int dpio_init(void)
|
||||||
int err = 0;
|
int err = 0;
|
||||||
uint16_t major_ver, minor_ver;
|
uint16_t major_ver, minor_ver;
|
||||||
|
|
||||||
dflt_dpio = (struct fsl_dpio_obj *)calloc(
|
dflt_dpio = calloc(sizeof(struct fsl_dpio_obj), 1);
|
||||||
sizeof(struct fsl_dpio_obj), 1);
|
|
||||||
if (!dflt_dpio) {
|
if (!dflt_dpio) {
|
||||||
printf("No memory: calloc() failed\n");
|
printf("No memory: calloc() failed\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
@ -1168,7 +1167,7 @@ static int dprc_init(void)
|
||||||
goto err_create;
|
goto err_create;
|
||||||
}
|
}
|
||||||
|
|
||||||
dflt_mc_io = (struct fsl_mc_io *)calloc(sizeof(struct fsl_mc_io), 1);
|
dflt_mc_io = calloc(sizeof(struct fsl_mc_io), 1);
|
||||||
if (!dflt_mc_io) {
|
if (!dflt_mc_io) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
printf(" No memory: calloc() failed\n");
|
printf(" No memory: calloc() failed\n");
|
||||||
|
@ -1250,8 +1249,7 @@ static int dpbp_init(void)
|
||||||
struct dpbp_cfg dpbp_cfg;
|
struct dpbp_cfg dpbp_cfg;
|
||||||
uint16_t major_ver, minor_ver;
|
uint16_t major_ver, minor_ver;
|
||||||
|
|
||||||
dflt_dpbp = (struct fsl_dpbp_obj *)calloc(
|
dflt_dpbp = calloc(sizeof(struct fsl_dpbp_obj), 1);
|
||||||
sizeof(struct fsl_dpbp_obj), 1);
|
|
||||||
if (!dflt_dpbp) {
|
if (!dflt_dpbp) {
|
||||||
printf("No memory: calloc() failed\n");
|
printf("No memory: calloc() failed\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
@ -1369,8 +1367,7 @@ static int dpni_init(void)
|
||||||
struct dpni_cfg dpni_cfg;
|
struct dpni_cfg dpni_cfg;
|
||||||
uint16_t major_ver, minor_ver;
|
uint16_t major_ver, minor_ver;
|
||||||
|
|
||||||
dflt_dpni = (struct fsl_dpni_obj *)calloc(
|
dflt_dpni = calloc(sizeof(struct fsl_dpni_obj), 1);
|
||||||
sizeof(struct fsl_dpni_obj), 1);
|
|
||||||
if (!dflt_dpni) {
|
if (!dflt_dpni) {
|
||||||
printf("No memory: calloc() failed\n");
|
printf("No memory: calloc() failed\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue