From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9B0F3FC0 for ; Sat, 21 Aug 2021 03:59:23 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id b7so16876261edu.3 for ; Fri, 20 Aug 2021 20:59:23 -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=Wj7TjxNTC+13pfDeICfptKb/G5QJvSGq174vA4u0ctAv1X1oPziBBUZtHq/Y9mmWq/ qYAp7IRCL4N+befD6pvh4lZyQHA6Mjyq21B5TzMV2VdOTAlxschIP34O5b+ka5oHr9qh NMANGZw8mffimrJLINxTHTpiJ6bBeqhGnYv3iSbsNf2eoBObAwQ1xszW/h6Z28juqFyy FD5mYUSA6nDUF1MRiJ0MvTV4pAo8ArqGNfMOpB6Bdytb59wqCs0Gz5TDEmBL1QKIGar3 ShhR2ZTPBJZM0Mb7/zTPDhn4b3QK9Wx1Fn8HIjKwwIcDNrMTI7yk3ixWJpanPEknYUnx PLIQ== X-Gm-Message-State: AOAM531ttnjABPehPcTNjuaCW+Y675jsSnMEGI2hvFh4eGOLNQNOmmxU RGdb11+mnTCYsgd0qFZPUPs= X-Google-Smtp-Source: ABdhPJwwzuTR+xcSC1RtQ5rsDP1/mV06Chr44FkedEtPsFNV3/1leiqsNpZIRgcUBRaHivPl9AgGtg== 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> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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 >