Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2714962yba; Sun, 28 Apr 2019 07:25:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJbLC2b/ig20/frvuz+uP8E++aWtAYvWuC+Q3GCY4X9R/DJ0M1otzGZbAhDtFVpTbkbjiK X-Received: by 2002:a17:902:22f:: with SMTP id 44mr56077257plc.175.1556461505625; Sun, 28 Apr 2019 07:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556461505; cv=none; d=google.com; s=arc-20160816; b=FnO2xs2gOTT+BwJXl84G6eNErgx/PY5g9szExMylZxL0+TOh668H2qz/Xs4xUvSnyU +NfY/0DYfn/d60BLi//GAV66lYrSSwVn7E5cpUfR7caMGEsSxBF2JyUZer948IddNcIq Gpda3D1YY/nazhTDbiZ/1LUqrNLKjmepITQH1XtLBrU9rsRAb7e6g6tqIk2wU1jAnsRl kbQ3Ax8ZCK6dqXfhGm82F0OcxQlO/vr4Y8OKbWt+mOzlUthZU/8vC+lwg/AzIfXjE2uX GPZYGxWigBp47G19uvwOG1Yu1/1S82y9S6OQdq+q9GZ1muFoJCAB1BbxtmTRPdXnNfnb JD7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UrVxQZBuvnp3JOhkf+W+d2tzb7u+gX+IuPDYN/m+AHg=; b=pOqYoaK878pxIhRm/DDOOSiZO4+3DvU2AF4jnXiEZzOZrDcbpQzkB6H9rORUTtt6nN 4bKIFeb6yHXpTtnEOBJsmwojAlB2akBVwzpVu4rK3LEW8UqDAnaQGu1iOoOP6oUrtiMc elsXQdUpiXK36pisOl3c66Ah8fd1upRiO+ttybVh2S7pHqjRzdpx3lKFqLcvHujQv18j Aauc9FBzm7naMhk8icdDeuiHlCB4lU2ZArwJHoNXhHoAForgWRyqp/A8oVJlkIpUIqLx HkI9mnug/qpVpmNldzD6B+eRTMKlf/WDtmpGZRDdPIneGP3yE3Y+bzJ8fn4zS8A+uB2Q s+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DskcGm1y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 59si17546308plp.139.2019.04.28.07.24.48; Sun, 28 Apr 2019 07:25:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DskcGm1y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726741AbfD1OXz (ORCPT + 99 others); Sun, 28 Apr 2019 10:23:55 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38201 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfD1OXz (ORCPT ); Sun, 28 Apr 2019 10:23:55 -0400 Received: by mail-ot1-f67.google.com with SMTP id t20so6520106otl.5 for ; Sun, 28 Apr 2019 07:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UrVxQZBuvnp3JOhkf+W+d2tzb7u+gX+IuPDYN/m+AHg=; b=DskcGm1yhQ+wgZj3J9uDOi1xhc54srpJ5DlAcq+k1+TC2hIto1nhunNNhgqELlMwqC RUe0nTqQ9rd6e/nIGf4xqV7u3j7IB62bUHbT/vC3TvwMdk0AcB6BuCWjUGSRvAqESGhl V1Xb+CY+Qjkr+YRmbQy5SxjmNrdUEdcBxjeq/Jt1iDJaWU7+lHio52Y6Il/FGZQomzXX zfQiaUXnupWikDhzGj5PrbbTdBIPSMuiuJncqrnMBpCMiZFQ+NO+Q0lzw3LtWj2+Gjcd 7q0UnAEg+Kjtzy90AsbCSlfdjAmeg+j8vvfXB80eqpfMCFetGTZUzUqTL7agFZW0y0+a sM0Q== 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=UrVxQZBuvnp3JOhkf+W+d2tzb7u+gX+IuPDYN/m+AHg=; b=J+eYe92GVQz8K3S0yeHC0FI5xM+YgJrt6L4QXYzSWdjMcVWruB9e/WRGchASWabAco MExrcQietaf50RRnEUG5P4yLOl3NzbAqhbwiAwXdUGRTzZ2dFwKTpkM7icQkUJKnmyz2 lv3QKkvc7pMIxuBJwT8unl088IKWp5MgaxmicUo4+TNJT72bnxdKjgVW7b/MTfI537He vcXWyjclI6eZeNwBQomR1hafKYQJ8SKGq5rOKuXUaDZgR+SIXB2Nkdn84wObbduwA5cE J+4UgZq1YkEC/lG+dB8KoYH4++pBByC1wAmDLcNj4Jq8jS/KK04+5OVlOcs3NbLtyrLa /qjA== X-Gm-Message-State: APjAAAXBlX/M4Wu/bT9MaEMY18RXDF5PmIq3HZoQMR81/gzLPj244duL pHGJbpTYVW2qMR4dK8nsiuBZdZXvc+5PdaFwZXY= X-Received: by 2002:a9d:7319:: with SMTP id e25mr1730932otk.279.1556461434231; Sun, 28 Apr 2019 07:23:54 -0700 (PDT) MIME-Version: 1.0 References: <1556418804-10266-1-git-send-email-hofrat@osadl.org> In-Reply-To: <1556418804-10266-1-git-send-email-hofrat@osadl.org> From: Sven Van Asbroeck Date: Sun, 28 Apr 2019 10:23:43 -0400 Message-ID: Subject: Re: [PATCH V2] staging: fieldbus: anybus-s: consolidate wait_for_completion_timeout return handling To: Nicholas Mc Guire Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looking good, but see inline. On Sat, Apr 27, 2019 at 10:39 PM Nicholas Mc Guire wrote: > > wait_for_completion_timeout() returns unsigned long (0 on timeout or > remaining jiffies) not int - so rather than introducing an additional > variable simply wrap the completion into an if(). Your commit message could be improved: - the headline should make clear what this is, e.g. add functionality, bugfix, shutting up sparse, etc. Using the verb 'fix' would be good here. - in case of a bugfix, it would make sense to write a short paragraph about what can go wrong, followed by a short paragraph outlining what the patch does to fix it. > > Signed-off-by: Nicholas Mc Guire > --- > > Problem located with experimental API conformance checking cocci script > > V2: The original patch's logic was wrong as it was skipping the > fall-through if so using the fix proposed by Sven Van Asbroeck > - This solution also eliminates the need > to introduce an additional variable - Thanks ! > > Patch was compile-tested with. x86_64_defconfig + FIELDBUS_DEV=m, > HMS_ANYBUSS_BUS=m > (with an unrelated sparse warnings (cast to restricted __be16)) > > Patch is against 5.1-rc6 (localversion-next is next-20190426) > > drivers/staging/fieldbus/anybuss/host.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c > index e34d424..6227daf 100644 > --- a/drivers/staging/fieldbus/anybuss/host.c > +++ b/drivers/staging/fieldbus/anybuss/host.c > @@ -1325,11 +1325,11 @@ anybuss_host_common_probe(struct device *dev, > * interrupt came in: ready to go ! > */ > reset_deassert(cd); > - ret = wait_for_completion_timeout(&cd->card_boot, TIMEOUT); > - if (ret == 0) > + if (!wait_for_completion_timeout(&cd->card_boot, TIMEOUT)) { > ret = -ETIMEDOUT; > - if (ret < 0) > goto err_reset; > + } > + Nit: why add a blank line here? > /* > * according to the anybus docs, we're allowed to read these > * without handshaking / reserving the area > -- > 2.1.4 >