Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3873096pxy; Tue, 4 May 2021 11:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1pll2bESh1OCwLsT4prFsHa9GE4u7j8xEgCKPVvEO3zC0E3doVsw273tcNPVc2nWoku5Z X-Received: by 2002:a17:906:b191:: with SMTP id w17mr23591499ejy.200.1620154181718; Tue, 04 May 2021 11:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620154181; cv=none; d=google.com; s=arc-20160816; b=D3qy29ZCQI6EPI2bbsYhIjAxbL0GoEmjXc+HaPEmoow8k006q5ZR9fYGS4NbjgkWid rTjjggnMNWOCMdLeyAcLcLx2VUPwJVVvrsCkgWNpdsnIUMmbumleaTXBzFm8+zfpL2kF OIFlTNBpGPngOD7pR7J70vLr4b8pJHogd5no+sk1olFe8dX8iu8tgy+0HGrPIKQUs3Df 6+wL+cmPSfpfdjjM5vjel19SLGcd1AANuuBsvA8pL3bB6rd9+YD5iqHIyaY0CqxrbkIK ZXaGI2T/JAWvnv2qYJmQVWRFzWSS4GOM75oNpRZ6awngX07SDuiw9SFsRmGp05OCRMXn fvdw== 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=l7iVg4/OggiIkPeMxEn/RhDWwcdILaZsHBJ2V+aEFSg=; b=D3af9Pcc4hNQFYRyXdXf+jVpP9XTpoF90q0tpinRIGiQ7Sfyv/SA/ImKM8thTZwoVq R/S00B0BiYCfhNYBRoHOmn5VQUNm2MP4+UMdE39hzE3PI1NR75OkGUVX4nN4qWDwdZsf tjbwBaYQpvhA7IWLyZ6HDLD/+ivXI44GjB5lQOVgq7dsH0Nxa6XvywcKYrL8Sjc62ecA smtGD6vZo6R7+Q9QpUdcZKIcOi/dsnEZvHsZO609/DiPguo0WngMuLdtpGwi3yPAdjbD WU6HHoHJSL2plPlCWXIElts/KWb4jPRZSYouWmm7jzxt+tJGw4aOpucCfgBkjvnYkfs7 3/qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail3 header.b=miwE+3WH; 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 x93si13029692ede.393.2021.05.04.11.49.18; Tue, 04 May 2021 11:49:41 -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=miwE+3WH; 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 S232012AbhEDRqh (ORCPT + 99 others); Tue, 4 May 2021 13:46:37 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:35381 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231998AbhEDRqg (ORCPT ); Tue, 4 May 2021 13:46:36 -0400 Date: Tue, 04 May 2021 17:45:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryanbrattlof.com; s=protonmail3; t=1620150339; bh=l7iVg4/OggiIkPeMxEn/RhDWwcdILaZsHBJ2V+aEFSg=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=miwE+3WH0QRy/M8fMvtxbKcq4DIoyMWunzOjNUCSYm0+xBJqjhsh8zxp0J1795FYy BxLkCcaw+P6oYgEirjQCmniTUePbBAePv7jvMYxUU7M8wPjlv65DSbykv/vceZoQtJ L6aFmE9DluKG0+8Tf94Ieh0JjLIlGwEfRDnhs1BRzvx1Qwytmz20kLTPRPszFa3bLQ SUHj4frnqp+xnu5aQ2QU7iIqutV3Op4VV7kjD9bERSTlZVzKFgCsrESac2roGQitAm fSFJpiFezqLVZDmh3K5MXvu0AvVTOU8qGriqmcdvpOteGNZCtPhzjij7VrTdFsfIER 98EjtHCr1OHGw== 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: <20210504174530.3kog7zq6tuk3wnlk@bryanbrattlof.com> In-Reply-To: References: 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 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. :) > >> >> static void sdio_deinit(struct dvobj_priv *dvobj) >> @@ -186,7 +185,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdi= o_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? -- ~Bryan > >thanks, > >greg k-h