From patchwork Thu May 17 23:31:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n6yX3YX5z9s1w for ; Fri, 18 May 2018 09:31:48 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VzajmkQZ"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n6yX1rLRzF294 for ; Fri, 18 May 2018 09:31:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VzajmkQZ"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::22e; helo=mail-pg0-x22e.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VzajmkQZ"; dkim-atps=neutral Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com [IPv6:2607:f8b0:400e:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6y15WK3zF26D for ; Fri, 18 May 2018 09:31:21 +1000 (AEST) Received: by mail-pg0-x22e.google.com with SMTP id k2-v6so2490507pgc.1 for ; Thu, 17 May 2018 16:31:21 -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; bh=icqNr9kSUv5RHiLSq//hDt3j9CGGBAdVVuTP9HNyFBQ=; b=VzajmkQZ+G0f/cg0+UMJdgXHCxWYhP40UOiljmjU72Ln54AlI9jEXlSw6gf7SYv8bF Nwi7S96dv9CtTJMU+YeId42atGWm/JF5aSqpYCuR8az/CptYep3Jiuo+jeLzYHv/qN4q RsEv7HK9kSX9/k3HO5YrjoC9V4Wv1hOoNcmvpFGb6rcfYuqvU2HtLx7jCZ0rfw71TjCd jhTa7iLJkz9dw/oBFGtndHBHc6CVExwApghCvNetq618tKecqlBBJnXVJsgQbcWCNAl3 g1pOJtrYQjG1vpvKRDUSwxztoTd8HPb0dfdNYrWRS4eAMao49dEABwg44JteSAGnrdTq 8exw== 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; bh=icqNr9kSUv5RHiLSq//hDt3j9CGGBAdVVuTP9HNyFBQ=; b=kFhRtG6noLfYSc7DEVzodo2w+TYBEKaVTlTbDDzBahO6rfBwXZ4Efe/Yc/5fdN+uvu CeZCADY/h6Ig/N54zo/Je81GWRhrUaP4T9vbMFW12Repsdcvr2hkhvCIITfJRRd315P7 TyyFCPwrLaasfmqTI8KAdFYAqachkZpfVwFYwoDeSIIj3T6X9xvOMwrQ+qLsndEzghJp tH823TD2a6cKK9zFof88Pm04BPmN+F07wpRYqHSzpAQM7xwM2pUCKImuLxmeUBfKhsYw ghZwse+v+bhJSs6TD2BoH0Jnlz29uuJfpIzWstcu+HhCsw0NpgzCje4xR+VWfG6Xl98D +npQ== X-Gm-Message-State: ALKqPwfnTgmD5QKxf8LQ6USElMDWueZM87mB4f02nKE2m2ELjUqT6Mum T2k/MAJbDOt/JKKtVSZCUicyIVoD X-Google-Smtp-Source: AB8JxZrUT5EZl0JF6PCPpC3ksa+d2tNfbHp9G8n+CXaIl1XN25h/TSZj6Y5EgHuu7UIC23nr3lXzvA== X-Received: by 2002:a63:6ec6:: with SMTP id j189-v6mr5456759pgc.71.1526599878330; Thu, 17 May 2018 16:31:18 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:17 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:00 +1000 Message-Id: <20180517233105.8243-2-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 1/6] Fix strtok for previous tokens being NULL X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build. If the stored token nxtTok is already NULL, don't dereference src Signed-off-by: Balbir singh --- libc/string/strtok.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libc/string/strtok.c b/libc/string/strtok.c index 665c08db..aa42d77e 100644 --- a/libc/string/strtok.c +++ b/libc/string/strtok.c @@ -18,8 +18,11 @@ strtok(char *src, const char *pattern) static char *nxtTok; char *retVal = NULL; - if (!src) + if (!src) { src = nxtTok; + if (!src) + return retVal; + } while (*src) { const char *pp = pattern; From patchwork Thu May 17 23:31:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n6ys3NNPz9s1w for ; Fri, 18 May 2018 09:32:05 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nHM8j2o6"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n6ys1dzlzF284 for ; Fri, 18 May 2018 09:32:05 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nHM8j2o6"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nHM8j2o6"; dkim-atps=neutral Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6y34ZnPzF26D for ; Fri, 18 May 2018 09:31:23 +1000 (AEST) Received: by mail-pl0-x242.google.com with SMTP id t12-v6so3445055plo.7 for ; Thu, 17 May 2018 16:31:23 -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; bh=D/W0HK/I70FrCaEE+2XilrxWLw4xriEzjaeB79ifDyU=; b=nHM8j2o6iGAMouvOUa5O0K/CDnbkBCUL9G0/m3ECc0UlAtChIXMy+4SiyOhsHr/DXT ZXDw+2KnapwutPHOgxW9X53M7JcsTrWey5oi5wqN8XqnfP2lZW6EEDTcBUZk0C3yGg2t +0xlCQrvTZEodqouZ/0pc2SSJog+zHTAyIxXcVD3Je4iyqhCRrvUSPK+5EcNfIjT2Ouj Fy5lSThfrVyepkPWgYudpFByhcI60LmGvb3iugWAWnVyPhamZG8LFMUlvSE6loaNUFpW Mu1fAYOClZZq7pvmbxW3XgG4ORE0PB4cMztOZpgdLHBsK50zJ1RH0vTYz4eYhKsiCQ7f s3iQ== 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; bh=D/W0HK/I70FrCaEE+2XilrxWLw4xriEzjaeB79ifDyU=; b=sRBVaJBDU3wpoPmRdLlmuTOeVGlxxI8d8s2I61Y+hgECNyA55bTZBKQAwP599C4vhC e6ygTPpdNCh80ZWV00X1iufOwPbNs64bOc1Y+g6xi40x4O09ZqYgRTQunba42bNDqyCG GhwKcyHmUZYAmAy3fXq22e3toh7PtzWxEHE2V9JTebk9UgxIV73m8kjVOdKmmlKwchjl qbQrQF5Wyo7AHG7/InKANo7C7TDzZegNxHc4j6st5CkRNkP1Ps42vYE+reZbFq8S1kMN IgguX1sA+Bom8XR9hiw1D3fxt590up7v4wvpGmqGNVsTd+LjrKqYrmp4NfSuSKC2gNpW +Nmw== X-Gm-Message-State: ALKqPwfziIN56ECqXIvKtzbM5iZY6Iy+3AA0IYDfOSud69UoBpe9XMq9 ZoruemTvub8aBrHhPwHVQwS9Lurd X-Google-Smtp-Source: AB8JxZr4uw+pHgd0NIssUJCWJreTn6+e8S058HevfI5YSJ2iqwKwdGOagdcLFmolDZ0Bojd/CRQLag== X-Received: by 2002:a17:902:8f94:: with SMTP id z20-v6mr7118943plo.391.1526599881381; Thu, 17 May 2018 16:31:21 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:20 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:01 +1000 Message-Id: <20180517233105.8243-3-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 2/6] check for NULL input string in is_sai_loc_code X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build, also constant-ify the input parameter. Signed-off-by: Balbir singh Reviewed-by: Vasant Hegde --- hw/fsp/fsp-leds.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c index 0fe03094..9040c0a4 100644 --- a/hw/fsp/fsp-leds.c +++ b/hw/fsp/fsp-leds.c @@ -203,9 +203,12 @@ static inline void opal_led_update_complete(u64 async_token, u64 result) opal_queue_msg(OPAL_MSG_ASYNC_COMP, NULL, NULL, async_token, result); } -static inline bool is_sai_loc_code(char *loc_code) +static inline bool is_sai_loc_code(const char *loc_code) { - if (!strcmp(sai_data.loc_code, loc_code)) + if (!loc_code) + return false; + + if (!strncmp(sai_data.loc_code, loc_code, strlen(sai_data.loc_code))) return true; return false; From patchwork Thu May 17 23:31:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n6zD6d16z9s1w for ; Fri, 18 May 2018 09:32:24 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSt+DEwU"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n6zD4dgbzF28R for ; Fri, 18 May 2018 09:32:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSt+DEwU"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::232; helo=mail-pl0-x232.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSt+DEwU"; dkim-atps=neutral Received: from mail-pl0-x232.google.com (mail-pl0-x232.google.com [IPv6:2607:f8b0:400e:c01::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6y64071zF28B for ; Fri, 18 May 2018 09:31:26 +1000 (AEST) Received: by mail-pl0-x232.google.com with SMTP id u6-v6so3443775pls.9 for ; Thu, 17 May 2018 16:31:26 -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; bh=jGRQw1v0JuIKmtm0zLKAQvCrGFQP5hEtVYwa2SBFlgo=; b=uSt+DEwUHN5DDHApXVTTaB1HyJ7nhRTlpeh3pnVeFTNHkOKPxWHTHtwWhLdCWjRr/O 2wmOVty8nzVfGq/Xlzqafa8rEZd/uGDvdql82kUEk7xR/wDS+XzPcdNkijb9Yk6L820v 0anJH2rufZGmpJ7XZ1f/0xlhJ60JGcCFLpC8fTcBQ/C4Q2ZDB7RJ5jrPpR/Y2aimh0jp NcA94Gdrs+VKMkeqSfNrRSepQgybUywkwrMOkq0Yvh8FZ6cpDvel6Z+RQW05mu7DlilX ua9jhqERve5GaT55zihYaMvP2sG3oFcyE4CbeM1dJfelo1XKnG4KdZ2FS4I/vLSB+tDh fQHQ== 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; bh=jGRQw1v0JuIKmtm0zLKAQvCrGFQP5hEtVYwa2SBFlgo=; b=fpYJv1d0c8AAD8fGg/FEfovusv02KToJzdEvsScxJrsLlk+XyG4BgOMkI4Cc7jgOWO Q6hA9ZtYlMAo4UeGYvFicosSIJ9+VY4QtWqd54dl6VzUzwgIIMH3JDek4E+q5ecR3t8A xv0t6x8Oiscz9noIAwBq6F8lTFZ6l7gjcohrdQL4BnnjbYzFGN4/wQrhAzdKuaeeJ02i 3pkZ7/akxdvcAa/VwPt6rux+bwJ5cNmiOCNOAAKOKMfIjWqGQ/h9WRtF3P4lqpyNYAYR gmnsaMhHuOdQJvzidbEbjv63GNEOiK2XLEgTtICWa8ZPWYPdCrRMeuFJXupUuIUAe5rq lDmw== X-Gm-Message-State: ALKqPwdjA1ljBP3XTLwmd451dFZfJkdFdYMZBy8yX9D6Uu3YBOv4o7li jZ7awZlbYPk0ptLRPY/6eZifidqx X-Google-Smtp-Source: AB8JxZqMGU36OrkvZmNFrM1jvrZYgV/PV+z8RFZ5lNaLJ0drdqiXb0A13d8jzi3a4Vqx9OYuVNne8w== X-Received: by 2002:a17:902:5a0d:: with SMTP id q13-v6mr7069712pli.199.1526599884242; Thu, 17 May 2018 16:31:24 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:23 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:02 +1000 Message-Id: <20180517233105.8243-4-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 3/6] mbox/flash: Remove dead code X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build, attn is passed in by value and modified but not read after that. Signed-off-by: Balbir singh --- libflash/mbox-flash.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libflash/mbox-flash.c b/libflash/mbox-flash.c index dd1f11c2..6742d215 100644 --- a/libflash/mbox-flash.c +++ b/libflash/mbox-flash.c @@ -947,9 +947,6 @@ static void mbox_flash_attn(uint8_t attn, void *priv) } else { mbox_flash->pause = false; } - - if (attn & MBOX_ATTN_BMC_DAEMON_READY) - attn &= ~MBOX_ATTN_BMC_DAEMON_READY; } static void mbox_flash_callback(struct bmc_mbox_msg *msg, void *priv) From patchwork Thu May 17 23:31:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n6zZ00NJz9s1w for ; Fri, 18 May 2018 09:32:42 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="r9daS0Fq"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n6zY5Yc6zF284 for ; Fri, 18 May 2018 09:32:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="r9daS0Fq"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="r9daS0Fq"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6y93xcLzF26D for ; Fri, 18 May 2018 09:31:29 +1000 (AEST) Received: by mail-pl0-x243.google.com with SMTP id t12-v6so3445165plo.7 for ; Thu, 17 May 2018 16:31:29 -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; bh=m4xBQs2sigM5WHAYAsC9WDFKtHDZidwgz0zNQQE5mGo=; b=r9daS0FqXvj9L5G+e+bP6S9yR2xMjarR0X8ihJBOHZkBdNYGP+IZxxUzU/6teHQoRe JQaPcnKCPvOkqDil0T/fmPgzltRfApdr1/+YTEG04Y16/t6KW6M0FVM6wmyXqCWo6uGy cl4rThoSMV3ziTBhRNaCLFiauUCIHfojNg+F6/y7mGHKqYHiodF/LrHrf2ViTlZ/U3d2 z0PQk3Q0rcY3SP67TVMG3DpzwS+fRcOmvmx6alSCD0ynlA2KmogVvVfqJGL35MF/YSbI 0JM2Mk95sVZHBGsT48t00TjhMVI5MSszRcDAER7ffJWzjiy/9h35/RbYfLU2Kw0JY/qA svNA== 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; bh=m4xBQs2sigM5WHAYAsC9WDFKtHDZidwgz0zNQQE5mGo=; b=Gg81fZ8cQuNWFJLJNdJ2oWphtidSVnCcb87w/0AHReCElidrhrTvleU18uCCzx5eCz WlDrgMBYwAD9ei2kubPrB/OVArIUdJv0+obWhbuz9wPhvXDm5onRKW1xWkXiPIQ9y55a 0WyzJeTl5Iq8fwzNSj89M6BeoRXRN7WtjiZj9IJfFRuQvO7zfDrBB/XpHyWKu6ScMv+J ZgdsdEiBIB2DX1XwqV2BZJO8qMnfxVBX16PC1mrsYUjK1nf2ilR4mJGazg25uUNl3X5J w/LgrxUtz81JhuOq1zr6NwQB8Un88eeK0SaE0IRp5KMN3OyH7wg2xzSOJcAZB9eimtmX Lgxw== X-Gm-Message-State: ALKqPwfatmlQJTiuXM47w/NrSrB0HKGbkZJo0Na55c2zsc22Vq7+evza O8DPn+lkbM0iVRk5TsmHbRQR6izO X-Google-Smtp-Source: AB8JxZrgQ4BjGT271uHwr+vuFSAHuswYoeHnBR1bTBQDqX8Z560rsqsYzU40wbrJ/MOazzwNQrabOg== X-Received: by 2002:a17:902:70c9:: with SMTP id l9-v6mr7037633plt.382.1526599887280; Thu, 17 May 2018 16:31:27 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:26 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:03 +1000 Message-Id: <20180517233105.8243-5-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 4/6] p9/stop_api: Remove unnecessary stores X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build, good compilers will optimise them away anyway, but it's good to not have unnecessary code to begin with. I guess we need to propagate these fixes back to other sources, so that our rebasing is easy in the future. Signed-off-by: Balbir singh --- libpore/p9_stop_api.C | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C index 5c0f2e5e..c1a731f5 100644 --- a/libpore/p9_stop_api.C +++ b/libpore/p9_stop_api.C @@ -182,8 +182,8 @@ static StopReturnCode_t validateSprImageInputs( void* const i_pImage, static uint32_t getOriInstruction( const uint16_t i_Rs, const uint16_t i_Ra, const uint16_t i_data ) { - uint32_t oriInstOpcode = 0; - oriInstOpcode = 0; + uint32_t oriInstOpcode; + oriInstOpcode = ORI_OPCODE << 26; oriInstOpcode |= i_Rs << 21; oriInstOpcode |= i_Ra << 16; @@ -237,7 +237,7 @@ static uint32_t getOrisInstruction( const uint16_t i_Rs, const uint16_t i_Ra, const uint16_t i_data ) { uint32_t orisInstOpcode; - orisInstOpcode = 0; + orisInstOpcode = ORIS_OPCODE << 26; orisInstOpcode |= ( i_Rs & 0x001F ) << 21 | ( i_Ra & 0x001F ) << 16; orisInstOpcode |= i_data; @@ -278,8 +278,8 @@ static uint32_t getMtsprInstruction( const uint16_t i_Rs, const uint16_t i_Spr ) static uint32_t getRldicrInstruction( const uint16_t i_Ra, const uint16_t i_Rs, const uint16_t i_sh, uint16_t i_me ) { - uint32_t rldicrInstOpcode = 0; - rldicrInstOpcode = 0; + uint32_t rldicrInstOpcode; + rldicrInstOpcode = ((RLDICR_OPCODE << 26 ) | ( i_Rs << 21 ) | ( i_Ra << 16 )); rldicrInstOpcode |= ( ( i_sh & 0x001F ) << 11 ) | (RLDICR_CONST << 2 ); rldicrInstOpcode |= (( i_sh & 0x0020 ) >> 4); @@ -412,7 +412,6 @@ static StopReturnCode_t updateSprEntryInImage( uint32_t* i_pSprEntryLocation, *i_pSprEntryLocation = tempInst; i_pSprEntryLocation += SIZE_PER_SPR_RESTORE_INST; - tempRegData = (uint16_t)i_regData; //get bit b48-b63 of SPR restore value to R0 tempInst = getOriInstruction( regRs, regRa, (uint16_t)i_regData ); *i_pSprEntryLocation = tempInst; From patchwork Thu May 17 23:31:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n6zv5bnvz9s1w for ; Fri, 18 May 2018 09:32:59 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M3lP6IXU"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n6zv3r2FzF28D for ; Fri, 18 May 2018 09:32:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M3lP6IXU"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::229; helo=mail-pf0-x229.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M3lP6IXU"; dkim-atps=neutral Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6yD5N2WzF294 for ; Fri, 18 May 2018 09:31:32 +1000 (AEST) Received: by mail-pf0-x229.google.com with SMTP id e9-v6so2822448pfi.4 for ; Thu, 17 May 2018 16:31:32 -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; bh=ZOXRB3814wl026/P58gcHw9hS1AQSDVXkCsnadfKcZY=; b=M3lP6IXUaI2HH9clFqjy5tekCWAPZIIruLu41/XYeUg80KW4Mnatxcw+8iKV9OINPx cRr1spg0xqjl85C9dSqSmt3IKBrImLdaqPHr3iSSsJeuVH1x0yqS2PY4PRcAWB2Xj1XW fn/5OtDkdLn+XUhdxWVrX2QRNnXu/KYn11h3tzpcSUvR4hHBvuZJaILMZ47+3U60qdpT CqdFIM4Y2dH8bq0CzcnI1qZgI2Bc6QggELCOjkjzeFfTwiVB3rmk4Zy3TUANxMWk/XHU OfSeH4EZSZco9o5xNv5z8+gz/hc0U7fmLIleTrcwEmQ9hqW/z+4QPnenVctAU807Cek3 YvCQ== 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; bh=ZOXRB3814wl026/P58gcHw9hS1AQSDVXkCsnadfKcZY=; b=C4qFMCt8UcNtx70H/GrBJREHfrhhWBX6XCTZNIomXm4UaZqXOYdfp/vwH8f4+HJVff pL7ezfiqhQrLkSaQrWoyZWryDNdbkr2nFGqaOYDLy+I2EiNf09SFWCWFu/qrFXebTOIo MQhVgfbp9eqtP6mfQZT5NZz+pLqdHy4+xrNw9BPxffBs82mE+JP4wtYj7XJQE2b2RTX9 2UfwmK5AGOSm09biwqF28Tab7BHMdquAyZF/vPfFSNrR7yPtsIPtOBRaq5EQp/21HLzN Qfr9uDAF45L9iK7QQjVxAzOpEbP6ys7TqxwF2+KvZWzbmZKHks0dQ+8x7WUesjoZt/Gv 1wYw== X-Gm-Message-State: ALKqPwdCvNksZqQg1ajCX7YyTifpFBcnVbuTA1Za+/sHRw+XfEP/MB8/ af/URjiVYjQ4V23wEneZlAFxf6r4 X-Google-Smtp-Source: AB8JxZpCParJio6M1sv7L7tnq9XsyDXlXhC3tn3PMMjTZlV6d/24PyKRl4dMuvFownEDragiONoqiA== X-Received: by 2002:a62:6402:: with SMTP id y2-v6mr6816889pfb.71.1526599890233; Thu, 17 May 2018 16:31:30 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:29 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:04 +1000 Message-Id: <20180517233105.8243-6-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 5/6] libflash/blocklevel_write: Fix missing error handling X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build, we seem to trap the errors in rc, but not take any recovery action during blocklevel_write. Signed-off-by: Balbir singh --- libflash/blocklevel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c index f3fad69e..172f8fcc 100644 --- a/libflash/blocklevel.c +++ b/libflash/blocklevel.c @@ -263,6 +263,7 @@ int blocklevel_write(struct blocklevel_device *bl, uint64_t pos, const void *buf if (rc) { errno = EBADF; rc = FLASH_ERR_ECC_INVALID; + goto out; } /* @@ -274,6 +275,7 @@ int blocklevel_write(struct blocklevel_device *bl, uint64_t pos, const void *buf if (rc) { errno = EBADF; rc = FLASH_ERR_ECC_INVALID; + goto out; } if (memcpy_to_ecc_unaligned(buffer, buf, len, ecc_diff)) { From patchwork Thu May 17 23:31:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 915864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40n70G0dfnz9s1w for ; Fri, 18 May 2018 09:33:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="egKUb7dQ"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40n70F5wzHzF28g for ; Fri, 18 May 2018 09:33:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="egKUb7dQ"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::243; helo=mail-pf0-x243.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="egKUb7dQ"; dkim-atps=neutral Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40n6yH3hK4zF28h for ; Fri, 18 May 2018 09:31:35 +1000 (AEST) Received: by mail-pf0-x243.google.com with SMTP id w129-v6so2819063pfd.3 for ; Thu, 17 May 2018 16:31:35 -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; bh=KsZEQVP/mCCqXVhh9LDh4vLfN8HHgC/wPmwb/YKL6Jc=; b=egKUb7dQWl8YumpWYmHYT+WlvpnYYudQL5MnZI8GcLbjzluCtprPhrFdkosAWkpcSl v0jXEGAGc3IdmemVX4BdBMXHKtZ2eUxrV61lUhW5vNbootTDA7Ub2/49HF6gKBTOmAAH H4jUQbl83KGzfznfRVbIsDnOdFdzio04Z7GFR2HjMAYG6TWlYnw8P1DZSdq90vmO8KGH uWwFwZsDx/O8nemPTDAQIra4ESeeM7kggWPnKHYnTwHsRNtXcc1ItjieWqcm7ZU57+TR UtyREhKopYMttNZmxxUk8oQ39Xfgvims3aVUm2b2QhYMYNSeUUw5Q/8I44KQgZ+3VYBL 0uKQ== 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; bh=KsZEQVP/mCCqXVhh9LDh4vLfN8HHgC/wPmwb/YKL6Jc=; b=VqCYTnbbajcRq+bE2Qq5FJuplKpqDyIAbTGqRhd44ZOMp7/kcGNY498NelWvF4y2qw +zcg8HdWiTwtppxJX+cDg08y6cwiJ9qfNjg18fCIwjFYE4uOQVeaCjALlbJbSnK+dLq2 pBkFFqzOj79i4U6QzZYWSj42yNYcXd22TModkdPfuoNQ3N+DGUT8PVv9S0pz1Ys+a+d8 FXspt7fuvik6aFl6ulpB0l7xOGPuRZqaxpiCNa5KbAVcCehcHkdV5MJoC6dT5e4MVePC UdfLiKtJ9cHB9e5LQ7gA8p5eKXpkMIi7ONJyxd8jD8kIGTa313LO9m9c7VOmQNb4eTlU xfHA== X-Gm-Message-State: ALKqPwclsG5z6HH59iD8yFbjPKTJxPiQUB/H8orMbJOmO7IbefMjv6Ys kUVC3GWLJLZD3PBlCRD1v08wIDTs X-Google-Smtp-Source: AB8JxZpF7jZ9MZn3owAm6r4UzRv2AHYsoXG4OHXkeSkhJrufN9i0tY5+DWU9wYQtKKeIS4JwvdMmMA== X-Received: by 2002:a65:4a46:: with SMTP id a6-v6mr5585783pgu.227.1526599893154; Thu, 17 May 2018 16:31:33 -0700 (PDT) Received: from localhost.localdomain (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id q76-v6sm12805990pfi.139.2018.05.17.16.31.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:31:32 -0700 (PDT) From: Balbir singh To: skiboot@lists.ozlabs.org Date: Fri, 18 May 2018 09:31:05 +1000 Message-Id: <20180517233105.8243-7-bsingharora@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517233105.8243-1-bsingharora@gmail.com> References: <20180517233105.8243-1-bsingharora@gmail.com> Subject: [Skiboot] [PATCH 6/6] libflash/blocklevel.c: Remove unused store to ecc_len X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Caught by scan-build. We rewrite ecc_len with a different value prior to use Signed-off-by: Balbir singh --- libflash/blocklevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c index 172f8fcc..bbcc8e61 100644 --- a/libflash/blocklevel.c +++ b/libflash/blocklevel.c @@ -205,7 +205,7 @@ int blocklevel_write(struct blocklevel_device *bl, uint64_t pos, const void *buf { int rc, ecc_protection; struct ecc64 *buffer; - uint64_t ecc_len = ecc_buffer_size(len); + uint64_t ecc_len; uint64_t ecc_start, ecc_pos, ecc_diff; FL_DBG("%s: 0x%" PRIx64 "\t%p\t0x%" PRIx64 "\n", __func__, pos, buf, len);