Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp121483pxb; Fri, 20 Aug 2021 21:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3xKkJ4um3bFMzIbmPTR9kBE6yA6Sd4rQJncded4+bzWNI3t96H9N9YFhHrW6CNcUgGYBN X-Received: by 2002:a92:c60b:: with SMTP id p11mr15512215ilm.65.1629518421807; Fri, 20 Aug 2021 21:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629518421; cv=none; d=google.com; s=arc-20160816; b=0ASvijsKt+U1/M3wlqXMWUl/6BqRHAeKV0dylkNh2+iC8hk1l8/FDre8c763AEaFge jZkJAiSK70AS+fFeqO7RQLpDCg28VHZOmevX7j0p8xLfWt5pY6XF/dsX/d+omCeBvhRI eabxfvqOGxt4mFjT4n5k8kbxjzyK8bZDGhYdfC63TAu1UaL0eZFsdPLsGMUByPp4w+XF /63acKO0FxE/viQ3HA5q6JKrtQv3UfMwKYQIYM2uK/cfhiP8/a41NpfSPpNtVr4pdI+P Cpz+i5zHioIROm/S1lb7R9F9rGB3POLkwzmsyk1hyHx6IS+kbgtDpd+XSFt8hncWL3x4 soVw== 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:date:subject:cc:to:from :dkim-signature; bh=R3FWEQvkULZpp+ElEzfqW3d4QazWh4E5WETIUUYvJeY=; b=YVJ7PmT2MOS7FEtEHrBE4gEB05pJgc80HeiCaPMwQuJnS+xjk6x2FQC6io04dd0XQj QjHTKPK5ppQpsno83K2aaOYkjMx+4F9kfz9CyRAKKTJU7AfY0FFDP48VGWIvJ5R+WtJ+ HKNqHLj2oidqFAzh5kTaZdOaDTsMZlaCp/7ch8WEnWwvx+iPSYwRCwH0TCivi1EAVunV 6OTRwIv9G7jDfoX6OK6dkTJplzV66HoigYLenwQ8KaYBHjPs2CnxIH245byDop6ogqLO RfvL8wkatjUQoGnO1lvWuTAYiLCUYkx3QeFWp0elvWh8TxRigJVdAdgcLVEZXHyv81TY yjKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="OAFGT/cJ"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si8385088ilq.108.2021.08.20.21.00.09; Fri, 20 Aug 2021 21:00:21 -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=@gmail.com header.s=20161025 header.b="OAFGT/cJ"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbhHUEAE (ORCPT + 99 others); Sat, 21 Aug 2021 00:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhHUEAD (ORCPT ); Sat, 21 Aug 2021 00:00:03 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32933C061575 for ; Fri, 20 Aug 2021 20:59:24 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id n12so16830174edx.8 for ; Fri, 20 Aug 2021 20:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R3FWEQvkULZpp+ElEzfqW3d4QazWh4E5WETIUUYvJeY=; b=OAFGT/cJF/l/cM8yYl0R7fRuUoMapU9L6+Xzx2eeiz8cE+ZpZQabmYz6Kj2VpB5+r6 bmo1TYLRIu6kj8e2BdC0UI0PolOy/S8DkWaPCa30hzFvk3p6rCDylh1FsVZ1q1L+5uiJ /DdXrRFuMRdeq/7MN1DcgOzzZAfuEev1+bEIXPMUJCZbbinQTqA3fQrfYfEZt7tCcgVi zJDzK8qeYg2KwTRXk5lHFXeDiKmp8W22wvQyDC/IaHyiygfY2j/7pVd/TelPvLeEkeBv 0byoD5dtm/B8ji2zQ+oeCmnPWEEUmhIgYrxLLvL5UoGvdt4rTkguvrpjjIt1vg47UI0z AOvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R3FWEQvkULZpp+ElEzfqW3d4QazWh4E5WETIUUYvJeY=; b=YlkUn8u97hD8ZnmS6l5VYy9fDhy8K3zCpnF3e1M8oDoAtF3eC8YeUTKu8smN75yLQA B07jPemf9BgLlWxp84g26oDH8IOSj5QGnFdJd/ka+0AseuH4/SaAcOQfTquJtPGVBOtN rjNDWBcWh/Q+IJZB1mimibYoxlsaVv6uI2hu6OTYegHr51MFhR0TyWCOck6+UiSQZcmi R5axjfLSSuU83nLEiTNsW5SLtz52NH2c6LqgOU+mdg009Fcm9tJbWPty8HrM/m3U4FqJ hIn8tHuZaVQGxFCP8SuugLJ1kHGjQsdb3NW7wz4GVfn1+wOJqCh9yPVbj9eixHUxx+V+ 0o2g== X-Gm-Message-State: AOAM532vHeaTGqisPw66HIGTR3/rQkvsbQ5Q93HqQU9s+Q+B5GGVftCL /M4DT3mnPCSSAFOsN6Ry9l0= X-Received: by 2002:a50:fe07:: with SMTP id f7mr26019721edt.11.1629518362101; Fri, 20 Aug 2021 20:59:22 -0700 (PDT) Received: from localhost.localdomain (host-79-22-100-164.retail.telecomitalia.it. [79.22.100.164]) by smtp.gmail.com with ESMTPSA id u23sm4606039edr.42.2021.08.20.20.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 20:59:21 -0700 (PDT) From: "Fabio M. De Francesco" To: Pavel Skripkin , Phillip Potter Cc: Larry Finger , Greg KH , Michael Straube , linux-staging@lists.linux.dev, Linux Kernel Mailing List Subject: Re: [PATCH RFC 2/3] staging: r8188eu: add error handling to ReadFuse Date: Sat, 21 Aug 2021 05:59:20 +0200 Message-ID: <3977072.uyyoESeOv6@localhost.localdomain> In-Reply-To: References: <0e2df1ac9e1031824a1cdb7b24594d2d1b99e382.1629479152.git.paskripkin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Pavel On Saturday, August 21, 2021 1:51:57 AM CEST Phillip Potter wrote: > 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 sutiation --> situation. > > 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(-) > > Please change the Subject: ReadFuse --> ReadEFuse() or ReadFuse --> ReadEFuseByte(). > > 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). I agree with Philip on splitting 1/3 into more patches, perhaps one for each of the three rtw_read*(), but I disagree on merging the usb_read*() changes into this. They should go to another patch because they are not strictly related to "add[ing] error handling to ReadFuse". Regards, Fabio > (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 >