Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3879085pxy; Tue, 4 May 2021 11:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgidPyhy4mbw0ocIG3NnWfrbNmpkZchhe82XkP22P/q77Nqze9lfVxT7OOi2dQ4UsVXyg6 X-Received: by 2002:a17:907:9620:: with SMTP id gb32mr8881165ejc.331.1620154722523; Tue, 04 May 2021 11:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620154722; cv=none; d=google.com; s=arc-20160816; b=LwP/54exvgVOrzNHr5GspMMejMlBnyXJDigTpSzytKV5uQr/BRlX200MXFYsV5uYcQ MbwIPcaoEw8SanJm3ke97mruj/zyWMQU6adfnLc7TgOpT6oLCDhcBnNI6+41IBm++Odw rpyz9mqyjO562G3BvsdgPHRs4snyizMd6dclQbtLIgPlfM2Vi+dRwJqQqhkp4JhDPZMS d0gAyuUYJMFqp2Kw6E/VqjbyuhlyaADjI9CPwcHXAt9La6XWfH2wYyb5lQkLJ4G4QCES ctDAvC7nzRLTBVo66m0rLvozAUoudKDsC15DA6CpGXLr67cSf9qSZC0uERttVQ7eAxV8 me4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=aZt2y1a82UUZe+5SKJ6IIdvo7HmXqLUCztxzxL4vZWI=; b=yjvT1LTkhwYBfQsCAvSbHORRlpE6wmt6WWPy+XRsS+GoOREpmhzCZpJ8j3oEOxfSYp Zbs5n9vGwU/fhCetYpfhOG+yrmO5Aihmmez4nWCTXahxW26eWMwt+yQhql5g5eO2YzNu kcCveQXHr4LXZCnjW2d7jW7Sci/b1zavDaOaDF1Y7/5IBXXCd9pQWfiLJ2RDbgI1UnyB BYlVNjcln7PzkeppmHsZ5amNPmsfpYOupuJWoM/CgQv0AKm9IOGXmwtXiMgqO7cFUloO 4j3yv9k4yuKcOowlh6OlbSfPPa6sUHglKBylpCDTbeCCkbtqyFFVSrkRbQN+0UnmxAjN /ngg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail3 header.b=nH9o0N0w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si11297899edc.201.2021.05.04.11.58.16; Tue, 04 May 2021 11:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail3 header.b=nH9o0N0w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbhEDSxf (ORCPT + 99 others); Tue, 4 May 2021 14:53:35 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:16536 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbhEDSxe (ORCPT ); Tue, 4 May 2021 14:53:34 -0400 Date: Tue, 04 May 2021 18:52:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryanbrattlof.com; s=protonmail3; t=1620154357; bh=aZt2y1a82UUZe+5SKJ6IIdvo7HmXqLUCztxzxL4vZWI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=nH9o0N0wc3EsuCAEnAfly4U9sEAqU5AFBuU1TZHY4RAoZZiIJwPi1f1OeJixYk0Iq voMnlb0jqd1As5ZH+VgsLRpPXJtkbEdqyvqoNkX68fkI2ONznlTF1iKzRgAe2VXkCu xxpsEOrmvPybbsfL444GAkvtG7hONxB5HomJg0FQ4gpsBbFRqZfIqHHsZMnLxOUnPK qyLDcYDs6JT/vtHzIwb2KPBTBE7N5969KffE4Pt3s2oCJTSkvsle6jPsSV/6mDdf6N 13vGfQKyzEo4MReOndRMVaySTtLievvJpLheHUhJkQRvST9ozXVmPM+3nmxgvb6OyY f6blJKXV3d0pg== To: Greg Kroah-Hartman From: Bryan Brattlof Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Reply-To: Bryan Brattlof Subject: Re: [PATCH] staging: rtl8723bs: use generic kernel error codes Message-ID: <20210504185221.zloowjyqyc5eyptq@bryanbrattlof.com> In-Reply-To: References: <20210504174530.3kog7zq6tuk3wnlk@bryanbrattlof.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 07:56:35PM +0200, Greg Kroah-Hartman wrote: >On Tue, May 04, 2021 at 05:45:37PM +0000, Bryan Brattlof wrote: >> Sorry for the spam Greg I dropped the mailing lists from the first >> email. :( >> >> On Tue, May 04, 2021 at 06:17:15PM +0200, Greg Kroah-Hartman wrote: >> >On Tue, May 04, 2021 at 04:07:48PM +0000, Bryan Brattlof wrote: >> >> >> >> >> @@ -139,12 +139,11 @@ static u32 sdio_init(struct dvobj_priv *dvobj) >> >> =09psdio_data->tx_block_mode =3D 1; >> >> =09psdio_data->rx_block_mode =3D 1; >> >> >> >> +=09return err; >> >> + >> >> release: >> >> =09sdio_release_host(func); >> >> - >> >> -=09if (err) >> >> -=09=09return _FAIL; >> >> -=09return _SUCCESS; >> >> +=09return err; >> >> } >> > >> >You just changed the logic here, are you SURE that was ok to do? >> > >> >> I can't say my brain didn't bleed a little trying to keep this straight >> in my head while walking through this. (For what ever reason my brain >> sees negative integers as False) =C2=AF\_(=E3=83=84)_/=C2=AF >> >> Both the sdio_enable_func() and sdio_set_block_size() will return a >> negative integer if they fail, which we evaluate as True, allowing us to >> jump to release, free the card and propagate the error backwards. >> >> If everything worked, we'll skip all the jumps until we get to the first >> 'return err;' statement, returning our 0 for success. >> >> Inside sdio_dvobj_init() if we see 'anything below 0' (This probably >> should be changed to 'anything True') we jump to free_dvobj where we >> free the dvobj and return NULL >> >> If I've looked at this long enough I don't thing I changed the logic. >> >> Hopefully. :) > >So you need to document this really well, showing that the function >whose error you changed, is being evaluated here now differently too. > Sounds good. Ill update the commit log > >> >> static void sdio_deinit(struct dvobj_priv *dvobj) >> >> @@ -186,7 +185,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct = sdio_func *func) >> >> =09psdio =3D &dvobj->intf_data; >> >> =09psdio->func =3D func; >> >> >> >> -=09if (sdio_init(dvobj) !=3D _SUCCESS) >> >> +=09if (sdio_init(dvobj) < 0) >> >> =09=09goto free_dvobj; >> >> >> >> =09rtw_reset_continual_io_error(dvobj); >> >> >> >> base-commit: 9ccce092fc64d19504fa54de4fd659e279cc92e7 >> >> -- >> >> git-series 0.9.1 >> >> >> >> >> > >> >And that's all to remove the need for these crazy error values? If so, >> >why not also remove the #defines for them as well? >> > >> >> I might have over sold this patch. :) >> >> There are quite a few functions like this still here that need to be >> converted before we can get rid of the _SUCCESS and _FAIL definitions. >> >> Would it be better if I bundled these up in a series? > >Do it one function "call-chain" at a time, and yes, a series would be >great. > Thanks Greg! I'll bundle this up into a series. -- ~Bryan > >thanks, > >greg k-h