Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5229imm; Tue, 25 Sep 2018 14:50:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XvrMmFyrNdH3WIciNAYrqtlYd6SBWPHJabpMbnp8edKbfVKNCXPKOX3m/qh4noSqWrSPo X-Received: by 2002:a63:a047:: with SMTP id u7-v6mr2827381pgn.145.1537912219413; Tue, 25 Sep 2018 14:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537912219; cv=none; d=google.com; s=arc-20160816; b=u+EGfMSd50iRS+41IyU6jcEfBhz/4Y5xbPm+yL7ZFOIDknNB0x1OPxyUEHY6KjmPDB VsTPzCKP3/zf/VvZc82dYebEkkuD8rdfHcBqKNhcQBv0dhevCFbCu4b/I0Ie/jBA0h9e QpgxRzQdZeYnI+rEg8bOx05Q8UAXhnT3DrCZKY0Mlzt65y7TMKMit/uCP7TkI/VM5HGg Vy8j/htuvwp1wZ4pCZrzvIUoVovub2Zm28jOzMAWNgkJRVCL4vNT3IxfSNfJkTbJbKy6 GTbSdJj/c1CX9dCjJlgpdI3uWL0ASmK78JmlJUwffPu67CaQeYMtMqFjyeX86SeTh1Pe kN9A== 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=Rl4ljybCysdU8OjbYPybyZcFxxB8LIwHIFQPKKqCP/M=; b=eqpAYz3yrvsPyt75IFXiK+Ve4TN3NG+0O8pdJ13uxJR8z5Y5To/LJmNPqhaI08Zmji 9NNz9hzlWwS3VVm7GodVQTJxQEl9+hQkfvCKdb3TSFvfojL6ILYNTbC77OvakN+M4W2K ORs19YJ2w2FGou7zY7JYA1w8bAo2YWvaC7lmpvHpORjKx0TRSg3APQpbVAiI8f/Px+SE fthu6E07l+qlrXh8bz6myJI1gUATgNUQFKG99DKY/M5sj1Vf/buvfOrnvfnmagyvEDux 1hHgVYnGa7PiZRzBV07hxSzALJkj0VKOpYF7ZQa5Am64At586Ei/Cbq0u7YKdNPncWRN yi+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="BYo/Z0Q9"; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14-v6si3239584pgb.543.2018.09.25.14.50.03; Tue, 25 Sep 2018 14:50:19 -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=@chromium.org header.s=google header.b="BYo/Z0Q9"; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbeIZD70 (ORCPT + 99 others); Tue, 25 Sep 2018 23:59:26 -0400 Received: from mail-vk1-f193.google.com ([209.85.221.193]:47101 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbeIZD7Z (ORCPT ); Tue, 25 Sep 2018 23:59:25 -0400 Received: by mail-vk1-f193.google.com with SMTP id b14-v6so5188760vke.13 for ; Tue, 25 Sep 2018 14:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rl4ljybCysdU8OjbYPybyZcFxxB8LIwHIFQPKKqCP/M=; b=BYo/Z0Q98HB62U+aFv6ANKyL/qWPfjx/VtXgSSR/vI4PbzjHtCpcUPw9F8/95nVsSz F4gzoqjhRZ0t20+CkMVLwmhTktKl9f3FDMHG6LbLeNgW5+09UetHyxDyxvPeAxYRHx74 DHQaXW5TU8B37xjH3x6XoHvH+x4ZKZIb2LzhY= 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=Rl4ljybCysdU8OjbYPybyZcFxxB8LIwHIFQPKKqCP/M=; b=ikG+YBxRDkxhuq1inoXjVMKtznT2+fvOshp5Cl+Wlq/p+JTWzyFMlI7DDQXl+L8wRk tLpf2N0+hdOnv97KRs2lLllBu4R7xnPlP4zFyalohk1Knus4jPa7gYqw9x5ixaAP8A3m kREZdmJSDdTXEz/s37tFnGIw/RAmilFslgQonIyNS2TfNAmYZPagEp5uwrR+dTyZLPWX dPnnqL2u+rz/4tZtNwtGbxvL/ACn69ByfjrUekQq6YT0HOILkl9dwK/er1uDiO1rkdZ5 sJHDEg3642yoNBiVkS0MzpbZ8NnRIMrVqzJfSgVCRVUO7UfP22qfn4KGKr7AD4gKylKO veGw== X-Gm-Message-State: ABuFfoidwgJfo1uJtla1zhj1XpE+bAsR6ffJpEcJXpgP+Q1ROGCJcs8w emWTeKnxlCV7z1CrzlX0/SPtQ6HVYtE= X-Received: by 2002:a1f:a003:: with SMTP id j3-v6mr885038vke.23.1537912188721; Tue, 25 Sep 2018 14:49:48 -0700 (PDT) Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com. [209.85.222.44]) by smtp.gmail.com with ESMTPSA id s203-v6sm884203vks.16.2018.09.25.14.49.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 14:49:47 -0700 (PDT) Received: by mail-ua1-f44.google.com with SMTP id g18-v6so10104960uam.6 for ; Tue, 25 Sep 2018 14:49:47 -0700 (PDT) X-Received: by 2002:ab0:274a:: with SMTP id c10-v6mr1005973uap.25.1537912187362; Tue, 25 Sep 2018 14:49:47 -0700 (PDT) MIME-Version: 1.0 References: <20180924235235.182649-1-swboyd@chromium.org> <20180924235235.182649-2-swboyd@chromium.org> In-Reply-To: <20180924235235.182649-2-swboyd@chromium.org> From: Doug Anderson Date: Tue, 25 Sep 2018 14:49:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/3] i2c: i2c-qcom-geni: Simplify tx/rx functions To: Stephen Boyd Cc: Wolfram Sang , LKML , linux-i2c@vger.kernel.org, linux-arm-msm , Karthikeyan Ramasubramanian , Sagar Dharia , Girish Mahadevan 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 Hi, On Mon, Sep 24, 2018 at 4:52 PM Stephen Boyd wrote: > > We never really look at the 'ret' local variable in these functions, so > let's remove it to make way for shorter and simpler code. Furthermore, > we can shorten some lines by adding two local variables for the SE and > the message length so that everything fits in 80 columns and testing the > 'dma_buf' local variable in lieu of the 'mode' local variable. And > kernel style is to leave the return statement by itself, detached from > the rest of the function. > > Cc: Karthikeyan Ramasubramanian > Cc: Sagar Dharia > Cc: Girish Mahadevan > Cc: Doug Anderson > Signed-off-by: Stephen Boyd > --- > drivers/i2c/busses/i2c-qcom-geni.c | 79 ++++++++++++++---------------- > 1 file changed, 36 insertions(+), 43 deletions(-) It's so polished I can see my reflection in it now. Looks like this snuck in a few other cleanups compared to v2 (move "gi2c->cur = ..." to be common between tx/rx and removed a pointless init of time_left). Seems good. In total 7 lines shorter and easier to read. Reviewed-by: Douglas Anderson