[2/4] bus/fslmc: fix printf of null pointer
Checks
Commit Message
Printing a null pointer with %s is flagged as a warning by GCC 9, and
should not be done. Replace the %s with the word "null" itself.
Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Cc: shreyansh.jain@nxp.com
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/bus/fslmc/fslmc_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, May 1, 2019 at 9:50 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:
> Printing a null pointer with %s is flagged as a warning by GCC 9, and
> should not be done. Replace the %s with the word "null" itself.
>
> Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
> Cc: shreyansh.jain@nxp.com
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/bus/fslmc/fslmc_bus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
> index eaa39a209..f6e66d22c 100644
> --- a/drivers/bus/fslmc/fslmc_bus.c
> +++ b/drivers/bus/fslmc/fslmc_bus.c
> @@ -197,7 +197,7 @@ scan_one_fslmc_device(char *dev_name)
>
> t_ptr = strtok(NULL, ".");
> if (!t_ptr) {
> - DPAA2_BUS_ERR("Incorrect device string observed (%s)",
> t_ptr);
> + DPAA2_BUS_ERR("Incorrect device string observed (null)");
>
I'd rather print dev_name here, since t_ptr == NULL means that dev_name
format is incorrect.
@@ -197,7 +197,7 @@ scan_one_fslmc_device(char *dev_name)
t_ptr = strtok(NULL, ".");
if (!t_ptr) {
- DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr);
+ DPAA2_BUS_ERR("Incorrect device string observed (null)");
goto cleanup;
}