From patchwork Fri Jun 4 21:09:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maximilian Luz X-Patchwork-Id: 12300749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F368C4743C for ; Fri, 4 Jun 2021 21:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 376BB613EA for ; Fri, 4 Jun 2021 21:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231576AbhFDVMb (ORCPT ); Fri, 4 Jun 2021 17:12:31 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:55893 "EHLO mail-wm1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231538AbhFDVMa (ORCPT ); Fri, 4 Jun 2021 17:12:30 -0400 Received: by mail-wm1-f41.google.com with SMTP id g204so6092730wmf.5; Fri, 04 Jun 2021 14:10:30 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=0AKFf5l+McLomgCfsF7Q+cMO3Lh52G1WFJZ0xMnObWE=; b=pMrEEt1Cgo8uEWXnwBWDqgTctBJloWFySXH6FDUy01eroy/lLHkhXv6vIjZAciJQwE V0nunEXJXY/ZgD7Jw+8Ty+5HH8LZnmxAQdqQvSMcNzn7BWAJKvq1VvBEeRSkF6Jzu24K CTEjv/fCCdCQRkSL15PsekxaMCWTo83QoqiSXCpf7LfaKIoPA4tGnqRHczb2FzH6DHM9 mHqZVWnNWyVKqwrsY1spn9xxM/9byM7O446z6u5i+TJnKPIIlFwtvwtxxVwc6VAKeS2R obeyL8SF5D0wK+LbaSb2z70JloyI70ojrrxXLygfmKqbGFRPnMJAZOL5nV4fFEsFJnaR UqTQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=0AKFf5l+McLomgCfsF7Q+cMO3Lh52G1WFJZ0xMnObWE=; b=fgRRssWUkoC2ox0/h1HAgYIxOUwPTx9jpfCb5EJPrywK19yJrJjQD6D+C0Aodcpu/3 l30QIQuXi5ds1suHbj4sqBsvFSfb0OjfP2Kny82ilWowezGNCzqGd6QUcL4pOaHSFb8k hJun1hEHMCdFZdPMz92XaDvHwJbrmWPiaTVW7BUWkleVfVUvMgUQorlZ0mXvaWFXGoBg k0i83O8RKOQX1QkQ/u5GCNd7xvKTfMJO3O3GnMiR9wEK/gVy8q9kPZmNDmwMIFBGfD50 wKOZlgNFMy3En+ZfH0l/2kb5RXOXOz+BremClfd8Mk2D1uUOWNT6kivsq0FMqndgelCB fTGg== X-Gm-Message-State: AOAM533iAzLPvUwxQvWJWkszpyE9427ou+v6xTgtiIdScl5sTx3ym8qd ddnT6UpDMSMWG32mgg01m34= X-Google-Smtp-Source: ABdhPJyjeFsYffroEl2X5KiHP+lUkEVV7B/nJR6CUk8BdvQ1TLAb1szh1YMueb0F7J26wkyjXD7sTA== X-Received: by 2002:a1c:193:: with SMTP id 141mr5386613wmb.106.1622840969631; Fri, 04 Jun 2021 14:09:29 -0700 (PDT) Received: from xws.localdomain (pd9e5aba0.dip0.t-ipconnect.de. [217.229.171.160]) by smtp.gmail.com with ESMTPSA id l5sm9478853wmi.46.2021.06.04.14.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 14:09:29 -0700 (PDT) From: Maximilian Luz To: Hans de Goede Cc: Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , kernel test robot Subject: [PATCH 1/2] platform/surface: aggregator: Do not return uninitialized value Date: Fri, 4 Jun 2021 23:09:06 +0200 Message-Id: <20210604210907.25738-2-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604210907.25738-1-luzmaximilian@gmail.com> References: <20210604210907.25738-1-luzmaximilian@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The status variable in ssam_nf_refcount_disable_free() is only set when the reference count equals zero. Otherwise, it is returned uninitialized. Fix this by always initializing status to zero. Reported-by: kernel test robot Fixes: 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers") Signed-off-by: Maximilian Luz --- drivers/platform/surface/aggregator/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c index 6646f4d6e10d..634399387d76 100644 --- a/drivers/platform/surface/aggregator/controller.c +++ b/drivers/platform/surface/aggregator/controller.c @@ -2228,7 +2228,7 @@ static int ssam_nf_refcount_disable_free(struct ssam_controller *ctrl, const struct ssam_event_registry reg = entry->key.reg; const struct ssam_event_id id = entry->key.id; struct ssam_nf *nf = &ctrl->cplt.event.notif; - int status; + int status = 0; lockdep_assert_held(&nf->lock); From patchwork Fri Jun 4 21:09:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maximilian Luz X-Patchwork-Id: 12300747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EF30C4743E for ; Fri, 4 Jun 2021 21:09:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68FCB61406 for ; Fri, 4 Jun 2021 21:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhFDVLV (ORCPT ); Fri, 4 Jun 2021 17:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbhFDVLU (ORCPT ); Fri, 4 Jun 2021 17:11:20 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6503EC061767; Fri, 4 Jun 2021 14:09:33 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id z8so10532069wrp.12; Fri, 04 Jun 2021 14:09:33 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jwr4pqYVJVTXgSaj9RyCCBtkW5+6pm/zrCBK13WpZL4=; b=FSZdo9iPadT6850kuxLVCdvfxgEYWXzHErjNsP/9dbJ0P7F/UOQ5hQ1r8jTnE62Qwt 1f8ZouOGPqYtPueiPuY/MVA3C6PIyp8hI3OgO3kn8TavgR+SEHaNzeS1DpQd7g/znZ0Q D3qMgUbRP9QkCaYqyL+wO+vGlwsbP4lm9UHSb/6LRcYRcDp8bLyvvL19jT3YWELVBzjN nHynr/Jjm6Z6DndMLCg0YmpgrpqOElWnLuCABJ0wVU/pVr4Nap+/225xtpbu+dCXQ0Sy V5o+9nBXjosTHrHl+KodgqqJdJs0nZzl8grtH3Hks5ogvmLmS1s2d+TFmXuZujinpDUA m1fg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jwr4pqYVJVTXgSaj9RyCCBtkW5+6pm/zrCBK13WpZL4=; b=XkkTfP8qckMqptqeX0BDdZShpzXupyD3WyOOY+l8v0f7ABkcM5neIGDVJYawaoXg55 Jgr2Lo4VTVtHvfXam3s9BOPeenBqCbDgqbgbWJ7RKrRwN6Wa4mQuFehmb3nRzsZbmCLk qgzH7dik+pAHCjpMOm9s4RPoQsQJ20S7bJhmMhGqFzzGYbEi4RnFNWVIPdVFasNeaSO6 Yqu414K6koscHJabUxgdOPta2UtI4198Va6RKmc6+GyMj5DfifnY42+epWNOXswuCB+r zyw7rBVtswDBtMCwyCoH6/6jYD9x9bxY1nsWp424x1Sz5Kr+iSt1XJkE7MDDFt6GhG9T 6nCQ== X-Gm-Message-State: AOAM533RDlfvgCBUlBvlXJZdBq8BvoLCDGfG8IJVAn++HPnuZxDELeGB kzSXtlPqIwvF5IsoXWptEZg= X-Google-Smtp-Source: ABdhPJymazygBQaXu5lnJW9WbD5kRmU96PK3PGH2pPkfjR7Jzc40c472A+aX4eo1tC7vsKCi/xrW0g== X-Received: by 2002:adf:fc90:: with SMTP id g16mr5719893wrr.183.1622840971988; Fri, 04 Jun 2021 14:09:31 -0700 (PDT) Received: from xws.localdomain (pd9e5aba0.dip0.t-ipconnect.de. [217.229.171.160]) by smtp.gmail.com with ESMTPSA id l5sm9478853wmi.46.2021.06.04.14.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 14:09:31 -0700 (PDT) From: Maximilian Luz To: Hans de Goede Cc: Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz Subject: [PATCH 2/2] platform/surface: aggregator: Drop unnecessary variable initialization Date: Fri, 4 Jun 2021 23:09:07 +0200 Message-Id: <20210604210907.25738-3-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604210907.25738-1-luzmaximilian@gmail.com> References: <20210604210907.25738-1-luzmaximilian@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The status variable in ssam_controller_event_disable() is always set, no need to initialize it. Signed-off-by: Maximilian Luz --- drivers/platform/surface/aggregator/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c index 634399387d76..b8c377b3f932 100644 --- a/drivers/platform/surface/aggregator/controller.c +++ b/drivers/platform/surface/aggregator/controller.c @@ -2464,7 +2464,7 @@ int ssam_controller_event_disable(struct ssam_controller *ctrl, u16 rqid = ssh_tc_to_rqid(id.target_category); struct ssam_nf *nf = &ctrl->cplt.event.notif; struct ssam_nf_refcount_entry *entry; - int status = 0; + int status; if (!ssh_rqid_is_event(rqid)) return -EINVAL;