Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5597330rwl; Tue, 21 Mar 2023 22:43:21 -0700 (PDT) X-Google-Smtp-Source: AK7set8hx5jabJSV/TLC7hrWnzDqdMaBXg85kwrQ2tFCC+Fcoou2bAjxTtqSOi1/EU/7ZwfRgSZW X-Received: by 2002:a17:906:6ac8:b0:7e0:eed0:8beb with SMTP id q8-20020a1709066ac800b007e0eed08bebmr5833371ejs.41.1679463800898; Tue, 21 Mar 2023 22:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679463800; cv=none; d=google.com; s=arc-20160816; b=OfTmUYCVaolEH3701SX90IqXqRRj54ZwE9VXgRoUKpM/vRxgYno3Gmog4ApAzIpMbN P43K3Paxuu1KBUDoSXSiUWOEUMAnCEJVwN3GcLQF/nrsDs1XEu1bzaUGp95Zo1WhcXyD xiZJLmndZpOT7lMSmM8NnUPCPC5CxHPGdIIqgpMyJrFx3IUP9j/8nNzBiBK6EWGTwdo2 6GZ10X3YXC0ez2OLjY9fJnhA7kJLt+2/8YDGVfuADBbMpUplggM63kmLu+oN7EVkS06U DwhNjJ5imSi/mSGLqx/syc1KVuMZavqnwBClLfHQXiMv3qCVJ+moy1aUW95kO4yzVGNi t2Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=IbpEc0TShRb+rRNJad+coLk/gTeDzfl9QacMb8n5DBg=; b=lPAPgR9xNKY4B2cTDcb3MzwTM1HnRv/NKsTYJLbF5CfVJBj0i989Gzqs1Jj2EcRDAG dwr5waJG4/7x7QGuuxJy+tKMUP2y1uUELgTlf9sahwr1FcH80QYSyrJ59ICBcMpAlQwQ awC1qIxOVIt9ajYVk7/jTSg/tN+zfDQD5RV1mztAf6Z6Bl7nMuu1t+0KrCRYdOFnI9hl RHw/tUmSiYUC5q6ubBYOTokmD2jHnFt9hWjzdlJogZi72XCd3psPj+IKf/uvt7bDK1FU HwfTAnlFGLvXtAfjnhVRj7CdD4mtNbh15SKUvpviIwsYIFWoaAtHBqWWBcfvQZPgWe3p OP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Bq4urcze; 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 n19-20020a170906701300b008e6a5c547cfsi14296151ejj.254.2023.03.21.22.42.57; Tue, 21 Mar 2023 22:43:20 -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=Bq4urcze; 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 S229885AbjCVFlB (ORCPT + 99 others); Wed, 22 Mar 2023 01:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbjCVFk6 (ORCPT ); Wed, 22 Mar 2023 01:40:58 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631FE206A4; Tue, 21 Mar 2023 22:40:57 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id c4so10438586pfl.0; Tue, 21 Mar 2023 22:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679463657; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=IbpEc0TShRb+rRNJad+coLk/gTeDzfl9QacMb8n5DBg=; b=Bq4urczeX72wjoD4FS2uQMeJuTD3w253bS8qWgHfD+D+14e94gfR8Hr2Tzg6eg9Mw3 lhFWt/LSdZS+xQdNIPuqcaLdZeQZKPyIrEEoi285Mr4tHsjxxbPotYx1sI3aevj2RWp2 XopushWam3vNZ3VINzeWPNm8Vl5ZRaFSQiR/sUlrzUEUptZ+RQ/t7bzSGCgMw3NmXMA5 fCHo7YlryhO6N2wZlXFekuRtU4aug5bFuM4crzVNOap08XjYuzZ2UvUeKpIcCxEwS+Tm 9eFpErG1sYlPN91JaZI7N2907Bzf5p5YvlY90TxQJUrtOC9R3t9YQH2PcadT1HVB+dMH 7/jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679463657; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IbpEc0TShRb+rRNJad+coLk/gTeDzfl9QacMb8n5DBg=; b=niGhTnElwi/YGD59Yxn5yqbxDaXLZHI4jcD6fLrX+yh5Ijo6ZdXpySBd5fB+q/ck4X Swx/Tl6OblT/ZAuK01xvBqcr81L56zdTSRqbssaAYMe3dnFJVZfjDKDN+U+/P5P+KBSI dT0wXHg4ArDhmV2rsmHnAD7JOgHA19x/jvSZbbWX1X+kjngR7vESZf43DxTXcbZrhApK KBGN3Zfo4YUGjTpcoUOIGpuzqWaiGvmiQQ970ycoowl7P+NFQLPyRslY7ze9BDWPSnpF 4bWCbqvDRpD9ldtUNvrxtAA+excT8b3Iv+6ygj4q249KzC5mdAmx4UmaRiBhXoO/90X9 nVaw== X-Gm-Message-State: AO0yUKVeYBlTIxJ2dowYHueiUCzeRl8NeI8PnJKFcfMpbLrCLLXUDViP peQph9yfT60oIy8MTj9ddgY= X-Received: by 2002:a62:5255:0:b0:625:e728:4c5f with SMTP id g82-20020a625255000000b00625e7284c5fmr2018209pfb.22.1679463656765; Tue, 21 Mar 2023 22:40:56 -0700 (PDT) Received: from sumitra.com ([117.245.171.219]) by smtp.gmail.com with ESMTPSA id t10-20020a63f34a000000b0050f6530959bsm5905616pgj.64.2023.03.21.22.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 22:40:56 -0700 (PDT) Date: Tue, 21 Mar 2023 22:40:51 -0700 From: Sumitra Sharma To: Marc Dietrich , Greg Kroah-Hartman , ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev Subject: [PATCH v4] Staging: nvec: Remove macro definition to_nvec_led Message-ID: <20230322054051.GA150453@sumitra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Remove definition 'to_nvec_led' because it is only used once. Rewrite the code directly in the calling function 'nvec_led_brightness_set'. Signed-off-by: Sumitra Sharma --- v2: Change patch subject and description, noted by Julia Lawall v3: Remove macro definition 'to_nvec_led' Change subject and description, noted by Greg Kroah-Hartman drivers/staging/nvec/nvec_paz00.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c index 8b4da95081c8..55d59840fca4 100644 --- a/drivers/staging/nvec/nvec_paz00.c +++ b/drivers/staging/nvec/nvec_paz00.c @@ -14,9 +14,6 @@ #include #include "nvec.h" -#define to_nvec_led(led_cdev) \ - container_of(led_cdev, struct nvec_led, cdev) - #define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'} #define NVEC_LED_MAX 8 @@ -29,7 +26,7 @@ struct nvec_led { static void nvec_led_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { - struct nvec_led *led = to_nvec_led(led_cdev); + struct nvec_led *led = container_of(led_cdev, struct nvec_led, cdev); unsigned char buf[] = NVEC_LED_REQ; buf[4] = value; -- 2.25.1