Re: hns compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jason,

Thanks for this. We will fix it as soon as possible.

Yisen

在 2017/12/30 3:58, Jason Gunthorpe 写道:
> When !CONFIG_REGMAP hns throws compiler warnings since
> dsaf_read_syscon ignores the return result from regmap_read, which
> allows val to be uninited. This looks like a bug to me.
> 
> Could someone please send a patch to fix this? It probably isn't a
> good idea to wrapper regmap_read with something that throws away the
> return code.
> 
> Thanks
> Jason
> 
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c: In function ‘cpld_set_led_id’:
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:165:26: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>    mac_cb->cpld_led_value =
>    ~~~~~~~~~~~~~~~~~~~~~~~^
>     dsaf_read_syscon(mac_cb->cpld_ctrl,
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>        mac_cb->cpld_ctrl_reg);
>        ~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c: In function ‘hns_mac_get_sfp_prsnt’:
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c:511:15: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   *sfp_prsnt = !dsaf_read_syscon(mac_cb->cpld_ctrl, mac_cb->cpld_ctrl_reg
>                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       + MAC_SFP_PORT_OFFSET);
>       ~~~~~~~~~~~~~~~~~~~~~~
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux