X-GM-THRID: 6523503828984135680 Date: Sat, 17 Feb 2018 04:46:35 -0800 (PST) From: Dafna Hirschfeld To: outreachy-kernel Message-Id: Subject: fixing warning "else is not generally useful after a break or return" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6678_1455307276.1518871595574" X-Google-Token: EKvIoNQFiWVEkrDs2Zc0 X-Google-IP: 87.71.142.168 ------=_Part_6678_1455307276.1518871595574 Content-Type: multipart/alternative; boundary="----=_Part_6679_967376382.1518871595574" ------=_Part_6679_967376382.1518871595574 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, I see this warning "else is not generally useful after a break or return": #532: FILE: drivers/staging/vt6655/rxtx.c:532: + return buf->duration_a; + } else { So the standard is to remove the "else" line when it is not necessary ? In the function s_uFillDataHead there are more "else" statements that are redundant, for example this one since the "if" it relates to always returns. So all redundant "else / else if" should be removed ? Thanks, Dafna ------=_Part_6679_967376382.1518871595574 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,
I see this warning "else is not ge= nerally useful after a break or return":

#532: FILE: drivers/staging/vt6655/rxtx.c:532:
+=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return= buf->duration_a;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0} else {

So the standard is to = remove the "else" line when it is not necessary ?=C2=A0

In the function s_uFillDataHead=C2=A0there = are more "else" statements that are redundant, for example this=C2=A0one since the "if" it relates to always = returns.=C2=A0

So all redundant "else / else if= " should be removed ?

Thanks,
Dafna=
------=_Part_6679_967376382.1518871595574-- ------=_Part_6678_1455307276.1518871595574--