Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp8532pxb; Fri, 20 Aug 2021 16:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjMjKdfybt8ddOOQrT0mZJuvxf4EXKGbYrGgz7BZ7elXGn6i73x1jmxUAXNRvrqChm23Ip X-Received: by 2002:a17:906:4cc1:: with SMTP id q1mr24923546ejt.415.1629503671089; Fri, 20 Aug 2021 16:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629503671; cv=none; d=google.com; s=arc-20160816; b=PuDPHSesLgiqsbEzOo51dJ88jzgS4xiR6XViAob35FCXtZQDoHowbSI8WM85XCqoT/ YiEwITO2EAVpL+aUptHkcWn32fNJwoEwcRq0Fb3zoSodfCzwONT9A8pbO5XEzM/5KFMV OaSi0c6FvsJS2Pnj5GNIc0IwRNZPb7xHYw6LzgQCWYJq8i1OYygYz5zWVhiOlgowUZ+n RJkWJdSemxzX3dNaM4QX71gpSkrpVItvAIORSik4V3EXMaUGlQj45yasnyPY/87iL3U3 BCOyTSU/YwW74e57QLcNdHSdfOkgGtMiPnw/Pc9J8gX2AOc2ya/81yE5EKZxQYofPe5I 7ZiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7a7pr5fcERkUw6OUxCu6Pi6Dvka3zNiGFTz7cgPMCq4=; b=rJZHAFnrxjsqTRGJzwwrLAgCrcspK6x2hL8ApqX4j379+fH7bSwS3PrrD9qCL4lPkJ kdGKKP6HcMCAT3idcoSxv3b8+KkTV4fxTERD7aEGAePUEGCz//XLaGKMMWV5nvjOii9V 4+GZpycit0Eag5HUK16mjYRh7jTLA+DvNjOiLZhPsHW1BwWheW34K0dDbxiJk86DwgUA oRHO1rl0LwC+wtXkiCEStNzWu8CMxNhP2YfiFTPU4z4AlqML+3BYUpinDFl8P1abUBhp F5+ZoCfQZQlR5RgxE2o7kmoCFOvNjh88CtGwRG5D6rU79aXw11KOx0bYohhjJPTiONxl gipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=Jhuhy1hi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si8840085edv.346.2021.08.20.16.53.56; Fri, 20 Aug 2021 16:54:31 -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=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=Jhuhy1hi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233785AbhHTXws (ORCPT + 99 others); Fri, 20 Aug 2021 19:52:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhHTXwr (ORCPT ); Fri, 20 Aug 2021 19:52:47 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 082D5C061575 for ; Fri, 20 Aug 2021 16:52:09 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id u11-20020a17090adb4b00b00181668a56d6so2120104pjx.5 for ; Fri, 20 Aug 2021 16:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7a7pr5fcERkUw6OUxCu6Pi6Dvka3zNiGFTz7cgPMCq4=; b=Jhuhy1hiJYwkPASf5kx5v9//OFHdZH3ukTgAqvjXPa0cbrH0YLNSZxdWo33VLN6Y8E cmpoJoplP0cba+qV16kp+yvU5qSJzik8AICpXI33WjiQHHSHkqcjZeNDn8fpPa9JKWmW zeWBgTOz6uS6GbFAlSe4j5OcTaWDYvAazg96UfU+UJ4dxH9vN0JqY2eo+xxG9lmSRk4G QxVKwyQ8xTRJ6baahEPMt19dYtdGJsxB53LYeqA5AgreSAKwL+QxX7XVX6JMA2IxVo6O jKJShSHjErWSZKV0oiY6tQ/c33zkTvHJlyPZ7cKsdjWXW/3sfmMAwUYmL+PM1EqDT9wD SGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7a7pr5fcERkUw6OUxCu6Pi6Dvka3zNiGFTz7cgPMCq4=; b=ERSbC8n8i0Gn702Nhvtl7WoHrbTCwr3PuwYZj2XiaoqRUHL8u39ofaB+XYppyoWDDE B8qKEsfhaA1BGSU2RpabcktmgkXBBo+c//T0wwV7TK9ttkobuzWxwuwvNZ8AmYOMwvfm +NUcWN+fmSUo3R0tcK74hLwLnaSfRKxCzrtCLlFRcR0RA+aZIj+e77y6BJDz5YmR5A3Y Wb0Q+yCRh/EeQvD4BRmzgFv9BaqQDnoAjp3KMDJPafosLYx8DOw3Mi0FRzpDXyz5X3wY hjNc4vg4d67Qp+RarJCKFy6HYgcfrA1r5z2HtL3zbJAwg7ikeQ2aDdF+0qCHLzBF/rEO 5c6w== X-Gm-Message-State: AOAM530H4HbZ2L1dILW6Hia9VDwbz1ZeKxvn8U+QSP3L1AU0Yll+Fq09 NAtTYhVvmnxirwbyCow4F/cbq7doHkNcoLjHSKLeyw== X-Received: by 2002:a17:90a:6906:: with SMTP id r6mr7106659pjj.162.1629503528537; Fri, 20 Aug 2021 16:52:08 -0700 (PDT) MIME-Version: 1.0 References: <0e2df1ac9e1031824a1cdb7b24594d2d1b99e382.1629479152.git.paskripkin@gmail.com> In-Reply-To: <0e2df1ac9e1031824a1cdb7b24594d2d1b99e382.1629479152.git.paskripkin@gmail.com> From: Phillip Potter Date: Sat, 21 Aug 2021 00:51:57 +0100 Message-ID: Subject: Re: [PATCH RFC 2/3] staging: r8188eu: add error handling to ReadFuse To: Pavel Skripkin Cc: Larry Finger , Greg KH , Michael Straube , "Fabio M. De Francesco" , linux-staging@lists.linux.dev, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Aug 2021 at 18:07, Pavel Skripkin wrote: > > ReadEFuseByte() internally calls rtw_read8() which can fail. To avoid > uninit value bugs we should properly handle error sutiation and deliver > the error to caller. > > To achieve it, some functions now return an int, and the error > which could occur in ReadEFuseByte() is handled on the top level. > > Signed-off-by: Pavel Skripkin > --- > drivers/staging/r8188eu/core/rtw_efuse.c | 46 +++++++++----- > drivers/staging/r8188eu/hal/hal_intf.c | 6 +- > .../staging/r8188eu/hal/rtl8188e_hal_init.c | 62 +++++++++++++------ > drivers/staging/r8188eu/hal/usb_halinit.c | 20 ++++-- > drivers/staging/r8188eu/hal/usb_ops_linux.c | 43 +++++++++++-- > drivers/staging/r8188eu/include/hal_intf.h | 6 +- > .../staging/r8188eu/include/rtl8188e_hal.h | 2 +- > drivers/staging/r8188eu/include/rtw_efuse.h | 4 +- > drivers/staging/r8188eu/os_dep/usb_intf.c | 4 +- > 9 files changed, 138 insertions(+), 55 deletions(-) > Dear Pavel, I like the code, just a few things though: (1) the comments I made in the previous e-mail r.e. what we actually do with the errors, and grouping logically related changes (the rest of the usb_read*() changes being in this patch for example). (2) I got trailing whitespace errors from this patch and the last one. For a v2 I would say stripping the whitespace is a good idea too - I have submitted many patches myself to this driver that had whitespace in - indeed, the original version of my patch series to import the driver still had a load as well :-) Regards, Phil