On 2020/05/18 10:32, Bart Van Assche wrote: > On 2020-05-17 18:12, Damien Le Moal wrote: >> On 2020/05/16 9:19, Bart Van Assche wrote: >>> +static void nullb_zero_rq_data_buffer(const struct request *rq) >>> +{ >>> + struct req_iterator iter; >>> + struct bio_vec bvec; >>> + >>> + rq_for_each_bvec(bvec, rq, iter) >>> + zero_fill_bvec(&bvec); >>> +} >>> + >>> +static void nullb_zero_read_cmd_buffer(struct nullb_cmd *cmd) >>> +{ >>> + struct nullb_device *dev = cmd->nq->dev; >>> + >>> + if (dev->queue_mode == NULL_Q_BIO && bio_op(cmd->bio) == REQ_OP_READ) >>> + zero_fill_bio(cmd->bio); >>> + else if (req_op(cmd->rq) == REQ_OP_READ) >>> + nullb_zero_rq_data_buffer(cmd->rq); >>> +} >> >> Shouldn't the definition of these two functions be under a "#ifdef CONFIG_KMSAN" ? > > Hi Damien, > > It is on purpose that I used IS_ENABLED(CONFIG_KMSAN) below instead of > #ifdef CONFIG_KMSAN. CONFIG_KMSAN is not yet upstream and I want to > expose the above code to the build robot. But then you will get a "defined but unused" build warning, no ? > > Thanks, > > Bart. > -- Damien Le Moal Western Digital Research