ASoC: hdac_hdmi: Fix static checker warning for sprintf usage
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Tue, 7 Nov 2017 10:46:24 +0000 (16:16 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 8 Nov 2017 18:58:20 +0000 (18:58 +0000)
Use snprintf instead of sprintf to shut the warning.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdac_hdmi.c

index e824d47..6f3ff15 100644 (file)
@@ -942,7 +942,8 @@ static int hdac_hdmi_create_pin_port_muxs(struct hdac_ext_device *edev,
        if (!se)
                return -ENOMEM;
 
-       sprintf(kc_name, "Pin %d port %d Input", pin->nid, port->id);
+       snprintf(kc_name, NAME_SIZE, "Pin %d port %d Input",
+                                               pin->nid, port->id);
        kc->name = devm_kstrdup(&edev->hdac.dev, kc_name, GFP_KERNEL);
        if (!kc->name)
                return -ENOMEM;