Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5604923rwd; Wed, 24 May 2023 04:27:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yJiU/3nXfeYHCZwJlxQoQUEGSj5wArSkJoFjxRQ5HAPnmPfwU5N1pnfd/HDe2aQFQReo4 X-Received: by 2002:a17:90b:197:b0:255:b1e7:dd24 with SMTP id t23-20020a17090b019700b00255b1e7dd24mr4541171pjs.17.1684927626840; Wed, 24 May 2023 04:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684927626; cv=none; d=google.com; s=arc-20160816; b=QwyNVe8ixGvv78SvNECKXsgTX3af228hZbNAvS8FmIou3xmfG9KZMzVjxkgUb6jExM sNh9Yc5qEpUn+rMSK8lf0wgv1IoPgAazAVpkxGckmjQTOX3hSaXRSDwU0xSqNYmuf6CO qBKKn++gpa3JXZ4mZKs1qacqd3G12bXmCecUXj53GYFxiYwAnWxGKRwfVzGhVycI9KTT t+CFFgTO8+i0aiTyxN9PznmQCMrcFOELAYAmK+mRytMUFf26pmsQkCEaZo3peAkzm8pt CzUi14Reeub0EM7Jm+JRe1Je/0SE5WlyEvCPQjjSnAC0CUpVRJn23jTy7lZ4GoeDj7Pb 8caw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3ITYDwvK0mVUtdlYCqyUTm5k9k0c9HINVd/4GAURw7Q=; b=q77pmHGwi6h/jp61BGz2hfM2qX2s5NHk2UXNANDu+x0hzcxVAvh2bhgEPsgGPCGWB9 pN86806wynzZh/XiVYTcosrLbA97RDJfmyrhE6KGX5z5QLqyeQjmqljTrWmSuIYFdufZ aJSQz0/zTSnSNonLo7fOC2kNVCWurqdebuONRwMd1RopFAoVTjyBtDAXz9U2WUsTSZah 0FQjQYggm4drjW7USXCrshm28CB+Cvs5n8+4PQZ6QeORo+Swfvz7qlmgPX94L5tC+z4p Eg19Aag5yV+XXmAXJ9ruBucd4cqwivF9SoBz/gIyu/d2hvtW2NJe/xX4bIuhTP3TIvh0 dXjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cwpr8nOa; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b27-20020a63931b000000b00534758009b3si2586246pge.573.2023.05.24.04.26.51; Wed, 24 May 2023 04:27:06 -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=@intel.com header.s=Intel header.b=Cwpr8nOa; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232942AbjEXKaS (ORCPT + 99 others); Wed, 24 May 2023 06:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjEXKaM (ORCPT ); Wed, 24 May 2023 06:30:12 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834E119C; Wed, 24 May 2023 03:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684924208; x=1716460208; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Vn5Q1SbhiGzeSmlcv4/TFQZ8fpr6DMKn7d980ADEli8=; b=Cwpr8nOatR6p6OZbRyNfLhwGd7SZE2kvLDP46rSHMY+io47zEUJ3t6mD uIdvCM/mhAh2MxsuGAGIn6g+9hxfYE0gX94ZyAmF3iJbM1Y3NEb4unrku HTjZTGJSth0CwxKjwkaQ33peNQ9GRfx7Vas0Uk3OX/6T5cOW0fdAlEUCv Sox3trq4KpOJVvaQ9IvgyB2bzFj8DhCUAiKWgwysE4cmQHgMXFBWujgx9 DTVJoroyrW2hwGwk8COwyqFm8wYQfC/GRRYlUF6+eLHo12aQizOPY7aVs nOO8k4rQB1HrNz1iA7q7EJljGAjJxbjMcsE9A0MmolKf3XUrBvqogvABS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="351035769" X-IronPort-AV: E=Sophos;i="6.00,188,1681196400"; d="scan'208";a="351035769" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 03:30:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="848693324" X-IronPort-AV: E=Sophos;i="6.00,188,1681196400"; d="scan'208";a="848693324" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 24 May 2023 03:30:05 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 24 May 2023 13:30:04 +0300 Date: Wed, 24 May 2023 13:30:04 +0300 From: Heikki Krogerus To: Min-Hua Chen Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: ucsi: correctly access opcode Message-ID: References: <20230523162314.114274-1-minhuadotchen@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230523162314.114274-1-minhuadotchen@gmail.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Wed, May 24, 2023 at 12:23:12AM +0800, Min-Hua Chen wrote: > hdr->opcode is __le32 type, use le32_to_cpu() to cast opcode > to integer in the switch..case statement to fix the following > sparse warnings: > > drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer > drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer > drivers/usb/typec/ucsi/ucsi_glink.c:248:20: sparse: warning: restricted __le32 degrades to integer > > No functional change. > > Signed-off-by: Min-Hua Chen Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/ucsi/ucsi_glink.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c > index b454a5159896..1fe9cb5b6bd9 100644 > --- a/drivers/usb/typec/ucsi/ucsi_glink.c > +++ b/drivers/usb/typec/ucsi/ucsi_glink.c > @@ -245,7 +245,7 @@ static void pmic_glink_ucsi_callback(const void *data, size_t len, void *priv) > struct pmic_glink_ucsi *ucsi = priv; > const struct pmic_glink_hdr *hdr = data; > > - switch (hdr->opcode) { > + switch (le32_to_cpu(hdr->opcode)) { > case UC_UCSI_READ_BUF_REQ: > pmic_glink_ucsi_read_ack(ucsi, data, len); > break; > -- > 2.34.1 -- heikki