From patchwork Mon Jun 25 17:05:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 139867 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4226803lji; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0ygcemNxdXWWEtTeDsLN4gfmMXVsL8AqXmbhYHcTHVbvrCPWA2+BSS3TCoQcT6QOs2MxQ X-Received: by 2002:a62:ec48:: with SMTP id k69-v6mr5400686pfh.85.1529946366295; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529946366; cv=none; d=google.com; s=arc-20160816; b=sXKwXzvqodsyOw60GG9nD0Ze97PoI7M1bDKmRW40Wp0Vwi3GfsoIy9WTudq7exz5I/ aa4KgPdUw6PW+nCPQbDc7lBjKL6Pl1OOSUsn8paM4psXdu9a86wnAYUToys9Oquyl5IO VoeUm5zMdbhE8pEw50z2X2Sa+POO1a/niO2UkDSp0c1B5rT4Fyw6uvJ0pER2+uofSLl2 N726vzFMdYcSurEM6rPEfO/rVwXkFkfoo2UKuafhK5+jhdRC5rbbDWACDch1c+c+uC6W r+tGrHbadJCUaN538JEEFJZRe4KgF6i7W1nonILSip69gSPWTfY3Dp4e/Ts2FIijnfYP i6Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=zz1Gd0CJ4dL0OpWOWcWIhFE9lqiROnFWeFHNhL0fAbs=; b=M6wPmfwE/DcmFYzSkQvZvwWJ5w18vMdymO3c7SU3GVkXfWrBl+/lh/vWBXDAfeY81w x6tX+MEtZOFyhu9iU782YQfkwX0cBlYoIKrS/CmEsyeW9zxC2TRJwU1KNnAmV+2Z/cea CU58TzqwUkkCNbDBEys5NhUmUBQUqfMV3H8A/94tSkbN8KgH72oDIwDi13pXmsGtzPOy VMn2XPpg3k48MVNeiG9OLDH3jDLyaU1ucGw1K3M1ikkEqDji4NWug+VzNgsbGw4X7y7B UXngKNt9MBSo/Rq0ufmSZS2omC8SPZPAHWXXiE0Q/x0QwHJUEvxgaMJf1GG8q/xiIhdx 2Zgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CVLGxjuu; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si14986400plr.220.2018.06.25.10.06.05; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CVLGxjuu; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbeFYRGD (ORCPT + 13 others); Mon, 25 Jun 2018 13:06:03 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37824 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933724AbeFYRGC (ORCPT ); Mon, 25 Jun 2018 13:06:02 -0400 Received: by mail-oi0-f65.google.com with SMTP id l22-v6so13193093oib.4 for ; Mon, 25 Jun 2018 10:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vS/Rkz1ezzwRYGtrUcXOFOjNKWKGX/LOIhUbBcIy8+8=; b=CVLGxjuucFstKOluLBUxaFh3LeGlKWpheoF7AR9yutlieIBI33iBrKil03Z4JamNuV 0UdumWkoESoKpTAr0fYSwYKEJWN3yZklAX7bB0RxocPzPCWfN1MnEX+199KLyCj3MppQ ENfnJLuAw+hW4IiOmob2DxlsxPOjQ0Z6xtjRU= 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; bh=vS/Rkz1ezzwRYGtrUcXOFOjNKWKGX/LOIhUbBcIy8+8=; b=sZ6Cp7keN+RsESwEAik3+dyieF/u4M+9sW1TtGvhbVb3w7DuT3JHVzygs9dgeUkugi dSDZkyLfuXNaWMF7IhUqf5dQVkbJV/Uz0UN2oD9Jz7TYtoaNRVS6HXRrcBKY1ny4Q7Ol Od4W5QeflHjkjFrR+62HxpbPeq5HjbFd0iMvU1GQbmx2xlQCsFCnyLF1mAdyrela7Z2p 9qjS+Rvu3pLkPkZ9Jwu4wnojBksSQXlH6iJAJJlKhsiWgFKnwkg0nFLEQddN9AG40mi6 RBNDQKAupbmmutWT61Xv3V47yDOsTAnP5Jd2YoE0JdzsXZfPWbcLTIeWVv8HPO0Pl0BZ Q3zw== X-Gm-Message-State: APt69E3RzmSyYl9kb0zBflUCxFFZXUUgoqVVHY4In6O3mbjzC8ZbJ7E9 q10aXEx3JjDSeMbY1Sa42DpZrszjV5U= X-Received: by 2002:aca:dd83:: with SMTP id u125-v6mr7692575oig.39.1529946360930; Mon, 25 Jun 2018 10:06:00 -0700 (PDT) Received: from localhost ([2600:1700:141:4960:88f5:ab30:e569:4ad6]) by smtp.gmail.com with ESMTPSA id t204-v6sm8333778oig.24.2018.06.25.10.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 10:05:59 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: Bjorn Andersson , mahesh sivasubramanian , Linus Torvalds , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Andy Gross Subject: [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Date: Mon, 25 Jun 2018 12:05:46 -0500 Message-Id: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch fixes a couple of checks for errno that should have been checking for ret < 0. Signed-off-by: Andy Gross --- drivers/soc/qcom/cmd-db.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Bjorn Andersson diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index a6f6462..deb2b90 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -121,7 +121,7 @@ rsc_offset(struct rsc_hdr *hdr, struct entry_header *ent) /** * cmd_db_ready - Indicates if command DB is available * - * Return: 0 on success, errno otherwise + * Return: 0 on success, -errno otherwise */ int cmd_db_ready(void) { @@ -143,7 +143,7 @@ static int cmd_db_get_header(const char *id, struct entry_header *eh, u8 query[8]; ret = cmd_db_ready(); - if (ret) + if (ret < 0) return ret; if (!eh || !rh) @@ -202,7 +202,7 @@ EXPORT_SYMBOL(cmd_db_read_addr); * @data: Data buffer to copy returned aux data to. Returns size on NULL * @len: Caller provides size of data buffer passed in. * - * Return: size of data on success, errno otherwise + * Return: size of data on success, -errno otherwise */ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) { @@ -215,7 +215,7 @@ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) return -EINVAL; ret = cmd_db_get_header(id, &ent, &rsc_hdr); - if (ret) + if (ret < 0) return ret; ent_len = le16_to_cpu(ent.len); From patchwork Mon Jun 25 17:05:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 139868 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4226894lji; Mon, 25 Jun 2018 10:06:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2AmIzrEYDI4Gmw2TJyx0333uZI7AMu4chTeLyM+g2wNtg7WQUWWKYHiNVroI8OcpCmlJ+ X-Received: by 2002:a65:46cb:: with SMTP id n11-v6mr11158616pgr.193.1529946371751; Mon, 25 Jun 2018 10:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529946371; cv=none; d=google.com; s=arc-20160816; b=DEUbK7WXwYkkCEcAtBF8mQ7qYQA8UO9VSvJSF3b2Fl6Vjx2TIpNQiJL94kqQcnC7a9 Wp0Sqzwk/A8sI/GqO0ffzC07ZHGK0P6qOv+Wo8bILp8HVxoiDQW3oKoq9d8Zevth1399 glkEHoA37xieMmzUrWCuo5/5g4wiCROt5VyezMYpUUnbo9xbdnBVnl0BVcdcBHgV/zOO 3mOmHbGtty5gcsolQSFOXZs15zudsBFwFDccZp9NgI8ZovIpmi/XJGjM/ENoIlwFZoZ0 wpplR3GZWXzxrBQdPoccFS+zqzhDlcjgplN0+SYI/JQ7dHbQtG2ztFUiieuLtP0ii7lv NjuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=daqR6cG447yPm4DgR/lp4Q0O3+x6I6IBs1fdPxSytcM=; b=IHAPbkEdHdyh8JTvJ5KvMIgOMSjcZKPkM38OVWXHSwV5fzlrzle8to+zAcJj1lv/2o kRqHqDvomV5psPEzy9hjRD/ydLhx0pPjCtNjeC1gzuyq/nC0DCM2W3Wj+jMP+Oy4S0qJ ShrbjfJTk7RZ+qDFn3IAw4FRP8//E7wdxEfPhdw1CXLVkGWQylEdO2fuufdSpRDZpxvn Xfobl/vPn4ugDtFUz06jRQ+mQdy30OIC1NWI0dSQruj/6wJk2ngfBSrLIfpl/SEwLpj+ FMIJtef+WdYzYro6jK7Gx09AH/QCc/RpPA9OYrT9F7BEa21cQOfJX4omWKm1m13a99pC Fy0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ioKp+NLa; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si14986400plr.220.2018.06.25.10.06.11; Mon, 25 Jun 2018 10:06:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ioKp+NLa; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934333AbeFYRGK (ORCPT + 13 others); Mon, 25 Jun 2018 13:06:10 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:43856 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933724AbeFYRGJ (ORCPT ); Mon, 25 Jun 2018 13:06:09 -0400 Received: by mail-ot0-f196.google.com with SMTP id i19-v6so15854193otk.10 for ; Mon, 25 Jun 2018 10:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ol+wIMDDYu7e+V4lYapWAJa5L3g/Qmnqf/iFLZIOIM=; b=ioKp+NLawQukvJIRNPAFBoJRd045XkfC82U9I9NPgY78EtRO0TnWXVAVNOxuYbpggL 9RIuU2rSg4xFCi2tYdaxMq/qjhGbp2i1C1aY1dGn8dtXd7wSrCm/kQ/NmWCUpqe4GkRg kunAfaIOK8Xnu5KQzqct4kWuvo9bXczOVSkmQ= 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=+ol+wIMDDYu7e+V4lYapWAJa5L3g/Qmnqf/iFLZIOIM=; b=iDxImDqpw9oaUBtKEALCSniWAf7QjT2NP9Z8V6uTwqDMhqaQznhy/fOchzB7Xovvds H3GS7Ak/x/kpdqVN3JZ4/DgUoMugbtHA6H7Xc/iHaLWLT4xL74XoBWTh6EdiKmES3Czv rBhJ4KgGYi+NBDHvPaqXXKEC0OLvBz74F83agQF8jfR85gYqRugr1ox5O4GeM+rLmaCV u+ovkBKrPJzui0RqIGNWlBX2i8KWOwAGSpmuVEyAkniv9zAQkGdD7jgqr55Q4bwqoIhr 16CdQEpwg8FwTwnEO7e1Q2icGW3sHkH5dM/bT5AcRsbyWvGh3Mb7Q7O5y02w9yHYua8f xjuw== X-Gm-Message-State: APt69E25L2bgP3gR/yxoqD0MzAnar4w/I6u1s7qT/Z2JnrYVONRoTio8 UGV9u109EKMuDUxuSeU0UEbIl0UdyyA= X-Received: by 2002:a9d:241:: with SMTP id 59-v6mr8543216otb.71.1529946368565; Mon, 25 Jun 2018 10:06:08 -0700 (PDT) Received: from localhost ([2600:1700:141:4960:88f5:ab30:e569:4ad6]) by smtp.gmail.com with ESMTPSA id t4-v6sm16740553otd.40.2018.06.25.10.06.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 10:06:08 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: Bjorn Andersson , mahesh sivasubramanian , Linus Torvalds , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Andy Gross Subject: [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings Date: Mon, 25 Jun 2018 12:05:47 -0500 Message-Id: <1529946347-12740-2-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> References: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch adds initialization of the entry_header structs to avoid compiler warnings like the following: CC drivers/soc/qcom/cmd-db.o drivers/soc/qcom/cmd-db.c: In function ‘cmd_db_read_addr’: drivers/soc/qcom/cmd-db.c:194:21: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? 0 : le32_to_cpu(ent.addr); drivers/soc/qcom/cmd-db.c: In function ‘cmd_db_read_aux_data_len’: drivers/soc/qcom/cmd-db.c:247:38: warning: ‘ent.len’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? 0 : le16_to_cpu(ent.len); ^ drivers/soc/qcom/cmd-db.c: In function ‘cmd_db_read_slave_id’: drivers/soc/qcom/cmd-db.c:269:7: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] addr = le32_to_cpu(ent.addr); drivers/soc/qcom/cmd-db.c: In function ‘cmd_db_read_aux_data’: drivers/soc/qcom/cmd-db.c:221:10: warning: ‘ent.len’ may be used uninitialized in this function [-Wmaybe-uninitialized] ent_len = le16_to_cpu(ent.len); drivers/soc/qcom/cmd-db.c:226:15: warning: ‘*((void *)&rsc_hdr+4)’ may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy(data, rsc_offset(&rsc_hdr, &ent), len); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/soc/qcom/cmd-db.c:226:15: warning: ‘*((void *)&ent+22)’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Andy Gross --- drivers/soc/qcom/cmd-db.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index deb2b90..1007e79 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -186,7 +186,7 @@ static int cmd_db_get_header(const char *id, struct entry_header *eh, u32 cmd_db_read_addr(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {}; struct rsc_hdr rsc_hdr; ret = cmd_db_get_header(id, &ent, &rsc_hdr); @@ -207,7 +207,7 @@ EXPORT_SYMBOL(cmd_db_read_addr); int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) { int ret; - struct entry_header ent; + struct entry_header ent = {}; struct rsc_hdr rsc_hdr; u16 ent_len; @@ -239,7 +239,7 @@ EXPORT_SYMBOL(cmd_db_read_aux_data); size_t cmd_db_read_aux_data_len(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {}; struct rsc_hdr rsc_hdr; ret = cmd_db_get_header(id, &ent, &rsc_hdr); @@ -258,7 +258,7 @@ EXPORT_SYMBOL(cmd_db_read_aux_data_len); enum cmd_db_hw_type cmd_db_read_slave_id(const char *id) { int ret; - struct entry_header ent; + struct entry_header ent = {}; struct rsc_hdr rsc_hdr; u32 addr;