Re: [PATCH 2/2] qed: remove unused function in qed_cxt.c
From: Arnd Bergmann
Date: Fri Sep 30 2016 - 10:29:46 EST
On Friday 30 September 2016, Baoyou Xie wrote:
> We get 3 warnings when building kernel with W=1:
> drivers/net/ethernet/qlogic/qed/qed_cxt.c:1941:1: warning: no previous prototype for 'qed_cxt_dynamic_ilt_alloc' [-Wmissing-prototypes]
> drivers/net/ethernet/qlogic/qed/qed_cxt.c:2158:5: warning: no previous prototype for 'qed_cxt_free_proto_ilt' [-Wmissing-prototypes]
> drivers/net/ethernet/qlogic/qed/qed_cxt.c:2186:5: warning: no previous prototype for 'qed_cxt_get_task_ctx' [-Wmissing-prototypes]
>
> In fact, these functions are unused in
> drivers/net/ethernet/qlogic/qed/qed_cxt.c, but should be removed.
>
> So this patch removes these unused functions.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@xxxxxxxxxx>
These were only recently added in dbb799c39717 ("qed: Initialize hardware for new protocols"),
so it's likely that the plan is to use them in the future, and your commit message should
at least mention that.
If there is no longer a plan to use them, it would probably better to back out that whole
patch, other alternatives in this case might be to mark them as "static __maybe_unused"
so the compiler can drop the code silently, or to add declarations in a header if the
user would be in another file.
Arnd