Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1161063imi; Fri, 1 Jul 2022 04:30:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vuyiX2r9MFndfoOxlguL6/kZkvh1Hkg0rlnUCEr5YmRQRtqVn98hrVo4BNxZelVMJjeXtH X-Received: by 2002:a05:6402:400c:b0:437:d11f:f7d3 with SMTP id d12-20020a056402400c00b00437d11ff7d3mr18680102eda.256.1656675046227; Fri, 01 Jul 2022 04:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656675046; cv=none; d=google.com; s=arc-20160816; b=Xq1bFJ4vS/7Zniyj8nsDIseHIZKhb/PGJUAsSZ+XEFh7/nEk2PIYuDq2Kbm/DQquH0 4JKTeaSnFCJ2I5LApbHDRdwtO0M/BBDmpWHSaSeIZWe5GxiS32+T7o4lGDco0MFqatsO KnSNBfRzyCPsA6Y4KVtLBIQxgfsE9roYDLQ5YIKrQ6KRRZAVZA9xCA3ZY9YGphHBw9mC UNDzuHGXK/71/jLm9LyiGuc7jhQ6kEBgD2cIyV3IKqOCoMK2viSya4EGfw+bsTxKZwWb jn2A58fr+SLsLx4QSmgbCnvtsC+yKsEiLHmoEcRiJOoJrNyKFplKyvLwLyE9vuXOURlS /yAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=kPJJjylIpBkQ8W7Ml6hHpSSjjYliXppQHMQmyiUop9Q=; b=Pt0u4vw3mPrATWmoUoBqAzzFDah/dMTD9DAlxzmGI5cNrXFP8+S0jsHVcda+g+s2d8 cYl1VE3MFA2mal+JT2cvTZDpZ5NiEx5kP3XbyNnPM2kvhDGMrk/Hx/bSkJAb9DkH1on8 jZlfWmyr0wpLFQltjjEldLCD/MmbnCq5QFOLZn48hqztndzFZ7cBbFxerY5EqQs3itHG 4XgosiLSr9wqhwGPeEf75G36QRwj8sy3r4SHfPuuG9uSMyLhoJm2TNezFefB0xTtCi/O VA+OcUP1L1Kb1Q+kC3KKDCB4eiP28TjYR7q/qVJYKg7tCFY54o7x5kmWeHGCvYSe4AH2 IKyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L1IPD8ni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp28-20020a1709073e1c00b006e8d07f934dsi31596017ejc.45.2022.07.01.04.30.20; Fri, 01 Jul 2022 04:30:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L1IPD8ni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234438AbiGAL13 (ORCPT + 99 others); Fri, 1 Jul 2022 07:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbiGAL12 (ORCPT ); Fri, 1 Jul 2022 07:27:28 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9DAD81484; Fri, 1 Jul 2022 04:27:27 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id ej4so2547250edb.7; Fri, 01 Jul 2022 04:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=kPJJjylIpBkQ8W7Ml6hHpSSjjYliXppQHMQmyiUop9Q=; b=L1IPD8ninOruMAbXZlKHku59T3sS5xXk+D9sBBiOg/rk1J6jDylYkWEK/coJsiGpB9 /4sjWjEaryt0I3Is97qYC5cqLSxIonGDXwChh47Mz5LKZbjz+Iw4moJxMCQhbxjGW+pX ihNGXvBG6j0giHRLnYrOm9/QxgDrUvTbOU2Dsier3V+MuxvZqXbCXFOxA3YjKyRxATYm yT8RhhHKAOiRXpvyWAvjZlkTBoXsHftq4IqpedCo9dIQN1QWzivBcIjkuIm8jkEi3k+A F6k7xaRNMKW0QS9vNOI9Ye6/c9i8j1udo8US4ftQqAX+KBEMz/0wNEnxFIuVAEDLGh1V DXuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kPJJjylIpBkQ8W7Ml6hHpSSjjYliXppQHMQmyiUop9Q=; b=7rhOS1eFqY2W+b3+9JW5ssTA42oNJvU0htNYO5eVbAOacH0pyJLstCHshp5lcS39Py VFRaWDMtL2CFJnkJEK1vsMhc9u14fETfady1riffaSi3/LHXBLkIPLEPOTXi6NZINOv5 SCIS5guHEJnDTvHuQCT5iC09sItlvEJhaO1icBP3VkoslUvkF470xLnoblg28QtUuShv v62Wrfl8cqKCpLvstJTpPfBpovufCGE7XwzujEJOgWf3MYwmH2CuULFjy73yHGU4BuCc ZJX4FkuPG8PZi3N04UbANj2fVlLClV/onvKRm18V4Vhf5SKMB89tDhxt7AGOzSB+F7kl mdjQ== X-Gm-Message-State: AJIora9m9iUaEkuyVazpMYeVwOrq4uxB4ndxyjgo32AC6/44ZycI4IrN xDUGi7v9/BxBZtGFpX6cqgSx+g6XOfM= X-Received: by 2002:a50:fc15:0:b0:435:7897:e8ab with SMTP id i21-20020a50fc15000000b004357897e8abmr18287719edr.17.1656674846155; Fri, 01 Jul 2022 04:27:26 -0700 (PDT) Received: from felia.fritz.box (200116b826fa4e0041b3c167ba41e809.dip.versatel-1u1.de. [2001:16b8:26fa:4e00:41b3:c167:ba41:e809]) by smtp.gmail.com with ESMTPSA id ds12-20020a0564021ccc00b00437d3e6c4c7sm4764548edb.53.2022.07.01.04.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 04:27:25 -0700 (PDT) From: Lukas Bulwahn To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , llvm@lists.linux.dev, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH] HID: core: remove unneeded assignment in hid_process_report() Date: Fri, 1 Jul 2022 13:27:20 +0200 Message-Id: <20220701112720.13452-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit bebcc522fbee ("HID: core: for input reports, process the usages by priority list") split the iteration into two distinct loops in hid_process_report(). After this change, the variable field is only used while iterating in the second loop and the assignment of values to this variable in the first loop is simply not needed. Remove the unneeded assignment during retrieval. No functional change and no change in the resulting object code. This was discovered as a dead store with clang-analyzer. Signed-off-by: Lukas Bulwahn --- Benjamin, Jiri, please pick this minor non-urgent clean-up patch. drivers/hid/hid-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 00154a1cd2d8..b7f5566e338d 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1662,7 +1662,7 @@ static void hid_process_report(struct hid_device *hid, /* first retrieve all incoming values in data */ for (a = 0; a < report->maxfield; a++) - hid_input_fetch_field(hid, field = report->field[a], data); + hid_input_fetch_field(hid, report->field[a], data); if (!list_empty(&report->field_entry_list)) { /* INPUT_REPORT, we have a priority list of fields */ -- 2.17.1