From patchwork Thu Sep 20 22:48:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10608843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D67CC112B for ; Thu, 20 Sep 2018 22:48:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAED12E0BC for ; Thu, 20 Sep 2018 22:48:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BED632E0CB; Thu, 20 Sep 2018 22:48:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B7552E0BC for ; Thu, 20 Sep 2018 22:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726103AbeIUEee (ORCPT ); Fri, 21 Sep 2018 00:34:34 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39035 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbeIUEee (ORCPT ); Fri, 21 Sep 2018 00:34:34 -0400 Received: by mail-wm1-f65.google.com with SMTP id q8-v6so1153618wmq.4; Thu, 20 Sep 2018 15:48:46 -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:mime-version :content-transfer-encoding; bh=RENaZUjJlY10LnT10ff/sqRbe8bi9rIvknGj7PyprDc=; b=p8PnYyKWp3k282LB9znUA8S+1VFkLdOT8y24+x3pNy2tClSKGYzAH/l0gjwA1K8Udn qSRuVSLhSQYErsUTDVxLYHXB/bck0XWrZ6FXiNkJ4d18eafEZNR+MdCf0zaNA+7CeGS+ rTi/+o293KpJ6X9V/rbv/hWOygvAit4wnE4g5OkXFuwV564+/FZoU+uVhsvMs4Gzt/6b LmiddpRyNBTOsG9Bef8LC6bij70/wFFDGTIPdvVd6aybXcdctC3MAwuIDT8UZw8DB+RD NGo+97VN3meXCp004PpPR7q02JmQAxTL+80aCzNN2xKGigJploN+fuaViEY7KJhQFEDo pz6A== 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:mime-version :content-transfer-encoding; bh=RENaZUjJlY10LnT10ff/sqRbe8bi9rIvknGj7PyprDc=; b=PVpAzJhkNIYkSHi7BizblHIbjzwwMXxHyjwE/lslOovf+rfxjxA4kbymFBOoMNcQtH BjTT8MHE0JYb/SU5vaaGfPHyNekjyoDC7OTX3AxeJu2JBC3RFiBo1ewA1Mq80j6OTCpc z8euofrpAZJEjvJNQ3sVdDYOH4+xPJIU2QfExQigFJMH8OAy47Z8WAWlFYvZ+MJAmPUa TUBWJ6EZFkmYlRS6qrakctSDx8Fqutr1TPL8amOV8S4AhUccAzdbt8Jug9rwB/g8DcXT xrHNzLdc52mcdl65nLOVUlGvy+VYc6HhIOyW091HLcdeYxz3GqRs/bMcty4Iwz8muq0I rXUQ== X-Gm-Message-State: ABuFfogMUhaoUoqzYePF3Tqekh8UYRhGgdw4g+7gogJsn/8sjZfMQ71S f/9i3YF8X7psmGI5RB10HSKHr8dYLu/TUw== X-Google-Smtp-Source: ANB0VdbrFXaENqko/v97cH0exzJXxtmf/R86JT38n811EIWCQZBA62hAoXz4E6SsWVWNgQOnwz7Zlg== X-Received: by 2002:a1c:3:: with SMTP id 3-v6mr4449150wma.99.1537483725111; Thu, 20 Sep 2018 15:48:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id j44-v6sm43882738wre.40.2018.09.20.15.48.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 15:48:44 -0700 (PDT) From: Nathan Chancellor To: Woojung Huh , Microchip Linux Driver Support , "David S. Miller" Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor Subject: [PATCH] net: lan78xx: Avoid unnecessary self assignment Date: Thu, 20 Sep 2018 15:48:30 -0700 Message-Id: <20180920224829.17072-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns when a variable is assigned to itself. drivers/net/usb/lan78xx.c:940:11: warning: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign] offset = offset; ~~~~~~ ^ ~~~~~~ 1 warning generated. Reorder the if statement to acheive the same result and avoid a self assignment warning. Link: https://github.com/ClangBuiltLinux/linux/issues/129 Signed-off-by: Nathan Chancellor --- drivers/net/usb/lan78xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 04f0a094d864..656441d9a955 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -936,11 +936,9 @@ static int lan78xx_read_otp(struct lan78xx_net *dev, u32 offset, ret = lan78xx_read_raw_otp(dev, 0, 1, &sig); if (ret == 0) { - if (sig == OTP_INDICATOR_1) - offset = offset; - else if (sig == OTP_INDICATOR_2) + if (sig == OTP_INDICATOR_2) offset += 0x100; - else + else if (sig != OTP_INDICATOR_1) ret = -EINVAL; if (!ret) ret = lan78xx_read_raw_otp(dev, offset, length, data);