Commit 83615054 authored by Vaibhav Gupta's avatar Vaibhav Gupta Committed by Federico Vaga

driver: zio: Kbuild: Don't treat truncation warnings as errors

Linux being an object orientd code, reuses the code wherever possible.
Thus, there are cases where two completely independent and different
structures might have a member which has same structure template.

For example, in objects.c, in function "__ti_create",
	- trig->head.name, and
	- cset->zdev->head.name

are of same type, but belong to different structures. And when the code
tries to copy/ write one into another, we get truncation warning.

And in this case we cannot even increase the size of only one, because
both the members are created from same structure.

Thus, one good solution is to not to treat those warnings as errors.
Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 5de5831f
......@@ -347,6 +347,11 @@ static struct zio_ti *__ti_create(struct zio_trigger_type *trig,
ti->head.dev.type = &ti_device_type;
ti->head.dev.parent = &cset->head.dev;
ti->head.zobj_type = ZIO_TI;
/**
* Under some circumstances the compiler might complain about string
* truncation. In this particular case we calculated that can't happen.
*/
snprintf(ti->head.name, ZIO_NAME_LEN, "%s-%s-%d",
trig->head.name, cset->zdev->head.name, cset->index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment