From patchwork Mon Mar 27 12:08:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 75370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1463923vqo; Mon, 27 Mar 2023 05:16:04 -0700 (PDT) X-Google-Smtp-Source: AKy350YNbHctFMdSjivB51B5j79qtP3307Ewz90XCL0X50s4IGEymKnRegbwyXoHS34aPeHPW6MQ X-Received: by 2002:a17:907:75ef:b0:933:44ef:e5b5 with SMTP id jz15-20020a17090775ef00b0093344efe5b5mr11726620ejc.30.1679919363827; Mon, 27 Mar 2023 05:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679919363; cv=none; d=google.com; s=arc-20160816; b=vWA0h/hHwm/3YENQHBsvrZgwv29ZTWcs+opWsoewNbC49haJirJbmnN1Shn2IZn3pG y3sGY/Up7hvqkOSRV0tOmBvRNeQofgR6TS98OubOs2KecmOdqEsfP9LSozQzNLFCKdxQ dsVTyrKSvE3D0Trgz2EBIqkL09vNZSuJPhwQU6dwOgbWZNdlep12zKGBfC3UfZ3PrIkq BIGZG4zy6XvVypjY04wXhXOY98P1pqkJPs6Y1iZTNQTkVK3djorwzCHRy+bLv+JUf3Is VDSL5fcc3yE2ctvj91geGku8ixG/fdL8h4/TluHro4/GrEnKEl7H27Fwy6kHOJVOiKDf u71A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=f6OgJqgpSNTTFYSUSudYbvVLpng6GaBH202qHK3zoFk=; b=q2+Hw8AuSRjhHxwjnkkgxGYv3mfZjbv85JCU8gvegDVAeGiCln5HGKFQZp0djIwQ7i bUTzSafXgs3UX1Mt7y1BsSsr5BUvGF51Qfm9tDIqxpVG4bSv21h8VoR7iRZHr1djCZHP MmzXKpBUvEdA8URlirwISKehXAe4Gu/029DS/g+KzHlKpv/P7UBMYrsK096ieDIO4z9s e76saaVfcgsTGcAldHO3wP6kDabRNhLvDNWZvEup7bnZT0shitA2Vr2yh7gWTN1tfNqP q67Ver0QWgwOXHZmb99JILNkcJc3UELN+KHooH7maXhdYL6QC4WkAvV/FVdfLZHIyNjC WKaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GRtKQ8ZP; 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=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl7-20020a170906e0c700b0093cda757bd8si11215314ejb.132.2023.03.27.05.15.37; Mon, 27 Mar 2023 05:16:03 -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=@redhat.com header.s=mimecast20190719 header.b=GRtKQ8ZP; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbjC0MJY (ORCPT + 99 others); Mon, 27 Mar 2023 08:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbjC0MJW (ORCPT ); Mon, 27 Mar 2023 08:09:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 249973A94 for ; Mon, 27 Mar 2023 05:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679918911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=f6OgJqgpSNTTFYSUSudYbvVLpng6GaBH202qHK3zoFk=; b=GRtKQ8ZPIGezvq0f9RP1TxcsJ1sz8zb38pOyP2bCjhVERraEE+Bfww0CY22xi7TzmZcndd toT2wT6HUwdZbTLD4dvw8OLAyfNkLSAFft762oSt1pGyrv9xAeEuBcQgYf/YkH9CJvA0bb tNaC1lp5QdNsQxMVDlKpg3ya/y57w8c= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-I2WpT1nbO1Oy0aDp0Vk7qA-1; Mon, 27 Mar 2023 08:08:27 -0400 X-MC-Unique: I2WpT1nbO1Oy0aDp0Vk7qA-1 Received: by mail-qt1-f197.google.com with SMTP id n10-20020a05622a11ca00b003e4e30c6c98so3123546qtk.19 for ; Mon, 27 Mar 2023 05:08:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679918907; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f6OgJqgpSNTTFYSUSudYbvVLpng6GaBH202qHK3zoFk=; b=cOjRRvBxg6WtEopH/JhshzXV/QmH7ll4IgQlTwwwtohIAmU927P0OrZzMP6X4PsP+L Mym9dkIrHwmATUHQ47eZ1TyeKUNU4UcY+BqY+Yi/kq/9wBXJ/4nGTmK+HMd9pXiksVcM 5D8aP0hElMkAuf62mLicbXQPTa8neI+GsPEogTRWIsw7+Xh70fODcfXHyattnnyb1CZj XCUdfry2OdtVRKWH35ZF9UMKlhGy/ad8tss3sTsQ0sib1O1xZFAnlLHPMa90k8Uy9stR OhlJVHw+90GKiOIpDeMM3jPVNUu7gMWZL9pJmfGbRbsU+U8CTLIkkIUBJmTiArCEJj/W znWg== X-Gm-Message-State: AO0yUKXdpzzVFr268fp48pjdQlmIkkEjJgYJ6NBPpxXMQTh4eXnkGar6 wrLKEfoN/NTHmix8ANK6CH9H1mvlnQB1NtrjhI4nuUmsEpO0He2fvXjDYsY7rkz7RjeodUjCrun IQNaTM+9mTFoTtvpmmCP0Dr62 X-Received: by 2002:ac8:574e:0:b0:3d6:d1d3:eeb8 with SMTP id 14-20020ac8574e000000b003d6d1d3eeb8mr20398694qtx.11.1679918907443; Mon, 27 Mar 2023 05:08:27 -0700 (PDT) X-Received: by 2002:ac8:574e:0:b0:3d6:d1d3:eeb8 with SMTP id 14-20020ac8574e000000b003d6d1d3eeb8mr20398655qtx.11.1679918907195; Mon, 27 Mar 2023 05:08:27 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id bn29-20020a05620a2add00b007486052d731sm1396515qkb.10.2023.03.27.05.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 05:08:26 -0700 (PDT) From: Tom Rix To: jic23@kernel.org, lars@metafoo.de, nathan@kernel.org, ndesaulniers@google.com, andriy.shevchenko@linux.intel.com, u.kleine-koenig@pengutronix.de Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix Subject: [PATCH] iio: tsl2772: remove unused prox_diode_mask variable Date: Mon, 27 Mar 2023 08:08:23 -0400 Message-Id: <20230327120823.1369700-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761523127053731518?= X-GMAIL-MSGID: =?utf-8?q?1761523127053731518?= clang with W=1 reports drivers/iio/light/tsl2772.c:576:24: error: variable 'prox_diode_mask' set but not used [-Werror,-Wunused-but-set-variable] int i, ret, num_leds, prox_diode_mask; ^ This variable is not used so remove it. Signed-off-by: Tom Rix --- drivers/iio/light/tsl2772.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index ad50baa0202c..c090405c2358 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c @@ -573,7 +573,7 @@ static int tsl2772_read_prox_led_current(struct tsl2772_chip *chip) static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) { struct device *dev = &chip->client->dev; - int i, ret, num_leds, prox_diode_mask; + int i, ret, num_leds; u32 leds[TSL2772_MAX_PROX_LEDS]; ret = device_property_count_u32(dev, "amstaos,proximity-diodes"); @@ -590,13 +590,8 @@ static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip) return ret; } - prox_diode_mask = 0; for (i = 0; i < num_leds; i++) { - if (leds[i] == 0) - prox_diode_mask |= TSL2772_DIODE0; - else if (leds[i] == 1) - prox_diode_mask |= TSL2772_DIODE1; - else { + if (leds[i] > 1) { dev_err(dev, "Invalid value %d in amstaos,proximity-diodes.\n", leds[i]); return -EINVAL; }