aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mscc/ocelot_ace.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-09ocelot: remove unused variable 'rc' in vcap_cmd()Mao Wenan1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/mscc/ocelot_ace.c: In function ‘vcap_cmd’: drivers/net/ethernet/mscc/ocelot_ace.c:108:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ It's never used since introduction in commit b596229448dd ("net: mscc: ocelot: Add support for tcam") Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-06net: mscc: ocelot: remove unused variable 'vcap_data_t'YueHaibing1-1/+1
Fix sparse warning: drivers/net/ethernet/mscc/ocelot_ace.c:96:3: warning: symbol 'vcap_data_t' was not declared. Should it be static? 'vcap_data_t' never used so can be removed Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-04net: mscc: ocelot: Fix some struct initializationsNathan Chancellor1-4/+10
Clang warns: drivers/net/ethernet/mscc/ocelot_ace.c:335:37: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct ocelot_vcap_u64 payload = { 0 }; ^ {} drivers/net/ethernet/mscc/ocelot_ace.c:336:28: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct vcap_data data = { 0 }; ^ {} drivers/net/ethernet/mscc/ocelot_ace.c:683:37: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct ocelot_ace_rule del_ace = { 0 }; ^ {} drivers/net/ethernet/mscc/ocelot_ace.c:743:28: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct vcap_data data = { 0 }; ^ {} 4 warnings generated. One way to fix these warnings is to add additional braces like Clang suggests; however, there has been a bit of push back from some maintainers[1][2], who just prefer memset as it is unambiguous, doesn't depend on a particular compiler version[3], and properly initializes all subobjects. Do that here so there are no more warnings. [1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/ [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/ [3]: https://lore.kernel.org/lkml/20181116150432.2408a075@redhat.com/ Fixes: b596229448dd ("net: mscc: ocelot: Add support for tcam") Link: https://github.com/ClangBuiltLinux/linux/issues/505 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-02net: mscc: ocelot: Add support for tcamHoratiu Vultur1-0/+777
Add ACL support using the TCAM. Using ACL it is possible to create rules in hardware to filter/redirect frames. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>