Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2214243pxb; Mon, 12 Apr 2021 18:11:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6sgAc8Oee90HboxvQG98tGYPX3Sv+H/foWvO4BVhXVpvnJZesmzT7KNhFht66Cmxmzie5 X-Received: by 2002:a05:6402:1bdc:: with SMTP id ch28mr31545564edb.202.1618276287091; Mon, 12 Apr 2021 18:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618276287; cv=none; d=google.com; s=arc-20160816; b=fQaufwSsLz9AsgeLwWRC/YbCfuW8wfgUIXBicXklZoAOefkaCwAtlkVkYPEdAL388w 4cl+alg/4eE0g4Oah+EHgy0Finu8p+2fd4sUhYAzIcZcaplhqhu4G+tCFXIo0qVzBl56 VE1NGncWcmFilYN/rdyWXfvrOfoRwll9sOy4zfjY22UWzMn+zubjc3tKmvX4NVRlfxsd fg1uQxM3lwzWYtqIkc7AwxFwCmnvg+o5Z7LR6qfW0H7vv8wdPPpIxRs0DP1yZWVJkB1l pFjn0dA3dUE3HHohlpcyrOq+ZZ6T/Swd+t1j3K4w/8Al3czpkDRggv5BXCisiaqBJAZx /ZEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version; bh=54EWtr+cx6ZAIZ+eiX481QwVtP/AkGbSY/kZbk1qUzg=; b=Nqowg/XE+PWeP/RpvnyHZ6HW2IvwfyjECJSMh105YXegtimxbZYk6UECO2tk9+fODy XRcdYna9MnCo0hgqGr7mt1zV7+NzoQXqkX3XRR3szXwZS22CpB1NRaNiHGVKZ9DwBsk3 KVmG8We+4A7xX9SZUEEm1vmUtAYX1uuAlz3mufROYMJVwDZ3lBMywMIctUFAmvckVbwu gr/EkXOm9jNQFF/v1hZx9DqkgRovTmG5cb1xkImzYLqD6jXKir7MlxHYQ8flf9GrkmTm cd1yKKYsTqmtLgxA+E9qSViBx/sS4hC1mWc8nkghTgo944qwkBS04OPCWahL78Ke44nB ZUUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=bme.hu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si1304098ejk.321.2021.04.12.18.11.01; Mon, 12 Apr 2021 18:11:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=bme.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240708AbhDLL5P (ORCPT + 99 others); Mon, 12 Apr 2021 07:57:15 -0400 Received: from mail.sch.bme.hu ([152.66.249.140]:25082 "EHLO mail.sch.bme.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240622AbhDLL5O (ORCPT ); Mon, 12 Apr 2021 07:57:14 -0400 Received: from mail-lf1-f47.google.com (209.85.167.47) by Exchange2016-1.sch.bme.hu (152.66.249.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2176.2; Mon, 12 Apr 2021 13:56:55 +0200 Received: by mail-lf1-f47.google.com with SMTP id x13so10783849lfr.2; Mon, 12 Apr 2021 04:56:55 -0700 (PDT) X-Gm-Message-State: AOAM532UEud3TMvdRESMd0e7mc6wuNRdnt6Lua2oCgdbrZ2AyRgn2Huy szzlBfXTB4Pu0u1Vqfwd3dKmZsmWqz+IkDn7jbE= X-Received: by 2002:ac2:5ccd:: with SMTP id f13mr16239768lfq.596.1618228614130; Mon, 12 Apr 2021 04:56:54 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?QmVuY2UgQ3PDs2vDoXM=?= Date: Mon, 12 Apr 2021 13:56:42 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Usage of get_random_bytes() in i2c-cp2615 To: , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.167.47] X-ClientProxiedBy: Exchange2016-1.sch.bme.hu (152.66.249.140) To Exchange2016-1.sch.bme.hu (152.66.249.140) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Normally, `cp2615_i2c_transfer.tag` is a random number that identifies a given request-reply pair (the chip sends its response with the same tag it got in the request). Currently, for the sake of ease, my driver sends its requests with a fixed tag of 0xDD for all requests. This defeats the purpose of the tag system. Should I use `get_random_bytes()` instead? My concerns are that generating a random value for each I2C transfer may lead to the entropy pool being used up, especially since - if I understand correctly - `get_random_bytes()` always generates 32 bit random words and discards any extra bytes if `length%4 != 0`, and I only need 1 byte each time.