lkml.org 
[lkml]   [2019]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] bpf: remove redundant assignment to err
On Mon, Jun 03, 2019 at 07:07:20PM +0100, Colin Ian King wrote:
> On 03/06/2019 18:49, Jakub Kicinski wrote:
> > On Mon, 3 Jun 2019 18:39:16 +0100, Colin Ian King wrote:
> >> On 03/06/2019 18:21, Jakub Kicinski wrote:
> >>> On Mon, 3 Jun 2019 18:02:47 +0100, Colin King wrote:
> >>>> From: Colin Ian King <colin.king@canonical.com>
> >>>>
> >>>> The variable err is assigned with the value -EINVAL that is never
> >>>> read and it is re-assigned a new value later on. The assignment is
> >>>> redundant and can be removed.
> >>>>
> >>>> Addresses-Coverity: ("Unused value")
> >>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> >>>> ---
> >>>> kernel/bpf/devmap.c | 2 +-
> >>>> kernel/bpf/xskmap.c | 2 +-
> >>>> 2 files changed, 2 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
> >>>> index 5ae7cce5ef16..a76cc6412fc4 100644
> >>>> --- a/kernel/bpf/devmap.c
> >>>> +++ b/kernel/bpf/devmap.c
> >>>> @@ -88,7 +88,7 @@ static u64 dev_map_bitmap_size(const union bpf_attr *attr)
> >>>> static struct bpf_map *dev_map_alloc(union bpf_attr *attr)
> >>>> {
> >>>> struct bpf_dtab *dtab;
> >>>> - int err = -EINVAL;
> >>>> + int err;
> >>>> u64 cost;
> >>>
> >>> Perhaps keep the variables ordered longest to shortest?
> >>
> >> Is that a required coding standard?
> >
> > For networking code, yes. Just look around the files you're changing
> > and see for yourself.
>
> Ah, informal coding standards. Great. Won't this end up with more diff
> churn?

Everyone knows that netdev uses reverse Christmas tree declarations...

regards,
dan carpenter

\
 
 \ /
  Last update: 2019-06-06 12:45    [W:0.048 / U:7.360 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site